summary refs log tree commit diff
path: root/pkgs/build-support/emacs/wrapper.nix
diff options
context:
space:
mode:
authormidchildan <git@midchildan.org>2021-02-25 22:30:40 +0900
committermidchildan <git@midchildan.org>2021-02-25 22:30:40 +0900
commit7208e57cf6b601530f5844a4df22672539cb30d9 (patch)
treea241f1f8deeebe24f052c9440d12174b6faa5c1b /pkgs/build-support/emacs/wrapper.nix
parent2852f58cbf0e96829a36422852925bb91154aa18 (diff)
downloadnixpkgs-7208e57cf6b601530f5844a4df22672539cb30d9.tar
nixpkgs-7208e57cf6b601530f5844a4df22672539cb30d9.tar.gz
nixpkgs-7208e57cf6b601530f5844a4df22672539cb30d9.tar.bz2
nixpkgs-7208e57cf6b601530f5844a4df22672539cb30d9.tar.lz
nixpkgs-7208e57cf6b601530f5844a4df22672539cb30d9.tar.xz
nixpkgs-7208e57cf6b601530f5844a4df22672539cb30d9.tar.zst
nixpkgs-7208e57cf6b601530f5844a4df22672539cb30d9.zip
emacsWithPackages: prevent the UI showing prematurely during startup
This change makes the wrapper script avoid displaying echo area messages
during startup. This helps prevent split second UI glitches early in the
startup process. The messages itself will still be logged and therefore
will not hamper inspection for debugging purposes.
Diffstat (limited to 'pkgs/build-support/emacs/wrapper.nix')
-rw-r--r--pkgs/build-support/emacs/wrapper.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix
index f34835eaf09..fcbf5bcabe6 100644
--- a/pkgs/build-support/emacs/wrapper.nix
+++ b/pkgs/build-support/emacs/wrapper.nix
@@ -147,9 +147,15 @@ runCommand
         # Begin the new site-start.el by loading the original, which sets some
         # NixOS-specific paths. Paths are searched in the reverse of the order
         # they are specified in, so user and system profile paths are searched last.
+        #
+        # NOTE: Avoid displaying messages early at startup by binding
+        # inhibit-message to t. This would prevent the Emacs GUI from showing up
+        # prematurely. The messages would still be logged to the *Messages*
+        # buffer.
         rm -f $siteStart $siteStartByteCompiled $subdirs $subdirsByteCompiled
         cat >"$siteStart" <<EOF
-        (load-file "$emacs/share/emacs/site-lisp/site-start.el")
+        (let ((inhibit-message t))
+          (load-file "$emacs/share/emacs/site-lisp/site-start.el"))
         (add-to-list 'load-path "$out/share/emacs/site-lisp")
         (add-to-list 'exec-path "$out/bin")
         ${optionalString nativeComp ''