1

Buffer name

Is there a way to do this? Currently, the click events are bound to previous/next buffer, but I would rather like to see a list of all buffers when I click the buffer name. Perhaps, it could make use of a simple OS native context menu similar to the major and minor mode buttons:

OS native context menu

3
  • 1
    Not an answer, but what you ask for doesn't seem particularly useful to me (I typically have 300-600 buffers open). I mean, it's not a kind of info which is easily displayed using drop-down. What if clicking the buffer name instead opened the buffer with the list of all buffers?
    – wvxvw
    Commented Apr 19, 2015 at 19:23
  • Interesting, I never have more than ten buffers open at a time. What is the advantage of having that many buffers open vs., say, using ag to find a particular file?
    – Lenar Hoyt
    Commented Apr 19, 2015 at 19:55
  • 1
    Well, it's mostly because they pile up over time... but other than that, there are few operations I use very often from Ibuffer which work on multiple buffers. Plus I keep several shells open and lots of Dired buffers on several machines... but usually about 1/3 of all buffers aren't associated with files: all kinds of shells or buffers which collect process output (logs) etc. Also mail adds a lot of it.
    – wvxvw
    Commented Apr 19, 2015 at 20:49

1 Answer 1

2

Try this:

(define-key mode-line-buffer-identification-keymap [mode-line mouse-3] 'list-buffers)

That does not show buffers whose names begin with a space. If you really want to show all buffers, then try this instead:

(define-key mode-line-buffer-identification-keymap
            [mode-line mouse-3]
            (lambda ()
              (interactive)
              (display-buffer (list-buffers-noselect nil (buffer-list)))))

(However, I agree with those who commented that this is a very useful thing to do.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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