From 3dbbd8b68d99d04f0020e5fdb0dd2a7fb841a045 Mon Sep 17 00:00:00 2001 From: Colin Woodbury Date: Tue, 6 Feb 2024 15:16:29 +0900 Subject: [PATCH 1/8] feat(common-lisp): introduce `sly-overlay` --- modules/lang/common-lisp/config.el | 13 +++++++------ modules/lang/common-lisp/packages.el | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index 3acb60bc5..e24ffcbb5 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -110,12 +110,13 @@ :desc "Remove notes" "n" #'sly-remove-notes :desc "Compile region" "r" #'sly-compile-region) (:prefix ("e" . "evaluate") - :desc "Evaluate buffer" "b" #'sly-eval-buffer - :desc "Evaluate last" "e" #'sly-eval-last-expression - :desc "Evaluate/print last" "E" #'sly-eval-print-last-expression - :desc "Evaluate defun" "f" #'sly-eval-defun - :desc "Undefine function" "F" #'sly-undefine-function - :desc "Evaluate region" "r" #'sly-eval-region) + :desc "Evaluate buffer" "b" #'sly-eval-buffer + :desc "Evaluate defun" "d" #'sly-overlay-eval-defun + :desc "Evaluate last" "e" #'sly-eval-last-expression + :desc "Evaluate/print last" "E" #'sly-eval-print-last-expression + :desc "Evaluate defun (async)" "f" #'sly-eval-defun + :desc "Undefine function" "F" #'sly-undefine-function + :desc "Evaluate region" "r" #'sly-eval-region) (:prefix ("g" . "goto") :desc "Go back" "b" #'sly-pop-find-definition-stack :desc "Go to" "d" #'sly-edit-definition diff --git a/modules/lang/common-lisp/packages.el b/modules/lang/common-lisp/packages.el index 0917fe0c4..07c972ca4 100644 --- a/modules/lang/common-lisp/packages.el +++ b/modules/lang/common-lisp/packages.el @@ -4,4 +4,5 @@ (when (package! sly :pin "ed17d2c2bd7aead0fbb09c3d22861c80a522a097") (package! sly-asdf :pin "6f9d751469bb82530db1673c22e7437ca6c95f45") (package! sly-macrostep :pin "5113e4e926cd752b1d0bcc1508b3ebad5def5fad") - (package! sly-repl-ansi-color :pin "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048")) + (package! sly-repl-ansi-color :pin "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048") + (package! sly-overlay :pin "916b50297a1f3bb110f840b89b8717d194623e5f")) From eb4e8960af0570bac997cb3c70cb39a7d9b16a24 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 Feb 2024 15:45:57 -0500 Subject: [PATCH 2/8] refactor: remove all-the-icons I began phasing out all-the-icons in 9787022. Now that Doom has no (first order) dependencies that depend on it (and enough time has passed), it's time to remove it. Ref: 9787022b839d --- lisp/packages.el | 1 - 1 file changed, 1 deletion(-) diff --git a/lisp/packages.el b/lisp/packages.el index 0020e1c61..11bd02520 100644 --- a/lisp/packages.el +++ b/lisp/packages.el @@ -20,7 +20,6 @@ :pin "b3760f5829dba37e855add7323304561eb57a3d4") ;; doom-ui.el -(package! all-the-icons :pin "ee414384938ccf2ce93c77d717b85dc5538a257d") (package! nerd-icons :pin "c6a4acf19454b415cba1c43daf4bfca8fccdd9ba") (package! hide-mode-line :pin "bc5d293576c5e08c29e694078b96a5ed85631942") (package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307") From fe18640376b1bbbb4e084305abbeee41f137eaa7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 Feb 2024 15:48:39 -0500 Subject: [PATCH 3/8] fix: --profile switch in noninteractive sessions This fixes command-line-args getting prematurely cleared out just before being scanned for a --profile switch. Fix: #7457 Co-authored-by: hpfr --- early-init.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/early-init.el b/early-init.el index c6e6b4d68..a7fc58d29 100644 --- a/early-init.el +++ b/early-init.el @@ -51,14 +51,14 @@ ;; notable saving in startup time. This let-binding is just a stopgap though, ;; a more complete version of this optimization can be found in lisp/doom.el. (let (file-name-handler-alist) - (let* (;; FIX: Unset `command-line-args' in noninteractive sessions, to - ;; ensure upstream switches aren't misinterpreted. - (command-line-args (unless noninteractive command-line-args)) - ;; I avoid using `command-switch-alist' to process --profile (and - ;; --init-directory) because it is processed too late to change - ;; `user-emacs-directory' in time. - (profile (or (cadr (member "--profile" command-line-args)) - (getenv-internal "DOOMPROFILE")))) + (let (;; FIX: Unset `command-line-args' in noninteractive sessions, to + ;; ensure upstream switches aren't misinterpreted. + (command-line-args (unless noninteractive command-line-args)) + ;; I avoid using `command-switch-alist' to process --profile (and + ;; --init-directory) because it is processed too late to change + ;; `user-emacs-directory' in time. + (profile (or (cadr (member "--profile" command-line-args)) + (getenv-internal "DOOMPROFILE")))) (if (null profile) ;; REVIEW: Backported from Emacs 29. Remove when 28 support is dropped. (let ((init-dir (or (cadr (member "--init-directory" command-line-args)) From 5c3b8203350c2e9685754494cff90a14a056a3c9 Mon Sep 17 00:00:00 2001 From: Zero King Date: Wed, 7 Feb 2024 12:59:30 +0800 Subject: [PATCH 4/8] fix: void-variable doom-modules-load-path error Amend: 343c3a82b06a --- lisp/doom-modules.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/doom-modules.el b/lisp/doom-modules.el index bafce77a3..b0c1a58d2 100644 --- a/lisp/doom-modules.el +++ b/lisp/doom-modules.el @@ -279,7 +279,7 @@ configdepth. See `doom-module-set' for details." (append (seq-remove #'cdr (doom-module-list nil initorder?)) (doom-files-in (if (listp paths-or-all) paths-or-all - doom-modules-load-path) + doom-module-load-path) :map #'doom-module-from-path :type 'dirs :mindepth 1 From f55131f7458545903a2f9e9899d38e4363f35ec6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 Feb 2024 16:38:58 -0500 Subject: [PATCH 5/8] fix: early-init: expand string-remove-suffix Some builds of Emacs inexplicably fail to autoload subr-x at startup, meaning functions like string-remove-suffix are not guaranteed to be available. Rather than eagerly load the library too early, I opt for the safer option: to expand the single call into its lower level components. Ref: #7608 --- early-init.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index a7fc58d29..a8438e050 100644 --- a/early-init.el +++ b/early-init.el @@ -84,7 +84,10 @@ (or (load (expand-file-name (format (let ((lfile (getenv-internal "DOOMPROFILELOADFILE"))) (if lfile - (concat (string-remove-suffix ".el" lfile) + (concat (let ((suffix ".el")) + (if (string-suffix-p suffix lfile) + (substring lfile 0 (- (length lfile) (length suffix))) + lfile)) ".%d.elc") "profiles/load.%d.elc")) emacs-major-version) From 2fb0bf98ae75836aed2473dce28f0dc21a1c0f1d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 Feb 2024 16:56:59 -0500 Subject: [PATCH 6/8] nit: early-init: revise comments --- early-init.el | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/early-init.el b/early-init.el index a8438e050..922972c02 100644 --- a/early-init.el +++ b/early-init.el @@ -27,16 +27,17 @@ ;;; Code: ;; PERF: Garbage collection is a big contributor to startup times. This fends it -;; off, but will be reset later by `gcmh-mode'. Not resetting it later will -;; cause stuttering/freezes. +;; off, but will be reset later by `gcmh-mode' (or in doom-cli.el, if in a +;; noninteractive session). Not resetting it later causes stuttering/freezes. (setq gc-cons-threshold most-positive-fixnum) ;; PERF: Don't use precious startup time checking mtime on elisp bytecode. ;; Ensuring correctness is 'doom sync's job, not the interactive session's. -;; Still, stale byte-code will cause *heavy* losses in startup efficiency. +;; Still, stale byte-code will cause *heavy* losses in startup efficiency, but +;; performance is unimportant when Emacs is in an error state. (setq load-prefer-newer noninteractive) -;; UX: Respect DEBUG envvar as an alternative to --debug-init, and to make are +;; UX: Respect DEBUG envvar as an alternative to --debug-init, and to make ;; startup sufficiently verbose from this point on. (when (getenv-internal "DEBUG") (setq init-file-debug t @@ -48,8 +49,8 @@ (or ;; PERF: `file-name-handler-alist' is consulted often. Unsetting it offers a - ;; notable saving in startup time. This let-binding is just a stopgap though, - ;; a more complete version of this optimization can be found in lisp/doom.el. + ;; notable saving in startup time. This is just a stopgap though; this + ;; optimization is continued more comprehensively in lisp/doom.el. (let (file-name-handler-alist) (let (;; FIX: Unset `command-line-args' in noninteractive sessions, to ;; ensure upstream switches aren't misinterpreted. @@ -97,13 +98,13 @@ ;; PERF: When `load'ing or `require'ing files, each permutation of ;; `load-suffixes' and `load-file-rep-suffixes' (then `load-suffixes' + - ;; `load-file-rep-suffixes') is used to locate the file. Each permutation - ;; is a file op, which is normally very fast, but they can add up over the - ;; hundreds/thousands of files Emacs needs to load. + ;; `load-file-rep-suffixes') is used to locate the file. Each permutation + ;; amounts to at least one file op, which is normally very fast, but can + ;; add up over the hundreds/thousands of files Emacs loads. ;; ;; To reduce that burden -- and since Doom doesn't load any dynamic modules - ;; -- I remove `.so' from `load-suffixes' and pass the `must-suffix' arg to - ;; `load'. See the docs of `load' for details. + ;; this early -- I remove `.so' from `load-suffixes' and pass the + ;; `must-suffix' arg to `load'. See the docs of `load' for details. (if (let ((load-suffixes '(".elc" ".el"))) ;; I avoid `load's NOERROR argument because other, legitimate errors ;; (like permission or IO errors) should not be suppressed or @@ -115,15 +116,15 @@ ;; Failing that, assume that we're loading a non-Doom config. (file-missing ;; HACK: `startup--load-user-init-file' resolves $EMACSDIR from a - ;; lexically bound `startup-init-directory', which means changes - ;; to `user-emacs-directory' won't be respected when loading - ;; $EMACSDIR/init.el, so I force it to: + ;; lexical (and so, not-trivially-modifiable) + ;; `startup-init-directory', so Emacs will fail to locate the + ;; correct $EMACSDIR/init.el without help. (define-advice startup--load-user-init-file (:filter-args (args) reroute-to-profile) (list (lambda () (expand-file-name "init.el" user-emacs-directory)) nil (nth 2 args))) - ;; Set `user-init-file' for the `load' call further below, and do so - ;; here while our `file-name-handler-alist' optimization is still - ;; effective (benefits `expand-file-name'). BTW: Emacs resets + ;; (Re)set `user-init-file' for the `load' call further below, and + ;; do so here while our `file-name-handler-alist' optimization is + ;; still effective (benefits `expand-file-name'). BTW: Emacs resets ;; `user-init-file' and `early-init-file' after this file is loaded. (setq user-init-file (expand-file-name "early-init" user-emacs-directory)) ;; COMPAT: I make no assumptions about the config we're going to @@ -136,7 +137,7 @@ ;; as a best fit guess. It's better than Emacs' 80kb default. (setq gc-cons-threshold (* 16 1024 1024)) nil))) - ;; ...But if Doom loaded then continue as normal. + ;; ...Otherwise, we're loading a Doom config, so continue as normal. (doom-require (if noninteractive 'doom-cli 'doom-start)))) ;; Then continue on to the config/profile we want to load. From a5ff292cbd294f58b1b77e1e43e14f81f695b6e4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 7 Feb 2024 00:01:34 -0500 Subject: [PATCH 7/8] fix(emacs-lisp): 'defining as dynamic an already lexical var' error Fix: #7653 Amend: 3bea4f66a844 --- modules/lang/emacs-lisp/config.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index a07ae55e3..389589689 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -228,6 +228,8 @@ See `+emacs-lisp-non-package-mode' for details.") ;; expensive functionality, this will often introduce unexpected freezes ;; without this advice. ;; TODO: PR upstream? + (defvar org-inhibit-startup) + (defvar org-mode-hook) (defadvice! +emacs-lisp--optimize-org-init-a (fn &rest args) "Disable unrelated functionality to optimize calls to `org-mode'." :around #'elisp-demos--export-json-file From a2484538b48237636a70e5b4ccd358a4fb03c13c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 7 Feb 2024 00:33:50 -0500 Subject: [PATCH 8/8] bump: :tools magit :emacs vc magit/forge@ba35ffc9bafc -> magit/forge@3fc6c362b016 magit/git-modes@4a61a9b86df9 -> magit/git-modes@3cc94974c09c magit/magit@54d37dc14c3f -> magit/magit@b68e0a3c3388 Ref: magit/forge@3fc6c362b016 --- modules/emacs/vc/packages.el | 4 ++-- modules/tools/magit/packages.el | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/emacs/vc/packages.el b/modules/emacs/vc/packages.el index c9ddf918b..7b1f30628 100644 --- a/modules/emacs/vc/packages.el +++ b/modules/emacs/vc/packages.el @@ -6,9 +6,9 @@ (package! smerge-mode :built-in t) (package! browse-at-remote :pin "76aa27dfd469fcae75ed7031bb73830831aaccbf") -(package! git-commit :pin "54d37dc14c3f715dd0328a70bc65d63c54ee9613") +(package! git-commit :pin "b68e0a3c3388af8daac662f25ccfd3e980590e12") (package! git-timemachine ;; The original lives on codeberg.org; which has uptime issues. :recipe (:host github :repo "emacsmirror/git-timemachine") :pin "ac933e5cd29583c131401f3bd991d98129c316df") -(package! git-modes :pin "4a61a9b86df9c824a99c522f42d55e68faf85f91") +(package! git-modes :pin "3cc94974c09c43462dfbfbe20396a414352dbb92") diff --git a/modules/tools/magit/packages.el b/modules/tools/magit/packages.el index 2fe19978f..726e6fa6d 100644 --- a/modules/tools/magit/packages.el +++ b/modules/tools/magit/packages.el @@ -1,9 +1,9 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/magit/packages.el -(when (package! magit :pin "54d37dc14c3f715dd0328a70bc65d63c54ee9613") +(when (package! magit :pin "b68e0a3c3388af8daac662f25ccfd3e980590e12") (when (modulep! +forge) - (package! forge :pin "b16b6ec4f7612f5a8fc6d50133cc6189f062c183") + (package! forge :pin "3fc6c362b0162082317c128c9c3226529f6965ae") (package! code-review :recipe (:host github :repo "doomelpa/code-review"