5

I was trying to save in Emacs and pushed something wrong and Emacs closed. Judging by

ps aux | grep emacs

the emacs process is still running with the file I need to save running. (Opening the file in new emacs process complains that the file is used by another emacs process).

How can I reattach to the running Emacs session or at least make it save its work before I kill it?

manatwork
  • 30,549
  • 7
  • 101
  • 91
UldisK
  • 370
  • 3
  • 10

1 Answers1

8

Found out I was pushing Ctrl-x, Ctrl-z.

Solution was to execute:

fg %emacs 
manatwork
  • 30,549
  • 7
  • 101
  • 91
UldisK
  • 370
  • 3
  • 10
  • I only have to hit C-z to suspend emacs, and then `fg` to resume it. It **should** be possible to disable this with `stty susp ''` (as it's very easy to mistype, that'd be great) but it is not working for me (i.e., still possible to suspend). – Emanuel Berg Oct 30 '12 at 18:47
  • 1
    @EmanuelBerg `stty susp` only applies when the terminal is in [cooked](http://unix.stackexchange.com/questions/21752/whats-the-difference-between-a-raw-and-a-cooked-device-driver) mode. Emacs put the terminal in raw mode and handles combinations like `Ctrl+Z` internally. – Gilles 'SO- stop being evil' Oct 30 '12 at 22:59
  • 1
    To disable this, in `.emacs`, put: `(put 'suspend-frame 'disabled t)` - but, if you accidentally mistype, you'll still get an annoying popup message saying it is disabled, so use `C-h f suspend-frame RET` to find out what keys will do it, then (in my case) `(global-set-key (kbd "C-z") nil)` and `(global-set-key (kbd "C-x C-z") nil)`. – Emanuel Berg Nov 06 '12 at 02:28