Questions tagged [quitting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

with-local-quit: do I need to set quit-flag to nil?

I have this code: (defun my-test () (interactive) (save-excursion (let ((inhibit-quit t)) (with-local-quit (goto-char (point-min)) (while (search-forward "foo&...
Gabriele Nicolardi's user avatar
1 vote
1 answer
26 views

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 ...
Colin Fraizer's user avatar
1 vote
1 answer
198 views

Why does `eshell` not create an active process In Emacs while `shell` and `term` do?

In Emacs, the features shell, term, and eshell are different commands used for similar goals. When executed, shell and term create active processes in Emacs. I expected the same for eshell. However, ...
Pedro Delfino's user avatar
5 votes
1 answer
420 views

How to exit minibuffer with one key?

How can I tell emacs that one key press of <f12> should terminate the minibuffer, like C-g does by default? I tried in scratch buffer: (global-set-key (kbd "<f12>") 'keyboard-...
John Doe's user avatar
  • 169
0 votes
0 answers
50 views

It now takes multiple C-g presses to cancel actions in minibuffer window

I'm a long time Emacs user. For years it took a single C-g to cancel the operation in progress in the minibuffer. For example: C-x b to invoke switch to buffer C-g to cancel C-x C-f to visit file In ...
DinkumSoftware's user avatar
0 votes
1 answer
53 views

How can I apply `(toggle-debug-on-quit)` ignore ` Debugger entered Lisp error: (minibuffer-quit)`

I have (toggle-debug-on-quit) in my init.el file due to find a issue that makes emacs hangs. But it also catches minibuffer-quit. Would it be possible to ignore catched errors for Debugger entered--...
alper's user avatar
  • 1,300
1 vote
1 answer
56 views

Capturing "quit" in the completion prompt

I need to use completion prompt, but also capture the fact when the user hits <escape> or C-g. Here's an example: (let ((proj (completing-read "choose project:" projectile-known-...
iLemming's user avatar
  • 1,233
4 votes
1 answer
320 views

why do I need to use ctrl-G twice to quit a minibuffer prompt?

Sometime recently emacs started making me hit C-g twice to quit a minibuffer prompt and I can't figure out how or why it's doing this. What happens is I start a minibuffer command -- say, C-x C-f -- ...
Dan Drake's user avatar
  • 573
1 vote
0 answers
47 views

How can I make sure I can stop a long operation in emacs?

I have a lisp function which performs a transformation on a buffer. It's usually quick, but sometimes it's very slow when the buffer is big. I can see it's working, because it prints out its progress ...
Tom's user avatar
  • 1,190
4 votes
3 answers
524 views

EXWM - How to close another emacs opened inside exwm?

Inside EXWM (from "term") I opened another Emacs session (git commit opened it). How do I close this Emacs session?
Everton J. Carpes's user avatar
1 vote
2 answers
10k views

How can I exit emacs without saving any changes

I would like to be able to exit emacs without saving changes. I might have started editing some configuration file, then decided that I don't want to save the changes. In vi I would issue the q! ...
Bruno Ranschaert's user avatar
8 votes
2 answers
664 views

How to move the cursor to a newly opened buffer only when the newly opened buffer can be closed with q?

Some buffers can be closed by being in them and pressing q such as the help buffer, doing C-h k M-x will open a help buffer describing the keybinding M-x. Although, the cursor will stay in the ...
scribe's user avatar
  • 990
0 votes
2 answers
142 views

Value of confirm-kill-processes is ignored

When closing emacs, if I have unsaved buffers its a long process of having to read the questions (at first the logic is 'n' to not save and exit), then it changes to must type yes. Ideally there would ...
user avatar
0 votes
1 answer
162 views

How do I prevent `M-x` then `C-g` from entering the debugger?

M-x version gives: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-12-02 Quitting the minibuffer in general, or (e.g.,) pressing M-x -> C-g in particular opens a *...
Harold's user avatar
  • 103
1 vote
1 answer
655 views

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-...
miguelmorin's user avatar
  • 1,805
0 votes
0 answers
45 views

How do you write an abortable function?

How do you wrote an abortable function, so that when user presses C-g during execution, this function is "stopped" ;; my function so far (defun my/elfeed-extra-info-2 () (interactive) (next-line) ...
american-ninja-warrior's user avatar
1 vote
2 answers
203 views

Aggressive C-g config

Is there a way to configure C-g (or some other key?) to not be usable as normal input in any context, part of a key binding, etc, and instead have it quit in more contexts? e.g. I'd like C-x C-g to ...
fread2281's user avatar
6 votes
2 answers
2k views

How can I kill all unmodified buffers / files and delete their related frames?

How can I close all unmodified buffers? Usually after a day of work - I've got a ton of buffers / frames open. Right now I have to navigate to each frame and close it - which then prompts me if the ...
Chris Stryczynski's user avatar
3 votes
2 answers
125 views

How to save last Emacs session time and hostname to a log file on quit/close

Background / Problem: I have 2 machines sharing a file directory using Google drive. I edit the shared files using Emacs on both machines alternatively everyday. I would like to make sure that at ...
AhLeung's user avatar
  • 1,083
5 votes
2 answers
196 views

Closing emacsclient after quitting calc?

I'd like to run calc in an emacsclient in my terminal, and then have that particular emacsclient session close completely and return me to my shell when calc quits. I've got the first part of that ...
izkon's user avatar
  • 1,828
1 vote
2 answers
505 views

Stop GNU Emacs (GUI) on macOS from quitting

Is it possible to stop Emacs on macOS from quitting? This may sound like a weird request, but numerous times I may accidentally quit Emacs and the whole GUI app exits -- which means I then have to ...
Diego Barros's user avatar
2 votes
2 answers
696 views

C-g has stopped breaking out of commands like `C-x C-f` and `M-x` in graphical emacs-25

I have always used C-g (ie keyboard-quit) to break out of commands like M-x and C-x C-f. At some point not too long ago this stopped working. All that happens is that Quit flashes in the minibuffer ...
Daniel Mahler's user avatar
4 votes
1 answer
175 views

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 ...
jue's user avatar
  • 4,501
5 votes
3 answers
2k views

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 ...
nonopolarity's user avatar
4 votes
0 answers
474 views

Quitting emacs is very slow

Quitting my Emacs takes a really long time. Is there a good way to track what's happening while quitting Emacs? (So far I'm turning to git blame to figure out what changes I have made to cause this ...
diadochos's user avatar
  • 611
2 votes
1 answer
789 views

How to make emacs prompt yes or no to save the session when desktop-save-mode is on?

I started to use emacs a few days ago and still getting the hang of it. desktop-save-mode is really handy at times as I don't have to reopen all the files that I had already opened in my previous ...
Chakravarthy Raghunandan's user avatar
64 votes
2 answers
19k views

What do I do when Emacs is frozen? [duplicate]

What should I do when Emacs stops responding? My current "emacs-is-frozen" protocol looks like this: Spam C-g (it sometimes works) Wait for a while. pkill -9 emacs What alternate steps could I try ...
Clément's user avatar
  • 3,973
4 votes
1 answer
132 views

Confirm quit only for keyboard shortcut, not for window close via mouse

I activated setq-local confirm-kill-emacs (quote y-or-n-p) on a hook for a local mode which has a shortcut very similar to C-x C-c, in order to avoid accidentally closing Emacs when trying to execute ...
anol's user avatar
  • 195
1 vote
1 answer
91 views

failed compile command runs on exit, prevents exit – how to track down?

I'm on a new system (Amazon Linux 2015.9), and my emacs config seems to not like the stock install (Emacs 24.3.1) or vice-versa. When I do C-x C-c it runs save-buffers-kill-terminal. But this fails, ...
billc's user avatar
  • 173
2 votes
5 answers
148 views

Leave point in original position when C-g is pressed?

I am writing a function to select a region (say 2 lines). (defun select-some-region () (interactive) (push-mark (point) nil t) (forward-line 2)) When point is in a buffer like this |...
Chillar Anand's user avatar
10 votes
2 answers
371 views

How to set temporary halt after C-x C-c?

If I run C-x C-c in emacs, it will close immediately. If I set confirm-kill-emacs to y-or-n-p it will ask for confirmation before closing. Instead of y-or-n-p, I want to set some temporary timer for ...
Chillar Anand's user avatar
2 votes
1 answer
297 views

How to debug slow respond or halt? [duplicate]

I try to comments 1.4K+ lines in a C++ function by using M-; or rectangle insert string //. Wait for several minutes, Emacs still no respond. I have to kill Emacs. In this case, how could I locate ...
Enze Chi's user avatar
  • 1,450
1 vote
1 answer
312 views

how to quit describe-key function?

I forgot what a key is bound to, so I decided to run C-h k <my key binding> But after pressing C-h k, I've remembered about that key binding and decided to quit. So I pressed C-g. Instead of ...
Chillar Anand's user avatar
6 votes
1 answer
419 views

Interrupt ELisp interpreter from outside Emacs? [duplicate]

Sometimes Lisp hangs due to an infinite loop, making the whole of Emacs unresponsive, so it can't process any input, C-g included. So, I was hoping for there to be a way to maybe send it an emergency ...
wvxvw's user avatar
  • 11.3k
6 votes
2 answers
2k views

Emacs doesn't let me exit without selecting a coding system

Sometimes to speed up of opening an emacs' eshell directly from terminal (in my case from MS DOS prompt), I do emacs -Q -f eshell. But when I try to exit emacs doesn't let it, unless I give some input ...
Name's user avatar
  • 7,749
62 votes
4 answers
9k views

Debugging a frozen Emacs

I am using mew for my e-mail. I need to use TLS with my email provider for SMTP. However, when I try to invoke that, Emacs freezes. I would like to take this opportunity to learn more about Emacs ...
Svante's user avatar
  • 721