From 2009832a8229ac90c255bdb0f2dd333e8a2a48be Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 31 May 2021 07:29:51 +0200 Subject: [PATCH] Make `menu-bar-select-buffer' obsolete * lisp/menu-bar.el (menu-bar-select-buffer): Make obsolete (bug#15651). * lisp/msb.el (msb--select-buffer): Move function here and rename. (msb--make-keymap-menu): Use it. --- lisp/menu-bar.el | 1 + lisp/msb.el | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index b71c6502077..739e751d8a4 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2241,6 +2241,7 @@ Buffers menu is regenerated." "String to display in buffer listings for buffers not visiting a file.") (defun menu-bar-select-buffer () + (declare (obsolete nil "28.1")) (interactive) (switch-to-buffer last-command-event)) diff --git a/lisp/msb.el b/lisp/msb.el index 1064f940905..1f05e9db589 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -1052,9 +1052,12 @@ variable `msb-menu-cond'." (msb--split-menus-2 list 0 nil) list)) +(defun msb--select-buffer () + (interactive) + (switch-to-buffer last-command-event)) + (defun msb--make-keymap-menu (raw-menu) - (let ((end 'menu-bar-select-buffer) - (mcount 0)) + (let ((mcount 0)) (mapcar (lambda (sub-menu) (cond @@ -1063,7 +1066,7 @@ variable `msb-menu-cond'." (t (let ((buffers (mapcar (lambda (item) (cons (buffer-name (cdr item)) - (cons (car item) end))) + (cons (car item) 'msb--select-buffer))) (cdr sub-menu)))) (nconc (list (cl-incf mcount) (car sub-menu) 'keymap (car sub-menu)) -- 2.39.2