dev: merge branch 'master' of github.com:doomemacs

This commit is contained in:
Matt Nish-Lapidus 2024-08-26 11:03:42 -04:00
commit 3770a8d88f
20 changed files with 130 additions and 46 deletions

View file

@ -486,7 +486,8 @@ files, so this replace calls to `pp' with the much faster `prin1'."
(defun doom-set-jump-h ()
"Run `better-jumper-set-jump' but return nil, for short-circuiting hooks."
(better-jumper-set-jump)
(when (get-buffer-window)
(better-jumper-set-jump))
nil)
;; Creates a jump point before killing a buffer. This allows you to undo
@ -495,7 +496,7 @@ files, so this replace calls to `pp' with the much faster `prin1'."
;;
;; I'm not advising `kill-buffer' because I only want this to affect
;; interactively killed buffers.
(advice-add #'kill-current-buffer :around #'doom-set-jump-a)
(add-hook 'kill-buffer-hook #'doom-set-jump-h)
;; Create a jump point before jumping with imenu.
(advice-add #'imenu :around #'doom-set-jump-a))

View file

@ -568,7 +568,7 @@ elsewhere."
nil))))
;; Merge given plist with pre-existing one
(cl-loop for (key value) on (list ,@plist) by 'cddr
when value
when (or (eq key :pin) value)
do (cl-callf plist-put plist key value))
;; Some basic key validation; throws an error on invalid properties
(condition-case e

View file

@ -247,6 +247,12 @@
Defaults to ~/.config/doom, ~/.doom.d or the value of the DOOMDIR envvar;
whichever is found first. Must end in a slash.")
(defvar doom-bin-dir (expand-file-name "bin/" doom-emacs-dir)
"Where Doom's executables are stored.
Defaults to $EMACSDIR/bin, where $EMACSDIR is `doom-emacs-dir'. Must end in a
slash.")
;; DEPRECATED: .local will be removed entirely in 3.0
(defvar doom-local-dir
(if-let (localdir (getenv-internal "DOOMLOCALDIR"))

View file

@ -55,20 +55,30 @@ And jumps to your `doom!' block."
(defmacro doom--if-compile (command on-success &optional on-failure)
(declare (indent 2))
`(let ((default-directory doom-emacs-dir))
(with-current-buffer (compile ,command t)
(let ((w (get-buffer-window (current-buffer))))
(select-window w)
(add-hook
'compilation-finish-functions
(lambda (_buf status)
(if (equal status "finished\n")
(progn
(delete-window w)
,on-success)
,on-failure))
nil 'local)))))
`(let ((default-directory doom-emacs-dir)
(exec-path (cons doom-bin-dir exec-path)))
;; Ensure the bin/doom operates with the same environment as this
;; running session.
(letenv! (("EMACS" (doom-path invocation-directory invocation-name))
("EMACSDIR" doom-emacs-dir)
("DOOMDIR" doom-user-dir)
("DOOMLOCALDIR" doom-local-dir)
("DEBUG" (and doom-debug-mode "1")))
(with-current-buffer (compile ,command t)
(let ((w (get-buffer-window (current-buffer))))
(select-window w)
(add-hook
'compilation-finish-functions
(lambda (_buf status)
(if (equal status "finished\n")
(progn
(delete-window w)
,on-success)
,on-failure))
nil 'local))))))
(defvar doom-reload-command "doom sync -B -e"
"Command that `doom/reload' runs.")
;;;###autoload
(defun doom/reload ()
"Reloads your private config.
@ -83,7 +93,7 @@ package list, and lastly, reloads your private config.el.
Runs `doom-after-reload-hook' afterwards."
(interactive)
(mapc #'require (cdr doom-incremental-packages))
(doom--if-compile (format "%S sync -e" doom-bin)
(doom--if-compile doom-reload-command
(doom-context-with '(reload modules)
(doom-run-hooks 'doom-before-reload-hook)
(doom-load (file-name-concat doom-user-dir doom-module-init-file) t)
@ -131,10 +141,12 @@ imported into Emacs."
(doom-load-envvars-file doom-env-file)
(message "Reloaded %S" (abbreviate-file-name doom-env-file))))))
(defvar doom-upgrade-command "doom upgrade -B --force"
"Command that `doom/upgrade' runs.")
;;;###autoload
(defun doom/upgrade ()
"Run 'doom upgrade' then prompt to restart Emacs."
(interactive)
(doom--if-compile (format "%S upgrade --force" doom-bin)
(doom--if-compile doom-upgrade-command
(when (y-or-n-p "You must restart Emacs for the upgrade to take effect.\n\nRestart Emacs?")
(doom/restart-and-restore))))