Skip to main content

Questions tagged [quitting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
53 views

how to get emacsclient to behave like emacs?

I don't like that emacsclient keeps buffers open. Is there a way so when I C-x C-c out of a session, it behaves like a regular emacs instance and kills all associated buffers? It'd also be nice if ...
user129393192's user avatar
0 votes
0 answers
33 views

C-g sometimes doesn't work

For the past several weeks, I've experienced an erratic and hard-to-diagnose behavior: the C-g key binding sometimes doesn't work. Strangely, this problem doesn't affect alternative bindings of ...
Pablo's user avatar
  • 320
0 votes
0 answers
53 views

Emacs hangs the network when C-g or M-x keyboard-quit, what does keyboard-quit do behind the scenes?

Working with emacs on a new RH8 network accessed from a remote windows machine using VNC. Emacs is running on RH8. Starting from emacs -Q when I perform C-g or M-x keyboard-quit emacs hangs and the ...
Mikef's user avatar
  • 175
4 votes
1 answer
83 views

How to prevent displaying "Quit" when pressing C-g?

Looking for a way to silent Emacs. By using this technique I can ignore some messages. But it does not work for C-g as it use signal function internal. How to prevent displaying "Quit" when ...
Saddle Point's user avatar
0 votes
0 answers
25 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's user avatar
  • 1,642
1 vote
1 answer
29 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
209 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
587 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
54 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
73 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,390
1 vote
1 answer
76 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,273
4 votes
1 answer
384 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
  • 625
1 vote
0 answers
52 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,270
4 votes
3 answers
578 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
2 votes
2 answers
12k 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
761 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
  • 1,035
0 votes
2 answers
174 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
1 vote
1 answer
166 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
  • 113
1 vote
1 answer
688 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-...
emonigma's user avatar
  • 1,907
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
228 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
128 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
207 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,878
1 vote
2 answers
512 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
725 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
183 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,596
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
5 votes
0 answers
517 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
  • 631
2 votes
1 answer
832 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
20k 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,995
4 votes
1 answer
146 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
92 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
149 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
373 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
306 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,470
2 votes
1 answer
322 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
427 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.4k
7 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,893
64 votes
4 answers
10k 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
  • 741