6

Is there some mode where emacs fixes a small window with a list of opened buffers? This is what simpler editors have (kate,gedit,etc).

Here's an example from Kate:

enter image description here

In the left window there is a list of opened files. This is rather independent from the main editing window, while being connected. Some examples: I can maximize the whole set, it doesn't disappear if I split/unsplit the main editing windows.

(Edited for clarity)

6

M-x speedbar and typing b (buffer display mode). This gives you a narrow dedicated frame with the required information.

  • 1
    Can I have it together with the main window? So that I don't have to handle two separate windows? For instance if I maximize the main edit window, the speedbar disappears. – Fernando César Oct 18 '15 at 7:40
  • 1
    @Fernando César: I don't think so, unfortunately. – Dieter.Wilhelm Oct 18 '15 at 8:04
  • 1
    Try srspeedbar for a separate window rather than frame. – Dan Oct 18 '15 at 10:18
  • @Dan: How would you do that? – Dieter.Wilhelm Oct 18 '15 at 10:51
  • @Dieter.Wilhelm answered below about sr-speedbar – Brian Burns Dec 11 '15 at 0:46
3

To include the speedbar in the main frame, use the sr-speedbar library - M-x package-list-packages, look for sr-speedbar, then hit i then x to install it.

To turn it on and off, call sr-speedbar-toggle - then you can bind it to a convenient key in your .emacs file, e.g.

(global-set-key (kbd "M-1") 'sr-speedbar-toggle)

With a little tweaking you can get it over on the left side of the screen and looking a little nicer. Try M-x customize-apropos sr-speedbar and M-x customize-apropos speedbar to set various options.

There's a bit more info on the Emacs Wiki - http://www.emacswiki.org/emacs/SrSpeedbar.

It would be great if these libraries could be merged and included in Emacs someday.

  • I do like sr-speedbar, just what I was looking for, just one little nit. I wish when I select the buffer and hit enter the window would go away, like sr-speedbar-close was called. Could I do this with defadvise or something? – jtgd Apr 23 '16 at 7:37
  • Nevermind, got it: (advice-add 'speedbar-edit-line :after #'sr-speedbar-close) – jtgd Apr 23 '16 at 7:42
2

The command to open the list of buffers that you want is list-buffers. It is bound to C-x C-b by default.

Put this in your init file, or use M-x customize-option RET special-display-buffer-names to customize the variable to include an entry for buffer *Buffer List*:

(add-to-list 'special-display-buffer-names "*Buffer List*")

Then the buffer list will be in its own, dedicated frame.

  • Yes, I know list-buffers, but is not really adapted to a small column. By your answer I guess what I was thinking doesn't exits. – Fernando César Oct 17 '15 at 21:01
  • 1
    Then your question is unclear. In particular it is unclear what you mean by "I can ... open a buffer list ...." Please show your code (what you've tried), what you expect/want, and how what you have tried so far differs from that. Also, presumably you do not mean "opened buffers" in your title and description, but rather a "list of names of opened buffers". If so, please edit to make this clear. – Drew Oct 17 '15 at 22:28
  • 1
    Hy @Drew. I edited the question. I hope it's more clear what I was asking. I'm not developing anything, I was just asking if emacs has an option I see often in other editors. – Fernando César Oct 18 '15 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.