tags:

views:

74

answers:

2

Emacs seems to save synchronously, i.e. the interface locks up during a save.

This is especially noticeable when using tramp.

Is there any way to have the save happen in the background?

+3  A: 

I don't think you can for a user-initiated save. AFAIK Emacs (at least GNU Emacs) is not multithreaded so you can't kick off an asynchronous save.

Timo Geusch
I find myself deferring saving because of this, and I've noticed myself automatically 'batching saves' even when not using tramp - I've lost work this way. Any way to bring emacs back to the future?
EoghanM
Have you tried auto save as described here http://www.gnu.org/s/emacs/manual/html_node/emacs/Auto-Save.html#Auto-Save ?
Timo Geusch
With tramp, autosave also hangs the interface randomly so is useless. But yes, I did manage to set autosave up to save locally.... I don't remember emacs ever recovering a local autosave from a remote crash though..
EoghanM
Autosave would hang the interface because it's still running in the foreground, but it's only supposed to run when the editor is idle, hence the blocking you're seeing.
Timo Geusch
A: 

Emacs runs in a single thread and there is no way to work around this. As a matter of fact making Emacs multi-threaded is one of the most voted features for Emacs 24. So you're out of luck, at least for now... On the positive side imagine the pain of the users reading their mail in Emacs, while waiting to synchronize their huge mailboxes ;-)

Bozhidar Batsov