diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-02-03 13:00:47 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-02-03 13:00:47 +0200 |
commit | abd59ad923452cf342ba9d5eadf52bea02a261b0 (patch) | |
tree | cabdba146f571ed2c081717ae17f56b715bcdf25 | |
parent | 9b0cdf461c24e36cedda27c700febebb00b40909 (diff) | |
download | emacs-abd59ad923452cf342ba9d5eadf52bea02a261b0.tar.gz |
Fix "Buffers->Frames" submenu in daemon sessions
* lisp/menu-bar.el (menu-bar-update-buffers): Detect the initial
frame by its special terminal's name. (Bug#53740)
* src/terminal.c (init_initial_terminal): Add comment about using
the initial-terminal's name in menu-bar.el.
-rw-r--r-- | lisp/menu-bar.el | 3 | ||||
-rw-r--r-- | src/terminal.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 891cdfd5d59..7678b1ece66 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2346,7 +2346,8 @@ It must accept a buffer as its only required argument.") ;; 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) + (unless (equal (terminal-name (frame-terminal frame)) + "initial_terminal") (push frame frames))) ;; Make the menu of buffers proper. (setq buffers-menu diff --git a/src/terminal.c b/src/terminal.c index 3db80f4b1ff..80f3aed7006 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -622,6 +622,8 @@ init_initial_terminal (void) emacs_abort (); initial_terminal = create_terminal (output_initial, NULL); + /* Note: menu-bar.el:menu-bar-update-buffers knows about this + special name of the initial terminal. */ initial_terminal->name = xstrdup ("initial_terminal"); initial_terminal->kboard = initial_kboard; initial_terminal->delete_terminal_hook = &delete_initial_terminal; |