diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index c7b322ac0..c3f2c9569 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -11,9 +11,11 @@ ;; still yields a notable benefit. Still, avoid setting it to high here, as ;; runaway memory usage is a real risk in longer sessions. (setq gc-cons-threshold 134217728 ; 128mb - gc-cons-percentage 1.0) ; DEPRECATED: backported from 29 + ;; Backported from 29 (see emacs-mirror/emacs@73a384a98698) + gc-cons-percentage 1.0) - ;; Create all our core directories to quell file errors. + ;; REVIEW: Remove these later. The endpoints should be responsibile for + ;; ensuring they exist. For now, they exist to quell file errors. (mapc (doom-rpartial #'make-directory 'parents) (list doom-local-dir doom-data-dir @@ -1161,8 +1163,7 @@ session. This is done by writing a temporary shell script, which is executed after this session ends (see the shebang lines of this file). It's done this way because Emacs' batch library lacks an implementation of the exec system call." - (unless (doom-cli-context-p context) - (error "Attempted `doom-cli--restart' without active context")) + (cl-check-type context doom-cli-context) (when (= (doom-cli-context-step context) -1) (error "__DOOMSTEP envvar missing; extended `exit!' functionality will not work")) (let* ((pid (doom-cli-context-pid context)) diff --git a/lisp/doom-editor.el b/lisp/doom-editor.el index a288cdd61..aa572e32d 100644 --- a/lisp/doom-editor.el +++ b/lisp/doom-editor.el @@ -312,6 +312,10 @@ tell you about it. Very annoying. This prevents that." (abbreviate-file-name (file-truename (tramp-file-name-localname file))) file)) + ;; REVIEW: Use this in lieu of `doom--recentf-file-truename-fn' when we drop + ;; 28 support. See emacs-mirror/emacs@32906819addd. + ;; (setq recentf-show-abbreviated t) + ;; Anything in runtime folders (add-to-list 'recentf-exclude (concat "^" (regexp-quote (or (getenv "XDG_RUNTIME_DIR") diff --git a/lisp/doom-keybinds.el b/lisp/doom-keybinds.el index 327ac581c..62381605c 100644 --- a/lisp/doom-keybinds.el +++ b/lisp/doom-keybinds.el @@ -203,7 +203,7 @@ localleader prefix." ;; Bind `doom-leader-key' and `doom-leader-alt-key' as late as possible to give ;; the user a chance to modify them. -(add-hook! 'after-init-hook +(add-hook! 'doom-after-init-hook (defun doom-init-leader-keys-h () "Bind `doom-leader-key' and `doom-leader-alt-key'." (let ((map general-override-mode-map)) diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index e23fef310..f7d677185 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -21,7 +21,7 @@ "Log a message in *Messages*. Does not emit the message in the echo area. This is a macro instead of a -function to prevent the potentially expensive execution of its arguments when +function to prevent the potentially expensive evaluation of its arguments when debug mode is off." (declare (debug t)) `(when (or init-file-debug noninteractive) diff --git a/lisp/doom-start.el b/lisp/doom-start.el index d9e0a6454..17c4988cf 100644 --- a/lisp/doom-start.el +++ b/lisp/doom-start.el @@ -120,7 +120,7 @@ ;; focus when it is started, among other things, so enable the menu-bar for ;; GUI frames, but keep it disabled in terminal frames because there it ;; activates an ugly, in-frame menu bar. -(when IS-MAC +(eval-when! IS-MAC (add-hook! '(window-setup-hook after-make-frame-functions) (defun doom-restore-menu-bar-in-gui-frames-h (&optional frame) (when-let (frame (or frame (selected-frame))) diff --git a/lisp/doom.el b/lisp/doom.el index 326561610..84dbb1bc8 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -86,7 +86,8 @@ (concat "Alternatively, either update your $PATH environment variable to include the\n" "path of the desired Emacs executable OR alter the $EMACS environment variable\n" "to specify the exact path or command needed to invoke Emacs." - (when-let (command (ignore-errors (file-name-nondirectory (cadr (member "--load" command-line-args))))) + (when-let ((script (cadr (member "--load" command-line-args))) + (command (file-name-nondirectory script))) (concat " For example:\n\n" " $ EMACS=/path/to/valid/emacs " command " ...\n" " $ EMACS=\"/Applications/Emacs.app/Contents/MacOS/Emacs\" " command " ...\n" @@ -368,17 +369,17 @@ users).") (setq initial-major-mode 'fundamental-mode initial-scratch-message nil) - ;; PERF: Inexplicably, `tty-run-terminal-initialization' can sometimes take - ;; 2-3s when starting up Emacs in the terminal. Whatever slows it down at - ;; startup doesn't appear to affect it if it's called a little later in - ;; the startup process, so that's what I do. - ;; REVIEW: This optimization is not well understood. Investigate it! (unless initial-window-system - (advice-add #'tty-run-terminal-initialization :override #'ignore) - (add-hook! 'window-setup-hook - (defun doom--reset-tty-run-terminal-initialization-h () - (advice-remove #'tty-run-terminal-initialization #'ignore) - (tty-run-terminal-initialization (selected-frame) nil t)))) + ;; PERF: Inexplicably, `tty-run-terminal-initialization' can sometimes + ;; take 2-3s when starting up Emacs in the terminal. Whatever slows it + ;; down at startup doesn't appear to affect it if it's called a little + ;; later in the startup process, so that's what I do. + ;; REVIEW: This optimization is not well understood. Investigate it! + (define-advice tty-run-terminal-initialization (:override (&rest _) defer) + (advice-remove #'tty-run-terminal-initialization #'tty-run-terminal-initialization@defer) + (add-hook 'window-setup-hook + (doom-partial #'tty-run-terminal-initialization + (selected-frame) nil t)))) ;; PERF,UX: Site files tend to use `load-file', which emits "Loading X..." ;; messages in the echo area. Writing to the echo-area triggers a @@ -437,7 +438,7 @@ users).") ;; relevant to our current OS, but `command-line-1' still processes. (unless IS-MAC (setq command-line-ns-option-alist nil)) - (when (or IS-MAC IS-WINDOWS) + (unless (eq initial-window-system 'x) (setq command-line-x-option-alist nil)))) diff --git a/modules/config/literate/autoload.el b/modules/config/literate/autoload.el index 86e977693..0da5f0867 100644 --- a/modules/config/literate/autoload.el +++ b/modules/config/literate/autoload.el @@ -2,8 +2,7 @@ ;;;###autoload (add-hook 'org-mode-hook #'+literate-enable-recompile-h) -(defvar +literate-config-file - (concat doom-user-dir "config.org") +(defvar +literate-config-file (file-name-concat doom-user-dir "config.org") "The file path of your literate config file.") (defvar +literate-tangle--async-proc nil) @@ -144,3 +143,5 @@ config, and should trigger a recompile if changed." (buffer-file-name (buffer-base-buffer)) (file-name-directory +literate-config-file)) (+literate-tangle-h))) + +;;; autoload.el ends here diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index b2e071418..6e7d620e1 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -298,8 +298,7 @@ This generally applies to your private config (`doom-user-dir') or Doom's source (progn (require 'doom) (require 'doom-cli) - (require 'doom-start) - (defmacro map! (&rest _))) + (require 'doom-start)) (error (princ (format "%s:%d:%d:Error:Failed to load Doom: %s\n" diff --git a/modules/ui/hl-todo/config.el b/modules/ui/hl-todo/config.el index 8d0e6150b..d4399307d 100644 --- a/modules/ui/hl-todo/config.el +++ b/modules/ui/hl-todo/config.el @@ -6,21 +6,23 @@ :config (setq hl-todo-highlight-punctuation ":" hl-todo-keyword-faces - '(;; For missing features or functionality that should be added at a - ;; later date. + '(;; For reminders to change or add something at a later date. ("TODO" warning bold) - ;; For code (or code paths) that are broken or slow, and may become - ;; bigger problems later. + ;; For code (or code paths) that are broken, unimplemented, or slow, + ;; and may become bigger problems later. ("FIXME" error bold) - ;; For code smells, where questionable coding practices are - ;; intentionally used, and/or may break in a future update. - ("HACK" font-lock-constant-face bold) - ;; For things that need confirmation that they work or more testing. + ;; For code that needs to be revisited later, either to upstream it, + ;; improve it, or address non-critical issues. ("REVIEW" font-lock-keyword-face bold) - ;; For things that just gotta go and will soon be gone. + ;; For code smells where questionable practices are used + ;; intentionally, and/or is likely to break in a future update. + ("HACK" font-lock-constant-face bold) + ;; For sections of code that just gotta go, and will be gone soon. + ;; Specifically, this means the code is deprecated, not necessarily + ;; the feature it enables. ("DEPRECATED" font-lock-doc-face bold) - ;; These are extra, commonly seen annotation keywords. What they mean - ;; or are for depend on the project. + ;; Extra keywords commonly found in the wild, whose meaning may vary + ;; from project to project. ("NOTE" success bold) ("BUG" error bold) ("XXX" font-lock-constant-face bold)))