11
votes
Accepted
How can I kill all unmodified buffers / files and delete their related frames?
One way would be to use ibuffer:
Open ibuffer (I have it bound to a key, but M-x ibuffer will work.)
Mark all modified buffers: * m
Toggle the marks, so that unmodified buffers are marked instead: t
...
8
votes
Accepted
How can I exit emacs without saving any changes
To exit emacs, use C-xC-c. It will ask you whether you want to save the changes. To prevent the question, precede the combination with C-u (but it will save the changes).
If you want to kill Emacs ...
6
votes
Accepted
Closing emacsclient after quitting calc?
You could use hook calc-end-hook to hook delete-frame.
emacsclient -t --eval '(progn (add-hook (quote calc-end-hook) (lambda () (delete-frame))) (calc nil t))'
6
votes
Debugging a frozen Emacs
None of the other answers work for me. When my emacs hangs, I can only bring it back by killing and restarting it, but then after a while it hangs again. So there has to be a way to find out the ...
6
votes
How to prevent displaying "Quit" when pressing C-g?
The main job of C-g (keyboard-quit) is to raise the quit signal. The message “Quit” comes from the error-message property of the symbol quit. You can make this an empty string:
(put 'quit 'error-...
6
votes
Accepted
How to move the cursor to a newly opened buffer only when the newly opened buffer can be closed with q?
The easiest, and I think best, way to get behavior similar to what you describe is to customize option help-window-select to non-nil (M-x customize-option help-window-select).
If you do that then when ...
5
votes
Accepted
How to exit minibuffer with one key?
You want to bind keys for the minibuffer in a minibuffer keymap. If you want a key to work in all minibuffers then bind it in keymap minibuffer-local-map:
(define-key minibuffer-local-map (kbd "&...
5
votes
How can I exit emacs without saving any changes
In most cases, an emacs instance runs for a very long time: what comes and goes is the buffer visiting a file. So instead of killing emacs as a whole, it is probably more useful to kill the buffer ...
5
votes
Accepted
Stop GNU Emacs (GUI) on macOS from quitting
See kill-emacs-query-functions, which lets you query yourself to confirm quitting, to avoid accidental quitting.
See desktop.el, which lets you save most of the state of your session when you quit, ...
4
votes
If I press CTRL-x CTRL-c and exited the scratch buffer in Emacs, will everything I typed be gone?
@Harald answered your question.
But I would not say "unfortunately". This is by design. Buffer *scratch* is designed for what its name suggests and its initial contents describe: It is a scratchpad,...
4
votes
Accepted
Why does `eshell` not create an active process In Emacs while `shell` and `term` do?
As mentioned in the manual page on Processes, the term process refers to an OS process. Emacs runs in a process, but can invoke other external processes and manage them as subprocesses. When you run M-...
3
votes
Accepted
How can I apply `(toggle-debug-on-quit)` ignore ` Debugger entered Lisp error: (minibuffer-quit)`
Try adding minibuffer-quit to debug-ignored-errors.
You can do this using:
(add-to-list 'debug-ignored-errors 'minibuffer-quit)
3
votes
EXWM - How to close another emacs opened inside exwm?
The best solution is simply to hit C-c C-k (exwm-input-release-keyboard) which puts the X-window containing the inner emacs into char-mode. Then, when that window has focus, almost all keyboard input,...
3
votes
Accepted
EXWM - How to close another emacs opened inside exwm?
The problem is that any commands you execute such as C-x C-c will be captured by the Emacs instance running EXWM.
The first thing to try - which did not work for OP - is to execute M-x exwm-input-grab-...
3
votes
Accepted
How do I prevent `M-x` then `C-g` from entering the debugger?
To reproduce exactly the same behavior in emacs -Q:
M-x toggle-debug-on-quit
M-x C-g
Looks like you have the debug-on-quit variable set to non-nil. Either directly or by toggle-debug-on-quit command ...
3
votes
Accepted
Unable to quit emacs with `Wrong type argument: hash-table-p, nil`
What is the actual problem and what can I do about it?
The hash is only initialized in mu4e-headers-mode. Therefore, you should correct mu4e-execute-marks in the following way if you want to call it ...
3
votes
Accepted
C-g has stopped breaking out of commands like `C-x C-f` and `M-x` in graphical emacs-25
This appears to be some kind of bug related to the GTK graphical toolkit. Switching to the Lucid build reportedly avoids the problem. For more about the difference between those toolkits, see my ...
3
votes
Accepted
how to read messages which appear after `C-x C-c`?
When killing Emacs, there are several hooks that may end up being called -- including, but not limited to, kill-emacs-hook, kill-buffer-hook (when a buffer is killed), write-file-functions hook (if a ...
3
votes
Debugging a frozen Emacs
When nothing else works besides a hard kill of Emacs, I finally developed something that utilizes a little known feature of Emacs, what I call special events callbacks. It works by telling Emacs to ...
2
votes
If I press CTRL-x CTRL-c and exited the scratch buffer in Emacs, will everything I typed be gone?
The short answer is yes, unfortunately. But see this question for hints on avoiding this in the future.
2
votes
How to move the cursor to a newly opened buffer only when the newly opened buffer can be closed with q?
The functions that bring up the *Help* window will sometimes move you to that window and sometimes not. That depends among other things on how many windows you had open before. In the common case ...
2
votes
Accepted
Capturing "quit" in the completion prompt
@NickD's comment above led me to this snippet:
(let ((selected (condition-case _err
(completing-read "choose project:" projectile-known-projects)
(quit &...
2
votes
C-g sometimes doesn't work
I'm getting this too, and it's infuriating. You mentioned Transient and, since I also use it (through Magit and some personal commands), it made me consider if it was somehow responsible. Transient ...
1
vote
with-local-quit: do I need to set quit-flag to nil?
Quit flag
The quit flag is part of the elisp evaluator itself.
C-h v quit-flag
Typing C-g sets ‘quit-flag’ to t, regardless of ‘inhibit-quit’, but
‘inhibit-quit’ non-nil prevents anything from taking ...
1
vote
How to recover a runaway emacs?
You can try multiple C-g. Better yet, you can try ESC ESC ESC. And you can try C-]. And if Emacs is somewhat responsive you might be able to use M-x top-level, to exit all recursive edits.
See the ...
1
vote
why do I need to use ctrl-G twice to quit a minibuffer prompt?
This was a dependency package -- org-random-todo depends on alert. Uninstalling and reinstalling org-random-todo seems to have cleared up the problem. So something in the installation seems to have ...
1
vote
1
vote
How can I kill all unmodified buffers / files and delete their related frames?
There are two parts to your question:
Kill all unmodified buffers.
Delete their frames.
For #2, do you really mean frames? In Emacs, a "frame" is a window-manager window, and an (Emacs) "window" is ...
1
vote
How to save last Emacs session time and hostname to a log file on quit/close
Not exactly the answer you are expecting, but:
If you are running on GNU/Linux in a GNOME environment, you could try the upcoming Emacs 26.1. Tramp offers a new method there, gdrive, which allows you ...
1
vote
Stop GNU Emacs (GUI) on macOS from quitting
You may consider setting (setq confirm-kill-emacs 'yes-or-no-p) as described in
https://www.gnu.org/software/emacs/manual/html_node/emacs/Exiting.html
One convenient function to use as the value ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
quitting × 40minibuffer × 6
key-bindings × 5
exit × 5
debugging × 4
frozen-emacs × 4
buffers × 2
osx × 2
hooks × 2
frames × 2
emacsclient × 2
error-handling × 2
org-mode × 1
elisp × 1
shell × 1
completion × 1
eshell × 1
mu4e × 1
term × 1
region × 1
commands × 1
process × 1
character-encoding × 1
compilation × 1
mark × 1