From 44cd3d378a84a7d41b6d019f435e77ad9edfe755 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 9 Sep 2026 16:29:17 +0300 Subject: [PATCH] ; Tell in the user manual how to customize daemon sessions * doc/emacs/cmdargs.texi (Initial Options): Document 'server-after-make-frame-hook' and how to use it in daemon sessions. (Bug#81829) --- doc/emacs/cmdargs.texi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index f9904d1f2e6..232d366f76b 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -414,6 +414,22 @@ about using Emacs as a daemon. A ``background'' daemon disconnects from the terminal and runs in the background (@samp{--daemon} is an alias for @samp{--bg-daemon}). +@vindex server-after-make-frame-hook +@cindex customizations don't work in daemon sessions +If you have in your init file (@pxref{Init File}) customizations that +need various capabilities available only on graphic displays, or +activate there optional features which need such capabilities, like +colors, mouse, fonts, etc., such customizations might not work when you +start Emacs as a daemon, because the daemon lacks access to a capable +display. Instead, define a Lisp function which performs all those +customizations, and then use @code{add-to-list} to add that function to +the list that is the value of the hook variable +@code{server-after-make-frame-hook} (@pxref{Init Examples}). Then these +customizations will be run by Emacs after it creates a frame when you +invoke @command{emacsclient}. (You will probably need to arrange for +these customizations to run only once, the first time a client frame is +created.) + @item --no-desktop @opindex --no-desktop Do not reload any saved desktop. @xref{Saving Emacs Sessions}.