From 9e0d507c37ab44947118cbcab9f21386108fbeb4 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 24 Aug 2021 20:23:02 +0300 Subject: [PATCH] * lisp/mouse.el (context-menu-buffers): New function (bug#50067). (context-menu-functions): Add context-menu-buffers to the choice list. --- lisp/mouse.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- 2.39.2