Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs: close buffers list on selection

Tags:

emacs

elisp

Is there a configuration hook to make the "Buffers List" buffer automatically closing when a buffer is selected in such window? Each time the buffer list opens and I select a buffer I have to manually close it using C-x C-k and this is annoying, also because it leaves the frame split in at least two windows.

like image 205
fluca1978 Avatar asked Nov 12 '12 09:11

fluca1978


People also ask

How do I close all buffers in Emacs?

If you run one Emacs session for a period of days, as many people do, it can fill up with buffers that you used several days ago. The command M-x clean-buffer-list is a convenient way to purge them; it kills all the unmodified buffers that you have not used for a long time.

Can you only have one buffer open in Emacs at a time?

You can have several buffers open at once, but can edit only one at a time. Several buffers can be visible at the same time when you're splitting your window.

How many buffer can be open in Emacs at a time?

At any time, one and only one buffer is selected. It is also called the current buffer. Often we say that a command operates on "the buffer" as if there were only one; but really this means that the command operates on the selected buffer (most commands do).

What does buffer mean in EMAC?

Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer.


1 Answers

Not sure about a config option, but you can always use q (or a C-x 1 in your current buffer) instead of C-x C-k to close the temp buffer.

P.S. Almost nobody uses buffer-list these days. Most Emacs users simply remap it to ibuffer (its much smarter and you might like the fact that its temp buffer disappears by default):

(global-set-key (kbd "C-x C-b") 'ibuffer)
like image 152
Bozhidar Batsov Avatar answered Sep 25 '22 13:09

Bozhidar Batsov