Questions tagged [exit]
25 questions
15
votes
3 answers
a confirmation after C-x C-c before exiting Emacs
Can I configure Emacs to ask for confirmation before exiting on C-x C-c? (Sometimes, my fingers press this by mistake.)

imz -- Ivan Zakharyaschev
- 591
- 6
- 20
12
votes
3 answers
Possible to "detach" a child process?
I use browse-url/browse-url-firefox to open links in Firefox from within Emacs 24.5.1 under Linux (Fedora 23) which in essence executes the firefox executable with the URL by start-process. If there is already a Firefox instance running, this will…

Tim Landscheidt
- 467
- 3
- 8
10
votes
1 answer
Why emacsclient say to quit with C-x 5 0?
As soon as I open emacsclient I found the following message in the minibuffer: When done with this frame, type C-x 5 0, I find it strange that it advices how to close the frame with delete-frame, any reason to display the message or prefer it over…

marcanuy
- 798
- 6
- 20
8
votes
2 answers
Exiting emacs without confirmation to kill running processes
It turned out not to be the same problem as Kill process buffer without confirmation?: emacs asks for different kind of confirmations when exiting and when just killing a buffer.
How to specify for all or specific processes (e.g. one launched with…

user905686
- 327
- 2
- 11
8
votes
1 answer
Quitting Emacs and re-enabeling touchpad
I have the below elisp code in my emacs config which disables my touchpad, so it won't annoy me when writing.
;; disable touchpad when on emacs
(defun turn-off-mouse (&optional frame)
(interactive)
(call-process-shell-command "xinput --disable…

seds
- 183
- 3
5
votes
3 answers
If I press CTRL-x CTRL-c and exited the scratch buffer in Emacs, will everything I typed be gone?
My Internet was not working, and while waiting it to go back up, I used Emacs to type some ideas first.
A few minutes later, the Internet was up, and I checked my Chrome browser, and it worked. So I will use Google Docs instead, I thought.
So I came…

nonopolarity
- 273
- 1
- 7
5
votes
1 answer
How to exit from .emacs init file?
I want to debug my init file, by exiting from loading the file in the middle so if something is wrong after that place it will not be loaded. How can I exit from .emacs file?

jcubic
- 691
- 1
- 4
- 16
4
votes
4 answers
Ask for saving contents if scratch buffer is modified before exit
I had made some random notes in my scratch buffer.
By mistake, I pressed C-x C-c and killed the Emacs session.
All my content in the scratch buffer was gone.
Question:
When I try to close Emacs when the scratch buffer had been edited, I want Emacs…

Prasanna
- 1,470
- 16
- 30
4
votes
1 answer
how to read messages which appear after `C-x C-c`?
When I exit emacs via C-x C-c (save-buffers-kill-terminal) it prints a message in minibuffer. I can't read the message because the frame gets destroyed too fast.
I'd like to read the message(s), how can I do this?

jue
- 4,476
- 8
- 20
3
votes
2 answers
Reminds to clock out or just clock out when there has a clock running
Sometimes when we use "clock in" command in org mode and forget to clock out before exit emacs. When we open emacs again and try to "clock in" with the same entry. There always popup with something for us to choose. Does there exists some command to…

lhstat
- 65
- 6
3
votes
1 answer
Calling a function when emacs process is killed (MS Windows)
I would like to call a function just before emacs exits. Normally the following can do job:
(add-hook 'kill-emacs-hook 'my-function)
Unfortunately when I shutdown the system (MS Windows) or terminating the emacs process by some external tools, this…

Name
- 7,689
- 4
- 38
- 84
2
votes
1 answer
Delete auto-save file when killing Emacs without saving buffer
When I have unsaved buffers and I kill Emacs with save-buffers-kill-terminal (C-x C-c) I'm asked whether to save each buffer. Is it possible to delete a buffer's auto-save data when I answer n?
I had tried to add a function that deletes the…

Arch Stanton
- 1,525
- 9
- 22
1
vote
1 answer
How to recover a runaway emacs?
Sometimes I'll open a large structured files (say, JSON) using json-mode, but the contents are malformed in some way (or something) and my Emacs session will suddenly spike my CPU to 100% and become unresponsive. Attempting to quit with C-g seems…

Colin Fraizer
- 740
- 4
- 12
1
vote
1 answer
How to pass an optional agrument to kill-emacs?
I would like a way to make emacs to return a non-zero exit code when exiting.
This page https://www.gnu.org/software/emacs/manual/html_node/elisp/Killing-Emacs.html lists the command
kill-emacs &optional exit-data
as a mechanism for making emacs…

ianinini
- 113
- 4
1
vote
1 answer
Unable to quit emacs with `Wrong type argument: hash-table-p, nil`
I have some customisations in ~/.emacs.el. Today I refactored a piece that used dolist, directory-files, and find-file. I am now unable to quit Emacs in the normal way and I get this from the mini-buffer:
Wrong type argument: hash-table-p, nil
I…

miguelmorin
- 1,751
- 11
- 33