mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-09-18 16:06:59 -05:00
Prevent doom to kill emacs before dumping package list
New behavior is introduced here: > commit e632871a115528a9c1ce90d7d2147873009716eb > Author: Henrik Lissner <henrik@lissner.net> > Date: Mon Aug 24 00:36:52 2020 -0400 > > core-cli: backport more refactors from rewrite > > Still a long way to go, but this introduces a few niceties for > debugging CLI failures: > > + The (extended) output of the last bin/doom command is now logged to > ~/.emacs.d/.local/doom.log > + If an error occurs, short backtraces are displayed whether or not you > have debug mode on. The full backtrace is written to > ~/.emacs.d/.local/doom.error.log. > + bin/doom now aborts with a warning if: > - The script itself or its parent directory is a symlink. It's fine if > ~/.emacs.d is symlinked though. > - Running bin/doom as root when your DOOMDIR isn't in /root/. > - If you're sporting Emacs 26.1 (now handled in the elisp side rather > than the /bin/sh shebang preamble). > + If a 'doom sync' was aborted prematurely, you'll be warned that Doom > was left in an inconsistent state and that you must run `doom sync` > again. > > May address #3746 The above commit introduces an explicit call to `(kill-emacs)` at the end of doom cli's main function. This conflicts with `nix-straight.el`'s package collection as it would run after doom is initialized. The commit disables `(kill-emacs)` method while package collection is in progress.
This commit is contained in:
11
advice.el
11
advice.el
@@ -7,15 +7,22 @@
|
||||
;;; have a properly configured user home and environment.
|
||||
(setq package-check-signature nil)
|
||||
|
||||
(defun nix-straight-inhibit-kill-emacs (arg)
|
||||
(message "[nix-doom-emacs] Inhibiting (kill-emacs)"))
|
||||
|
||||
(advice-add 'nix-straight-get-used-packages
|
||||
:before (lambda (&rest r)
|
||||
:around (lambda (orig-fn &rest r)
|
||||
(message "[nix-doom-emacs] Advising doom installer to gather packages to install...")
|
||||
(advice-add 'doom-autoloads-reload
|
||||
:override (lambda (&optional file force-p)
|
||||
(message "[nix-doom-emacs] Skipping generating autoloads...")))
|
||||
(advice-add 'doom--print
|
||||
:override (lambda (output)
|
||||
(message output)))))
|
||||
(message output)))
|
||||
(advice-add 'kill-emacs
|
||||
:override #'nix-straight-inhibit-kill-emacs)
|
||||
(apply orig-fn r)
|
||||
(advice-remove 'kill-emacs 'nix-straight-inhibit-kill-emacs)))
|
||||
|
||||
(advice-add 'y-or-n-p
|
||||
:override (lambda (q)
|
||||
|
Reference in New Issue
Block a user