How do I close all but the current buffer in Emacs? Similar to "Close other tabs" feature in modern web browsers?
相关问题
- Symbol's function definition is void: declare-
- How can I set the SVN password with Emacs 23.1 bui
- Emacs shell: save commit message
- emacs bind key to the insertion of another
- Emacs - set mark on edit location
相关文章
- ess-rdired: I get this error “no ESS process is as
- Emacs/xterm color annoyance on Linux
- Does learning one Lisp help in learning the other?
- Pipe less to Emacs
- Capturing the output of “diff” with org-babel
- emacs terminal mode: how to copy and paste efficie
- How to permanently enable the hs-minor-mode in ema
- Pipe emacs shell output to a new buffer
This is what you want:
source: https://blasphemousbits.wordpress.com/2007/05/04/learning-emacs-part-4-buffers-windows-and-frames/
From EmacsWiki: Killing Buffers:
Edit: updated with feedback from Gilles
There is a built in command m-x
kill-some-buffers
(I'm using 24.3.50) In my nextstep gui (not tried in a terminal but sure it's similar) you can then approve which buffers to kill.There isn't a way directly in emacs to do this.
You could write a function to do this. The following will close all the buffers:
I found this solution to be the simplest one. This deletes every buffer except the current one. You have to add this code to your
.emacs
fileOf course, then you use it with M-x
kill-other-buffers
RET or you paste the following code in the.emacs
file too and then just press C-xC-bIt works as you expected.
And after reading @Starkey's answer, I think this will be better:
(buffer-list (current-buffer)) will return a list that contains all the existing buffers, with the current buffer at the head of the list.
This is my first answer on StackOverflow. Hope it helps :)