From: Juri Linkov Date: Tue, 24 Aug 2021 17:23:02 +0000 (+0300) Subject: * lisp/mouse.el (context-menu-buffers): New function (bug#50067). X-Git-Tag: emacs-28.0.90~1326 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e0d507c37ab44947118cbcab9f21386108fbeb4;p=emacs.git * lisp/mouse.el (context-menu-buffers): New function (bug#50067). (context-menu-functions): Add context-menu-buffers to the choice list. --- diff --git a/lisp/mouse.el b/lisp/mouse.el index 9d866813848..a490aac7445 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -293,6 +293,7 @@ the same menu with changes such as added new menu items." (function-item context-menu-global) (function-item context-menu-local) (function-item context-menu-minor) + (function-item context-menu-buffers) (function-item context-menu-vc) (function-item context-menu-ffap) (function :tag "Custom function"))) @@ -362,6 +363,17 @@ the same menu with changes such as added new menu items." (cdr mode)))) menu) +(defun context-menu-buffers (menu) + "Submenus with buffers." + (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) + (define-key-after menu [separator-buffers] menu-bar-separator) + (map-keymap (lambda (key binding) + (when (consp binding) + (define-key-after menu (vector key) + (copy-sequence binding)))) + (mouse-buffer-menu-keymap)) + menu) + (defun context-menu-vc (menu) "Version Control menu." (define-key-after menu [separator-vc] menu-bar-separator)