0

When I want to kill a buffer and I have my hands on the keyboard it's simply C-x k RET but if I have already the right hand on the mouse the k RET part is a bit out of reach for my left hand…

Fortunately in the toolbar there is a "kill this buffer" button but unfortunately I turned off the toolbar…

How can I add a "kill this buffer" entry to the "Buffers" menu?


Update²

I have implemented the solution proposed in comment but now I see two problems

  1. easy-menu-add-item postpend to the "Buffer" menu, it's ergonomically speaking more logical to have kill-buffer at the top, but I can change the position only if I know the string that identifies the menu entry where I want to place kill-buffer and the buffer menu is inherently dynamic, so that I don't know how to resolve this issue.
  2. kill-buffer still needs keyboard interaction, in the form of a confirmation RET in the minibuffer.I remembered that the toolbar "kill buffer" button did not ask for confirmation, so I activated the toolbar, C-h k click toolbar and now in my .emacs I have kill-this-buffer, issue resolved.

New question: how can I fix those two issues the position of the new menu entry?


Footnote

Researching this topic I've found this answer and this repo but I'd rather prefer just a few lines in my ~/.emacs if possible.

  • You have in a very detailed answer from @Tobias here – Muihlinn Jun 19 at 9:17
  • Does this answer your question? add command to the "Buffers" menu – Muihlinn Jun 19 at 9:17
  • This answer completely addresses my concerns. I'm voting to close my question. Thanks a lot @Muihlinn – gboffi Jun 19 at 9:22
  • I've changed my mind, see the edit – gboffi Jun 19 at 9:45
  • @Drew Thank you for the excellent edit – gboffi Jun 20 at 9:45

Your Answer

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

Browse other questions tagged or ask your own question.