GNU bug report logs - #64873
server-make-frame-hook

Previous Next

Package: emacs;

Reported by: chiel <machiel.kroon <at> gmail.com>

Date: Wed, 26 Jul 2023 14:57:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64873 in the body.
You can then email your comments to 64873 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64873; Package emacs. (Wed, 26 Jul 2023 14:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to chiel <machiel.kroon <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Jul 2023 14:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: chiel <machiel.kroon <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: server-make-frame-hook
Date: Wed, 26 Jul 2023 09:24:50 +0200
[Message part 1 (text/plain, inline)]
For some reason the server-after-make-frame-hook is runs, even if no
new frame is created. Both by using emacsclient from the terminal and from
Nautilus.

minimal setup:

```emacs-lisp "testinit.el"
(require 'server)
(unless (server-running-p)
  (server-start))

(add-to-list 'initial-frame-alist '(fullscreen . maximized))

(add-hook 'server-after-make-frame-hook #'(lambda () (interactive)
                                            (if (= (length
(visible-frame-list)) 1)
                                                (toggle-frame-maximized))))
```

emacs -Q -l testinit.el;
(opens frame maximized as intended)
(then from terminal or filebrowser (I altered the desktop file))
emacsclient testinit.el;
(toggles frame maximized)
emacsclient otherfile.el;
(toggles frame maximized)

The after-make-frame-hook does work as expected

In GNU Emacs 29.0.92 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-07-23 built on HQ
Repository revision: ac075176bf077ad79272e3d6c032c0658e4e19fc
Repository branch: emacs-29
System Description: Arch Linux

Configured using:
 'configure --with-mailutils --with-json --with-native-compilation=aot
 --with-pgtk --without-X'

(I know the latter doesn't exist)

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Info

Minor modes in effect:
  shell-dirtrack-mode: t
  global-flycheck-mode: t
  global-company-mode: t
  company-mode: t
  electric-pair-mode: t
  save-place-mode: t
  override-global-mode: t
  server-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  isearch-fold-quotes-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug misearch multi-isearch pulse color debug
backtrace rect face-remap mule-util cl-print dabbrev tabify cus-edit pp
cus-start cus-load shortdoc help-fns radix-tree info-look org-indent
org-bullets oc-basic org-element org-persist org-id org-refile avl-tree
ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus
nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig
gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo
gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7
nnoo parse-time gnus-spec gnus-int gnus-range message sendmail
yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus nnheader
gnus-util text-property-search mail-utils range mm-util mail-prsvr
wid-edit ol-docview doc-view filenotify jka-compr image-mode exif dired
dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi
org-link-doi org-tempo tempo ob-shell shell ob-R ob-python python compat
treesit org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src
ob-comint org-pcomplete pcomplete comint ansi-osc org-list org-footnote
org-faces org-entities time-date noutline outline ob-emacs-lisp ob-core
ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc
org-loaddefs cal-menu calendar cal-loaddefs org-version org-compat
org-macs format-spec display-line-numbers yasnippet-snippets yasnippet
flycheck-aspell ispell flycheck ansi-color find-func dash
company-oddmuse company-keywords company-etags etags fileloop generator
xref project ring company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company finder-inf edmacro kmacro
modus-operandi-theme modus-themes pcase ffap thingatpt elec-pair
saveplace delight comp comp-cstr warnings icons rx cl-extra help-mode
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core server
all-the-icons-autoloads delight-autoloads ein-autoloads
deferred-autoloads anaphora-autoloads elpy-autoloads company-autoloads
ess-autoloads exwm-autoloads flycheck-aspell-autoloads
flycheck-autoloads highlight-indentation-autoloads julia-mode-autoloads
julia-vterm-autoloads markdown-mode-autoloads math-preview-autoloads
dash-autoloads openwith-autoloads org-bullets-autoloads
pdf-tools-autoloads pkg-info-autoloads epl-autoloads polymode-autoloads
pyvenv-autoloads request-autoloads s-autoloads tablist-autoloads
vterm-autoloads websocket-autoloads with-editor-autoloads info
compat-autoloads xelb-autoloads yasnippet-snippets-autoloads
yasnippet-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk pgtk lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 548080 201375)
 (symbols 48 32235 81)
 (strings 32 131028 59653)
 (string-bytes 1 3836278)
 (vectors 16 61227)
 (vector-slots 8 1739831 373036)
 (floats 8 631 1093)
 (intervals 56 4569 4741)
 (buffers 976 27))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64873; Package emacs. (Wed, 26 Jul 2023 18:33:01 GMT) Full text and rfc822 format available.

Message #8 received at 64873 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: chiel <machiel.kroon <at> gmail.com>
Cc: 64873 <at> debbugs.gnu.org
Subject: Re: bug#64873: server-make-frame-hook
Date: Wed, 26 Jul 2023 21:32:44 +0300
> From: chiel <machiel.kroon <at> gmail.com>
> Date: Wed, 26 Jul 2023 09:24:50 +0200
> 
> For some reason the server-after-make-frame-hook is runs, even if no
> new frame is created. Both by using emacsclient from the terminal and from Nautilus.

I think this is a documentation problem: the hook is run when the
server starts using a client frame, regardless of whether it was
created or reused from an existing frame.

In what real-life situation is this a problem?




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 27 Jul 2023 06:38:01 GMT) Full text and rfc822 format available.

Notification sent to chiel <machiel.kroon <at> gmail.com>:
bug acknowledged by developer. (Thu, 27 Jul 2023 06:38:01 GMT) Full text and rfc822 format available.

Message #13 received at 64873-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: chiel <machiel.kroon <at> gmail.com>
Cc: 64873-done <at> debbugs.gnu.org
Subject: Re: bug#64873: server-make-frame-hook
Date: Thu, 27 Jul 2023 09:38:37 +0300
> From: chiel <machiel.kroon <at> gmail.com>
> Date: Wed, 26 Jul 2023 21:37:41 +0200
> 
> I was trying to get the first frame maximized, whilst running an Emacs daemon through systemd. 
> With some compromise I finally constructed something I can work with.
> I guess I was running into some issues because of the name of after-make-frame-functions (and the
> Exec format of the desktop file)
> Thanks for reaching out though! I already figured the easiest fix was the doc. 

Thanks.  I've now clarified the documentation of this variable, and
I'm therefore closing this bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Aug 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 302 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.