summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-02-03 09:28:43 +0800
committerPo Lu <luangruo@yahoo.com>2022-02-03 09:29:31 +0800
commitaa67e10fe97fad65430780439df337ae8a463dac (patch)
tree12141fb087d17a0e20dad45cd279b1816374a685 /lisp/menu-bar.el
parent7728f493cd1416bac45be4b4495c989e12caf3ac (diff)
downloademacs-aa67e10fe97fad65430780439df337ae8a463dac.tar.gz
Prevent the initial frame from showing up in the frame menu
* lisp/menu-bar.el (menu-bar-update-buffers): Ignore initial frame when generating frame list. (bug#53740)
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index bde34ac910d..891cdfd5d59 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2342,9 +2342,12 @@ It must accept a buffer as its only required argument.")
(and (lookup-key (current-global-map) [menu-bar buffer])
(or force (frame-or-buffer-changed-p))
(let ((buffers (buffer-list))
- (frames (frame-list))
- buffers-menu)
-
+ frames buffers-menu)
+ ;; Ignore the initial frame if present. It can happen if
+ ;; Emacs was started as a daemon. (bug#53740)
+ (dolist (frame (frame-list))
+ (unless (eq frame frame-initial-frame)
+ (push frame frames)))
;; Make the menu of buffers proper.
(setq buffers-menu
(let ((i 0)