diff --git a/early-init.el b/early-init.el index c6e6b4d68..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,17 +49,17 @@ (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. - (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)) @@ -84,7 +85,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) @@ -94,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 @@ -112,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 @@ -133,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. 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 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") 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/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")) 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 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"