1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

More reliably check if a frame is the daemon's initial frame

Frames created when Emacs is running as a daemon may not have the
"client" frame parameter set, e.g., when:

1. Created from the user's init file.
2. Created via "emacsclient -e" (e.g., "emacsclient -e '(make-frame)'").

The "client" parameter simply indicates that the frame was created by
emacsclient directly (or recursively from another emacsclient frame).

Instead, this commit checks if (a) Emacs is running as a daemon and (b)
the target frame is the "terminal frame".  When run as a daemon, Emacs's
terminal frame is always the daemon's initial frame.

* lisp/desktop.el (desktop-clear):
(desktop-restoring-frameset-p):
* lisp/display-fill-column-indicator.el
(display-fill-column-indicator--turn-on):
* lisp/frame.el (frame-notice-user-settings):
* lisp/obsolete/linum.el (linum-on):
* lisp/progmodes/flymake.el (flymake-start):
* lisp/tab-bar.el (tab-bar--update-tab-bar-lines): Fix the "is this the
initial daemon-frame" checks.  (Bug#79686)
This commit is contained in:
Steven Allen 2025-10-28 11:08:53 -07:00 committed by Juri Linkov
parent 97d2a659e8
commit b0eaaf7366
6 changed files with 7 additions and 7 deletions

View file

@ -102,7 +102,7 @@ See Info node `Displaying Boundaries' for details."
(defun display-fill-column-indicator--turn-on ()
"Turn on `display-fill-column-indicator-mode'."
(unless (or (minibufferp)
(and (daemonp) (null (frame-parameter nil 'client))))
(and (daemonp) (eq (selected-frame) terminal-frame)))
(display-fill-column-indicator-mode)))
;;;###autoload