Bug 202010 - kmail with emacs as external editor: text in emacs doesn't make it into composer (is lost) when emacs is closed
Summary: kmail with emacs as external editor: text in emacs doesn't make it into compo...
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 16:23 UTC by Ben Barrowes
Modified: 2009-08-03 20:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Barrowes 2009-07-30 16:23:14 UTC
Version:            (using KDE 4.2.4)
OS:                Linux
Installed from:    Mandriva RPMs

I choose emacs as the external editor in kmail Settings->Configure Kmail->Composer by checking the box "use external editor instead of composer". Fine, after putting "emacs %f" in the "specify editor" box, emacs comes up when I start typing in the composer window. Also fine. However, after typing my mail, saving, then closing emacs, none of that text is handed to composer. It is all lost. 

Doing the same thing with "kwrite %f" works fine, as does nedit. 

emacs, xemacs, gedit all fail in this respect.

I remember trying to figure this out a year or two ago, and I think I remember finding some information that pointed to the problem being in the way kmail expects temporary files to be saved. However, I don't seem to be able to find that information right now.
Comment 1 Martin Koller 2009-08-02 18:48:15 UTC
Confirmed with gvim. Does also not work. I'm going to see why.
Comment 2 Martin Koller 2009-08-02 18:59:07 UTC
With gvim you need to pass the extra option "-f" which tells it not to fork into the background.
If that option is not given, gvim starts another subprocess and terminates the just started one, which is why kmail thinks the editor has already been closed.

Can you check if emacs, gedit has a similar commandline option, please ?
Comment 3 Ben Barrowes 2009-08-03 14:13:47 UTC
Perhaps this isn't much help, but, gedit has a very brief man/--help that says nothing about forking. The emacs man also doesn't mention forking or running in the background. Both processes execute in the foreground from a shell.
Comment 4 Martin Koller 2009-08-03 20:05:03 UTC
ok, I now installed emacs and xemacs, and when configuring "emacs %f" or "xemacs %f" the editing works as expected.

I tried with KDE-4.3 RC3 and with KDE4.4/current trunk.
Didn't test gedit (too much gnome libs to install).

As it works for me, I'll close it for now.
If you can see the problem still with 4.3, please reopen.