git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit7208e57cf6b601530f5844a4df22672539cb30d9 authormidchildan <git@midchildan.org> dateThu 25 Feb 2021, 22:30 (6 years ago) parent2852f58
1 file changed+7−1
pkgs/build-support/emacs/wrapper.nix+7−1
pkgs/build-support/emacs/wrapper.nix+7−1
@@ -147,9 +147,15 @@ runCommand
147147 # Begin the new site-start.el by loading the original, which sets some
148148 # NixOS-specific paths. Paths are searched in the reverse of the order
149149 # they are specified in, so user and system profile paths are searched last.
150+ #
151+ # NOTE: Avoid displaying messages early at startup by binding
152+ # inhibit-message to t. This would prevent the Emacs GUI from showing up
153+ # prematurely. The messages would still be logged to the *Messages*
154+ # buffer.
150155 rm -f $siteStart $siteStartByteCompiled $subdirs $subdirsByteCompiled
151156 cat >"$siteStart" <<EOF
152− (load-file "$emacs/share/emacs/site-lisp/site-start.el")
157+ (let ((inhibit-message t))
158+ (load-file "$emacs/share/emacs/site-lisp/site-start.el"))
153159 (add-to-list 'load-path "$out/share/emacs/site-lisp")
154160 (add-to-list 'exec-path "$out/bin")
155161 ${optionalString nativeComp ''