fix: appease byte-compiler across the board

Warnings about unused lexical variables, arity warnings, unescaped
single quotes in docstrings, shadowed variables, and invalid value for
:local depending on Emacs version.
This commit is contained in:
Henrik Lissner 2026-03-11 19:47:08 -04:00
parent c1928bf081
commit 73d643da83
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
24 changed files with 135 additions and 104 deletions

View file

@ -102,7 +102,7 @@ libraries. It is the equivalent of the following shell commands:
(sh! "git" "branch" "-D" target-remote) (sh! "git" "branch" "-D" target-remote)
(sh! "git" "remote" "remove" doom-upgrade-remote) (sh! "git" "remote" "remove" doom-upgrade-remote)
(unwind-protect (unwind-protect
(let (result) (progn
(or (zerop (car (sh! "git" "remote" "add" doom-upgrade-remote doom-upgrade-url))) (or (zerop (car (sh! "git" "remote" "add" doom-upgrade-remote doom-upgrade-url)))
(error "Failed to add %s to remotes" doom-upgrade-remote)) (error "Failed to add %s to remotes" doom-upgrade-remote))
(or (zerop (car (setq result (sh! "git" "fetch" "--force" "--tags" doom-upgrade-remote (format "%s:%s" branch target-remote))))) (or (zerop (car (setq result (sh! "git" "fetch" "--force" "--tags" doom-upgrade-remote (format "%s:%s" branch target-remote)))))

View file

@ -977,7 +977,7 @@ considered as well."
(save-excursion (save-excursion
(goto-char (point-max)) (goto-char (point-max))
(buffer-substring (if (re-search-backward "^\\[Return code: 0\\]$" nil t) (buffer-substring (if (re-search-backward "^\\[Return code: 0\\]$" nil t)
(point-at-bol 2) (pos-bol 2)
(point-min)) (point-min))
(point-max)))))) (point-max))))))
(error-file (doom-cli--output-file 'error context))) (error-file (doom-cli--output-file 'error context)))
@ -2122,7 +2122,7 @@ substring is edited more than once."
(format (format "%%-%ds%%s%%%ds" width width) (format (format "%%-%ds%%s%%%ds" width width)
"DOOM(1)" title "DOOM(1)"))) "DOOM(1)" title "DOOM(1)")))
("NAME" . ,(concat .command " - " .summary)) ("NAME" . ,(concat .command " - " .summary))
("SYNOPSIS" . ,(doom-cli-help--render-synopsis .synopsis nil t)) ("SYNOPSIS" . ,(doom-cli-help--render-synopsis .synopsis))
("DESCRIPTION" . ,.description)) ("DESCRIPTION" . ,.description))
`((nil . ,(doom-cli-help--render-synopsis .synopsis "Usage: ")) `((nil . ,(doom-cli-help--render-synopsis .synopsis "Usage: "))
(nil . ,(string-join (seq-remove #'string-empty-p (list .summary .description)) (nil . ,(string-join (seq-remove #'string-empty-p (list .summary .description))
@ -2398,7 +2398,7 @@ Recognizes %p (for the prefix) and %c (for the active command).")
((doom-cli-find (list prefix))))) ((doom-cli-find (list prefix)))))
(terpri) (terpri)
;; Kill manually so we don't save output to logs. ;; Kill manually so we don't save output to logs.
(let (kill-emacs) (kill-emacs 0)))) (let (kill-emacs-hook) (kill-emacs 0))))
(defcli! (:root :help) (defcli! (:root :help)
((localonly? ("-g" "--no-global") "Hide global options") ((localonly? ("-g" "--no-global") "Hide global options")

View file

@ -393,7 +393,7 @@ files, so this replace calls to `pp' with the much faster `prin1'."
(use-package! server (use-package! server
:when (display-graphic-p) :when (display-graphic-p)
:after-call doom-first-input-hook doom-first-file-hook focus-out-hook :after-call doom-first-input-hook doom-first-file-hook
:defer 1 :defer 1
:config :config
(when-let* ((name (getenv "EMACS_SERVER_NAME"))) (when-let* ((name (getenv "EMACS_SERVER_NAME")))
@ -531,7 +531,7 @@ on."
(defun doom-disable-smartparens-mode-maybe-h () (defun doom-disable-smartparens-mode-maybe-h ()
(when smartparens-mode (when smartparens-mode
(setq-local doom-buffer-smartparens-mode t) (setq-local doom-buffer-smartparens-mode t)
(turn-off-smartparens-mode))))) (smartparens-mode -1)))))
(use-package! so-long (use-package! so-long

View file

@ -275,7 +275,7 @@ localleader prefix."
(defun doom--map-keyword-to-states (keyword) (defun doom--map-keyword-to-states (keyword)
"Convert a KEYWORD into a list of evil state symbols. "Convert a KEYWORD into a list of evil state symbols.
For example, :nvi will map to (list 'normal 'visual 'insert). See For example, :nvi will map to (list \\='normal \\='visual \\='insert). See
`doom-evil-state-alist' to customize this." `doom-evil-state-alist' to customize this."
(cl-loop for l across (doom-keyword-name keyword) (cl-loop for l across (doom-keyword-name keyword)
if (assq l doom-evil-state-alist) collect (cdr it) if (assq l doom-evil-state-alist) collect (cdr it)

View file

@ -206,7 +206,7 @@ Return non-nil if loading the file succeeds."
(defun doom-require (feature &optional filename noerror) (defun doom-require (feature &optional filename noerror)
"Like `require', but handles and enhances Doom errors. "Like `require', but handles and enhances Doom errors.
Can also load Doom's subfeatures, e.g. (doom-require 'doom-lib 'files)" Can also load Doom's subfeatures, e.g. (doom-require \\='doom-lib \\='files)"
(let ((subfeature (if (symbolp filename) filename))) (let ((subfeature (if (symbolp filename) filename)))
(or (featurep feature subfeature) (or (featurep feature subfeature)
(doom-load (doom-load
@ -622,14 +622,15 @@ or aliases."
(declare (doc-string 1)) (declare (doc-string 1))
`(lambda (&rest _) (interactive) ,@body)) `(lambda (&rest _) (interactive) ,@body))
(defmacro cmd!! (command &optional prefix-arg &rest args) (defmacro cmd!! (command &optional arg &rest args)
"Returns a closure that interactively calls COMMAND with ARGS and PREFIX-ARG. "Returns a closure that interactively calls COMMAND with ARGS and PREFIX-ARG.
Like `cmd!', but allows you to change `current-prefix-arg' or pass arguments to Like `cmd!', but allows you to change `current-prefix-arg' or pass arguments to
COMMAND. This macro is meant to be used as a target for keybinds (e.g. with COMMAND. This macro is meant to be used as a target for keybinds (e.g. with
`define-key' or `map!')." `define-key' or `map!')."
(declare (doc-string 1) (pure t) (side-effect-free t)) (declare (doc-string 1) (pure t) (side-effect-free t))
`(lambda (arg &rest _) (interactive "P") `(lambda (arg &rest _) (interactive "P")
(let ((current-prefix-arg (or ,prefix-arg arg))) (let ((current-prefix-arg (or ,arg arg)))
(,(if args (,(if args
#'funcall-interactively #'funcall-interactively
#'call-interactively) #'call-interactively)
@ -1633,11 +1634,11 @@ Accepts the following properties:
:built-in BOOL|'prefer :built-in BOOL|'prefer
Same as :ignore if the package is a built-in Emacs package. This is more to Same as :ignore if the package is a built-in Emacs package. This is more to
inform help commands like `doom/help-packages' that this is a built-in inform help commands like `doom/help-packages' that this is a built-in
package. If set to 'prefer, the package will not be installed if it is package. If set to \\='prefer, the package will not be installed if it is
already provided by Emacs. already provided by Emacs.
:env ALIST :env ALIST
Parameters and envvars to set while the package is building. If these values Parameters and envvars to set while the package is building. If these values
change, the package will be rebuilt on next 'doom sync'. change, the package will be rebuilt on next \\='doom sync'.
Returns t if package is successfully registered, and nil if it was disabled Returns t if package is successfully registered, and nil if it was disabled
elsewhere." elsewhere."

View file

@ -234,7 +234,7 @@ state are passed in.")
on-exit) on-exit)
"Define a project minor mode named NAME and where/how it is activated. "Define a project minor mode named NAME and where/how it is activated.
Project modes allow you to configure 'sub-modes' for major-modes that are Project modes allow you to configure \\='sub-modes' for major-modes that are
specific to a folder, project structure, framework or whatever arbitrary context specific to a folder, project structure, framework or whatever arbitrary context
you define. These project modes can have their own settings, keymaps, hooks, you define. These project modes can have their own settings, keymaps, hooks,
snippets, etc. snippets, etc.

View file

@ -8,19 +8,16 @@
(defcustom doom-first-input-hook () (defcustom doom-first-input-hook ()
"Transient hooks run before the first user input." "Transient hooks run before the first user input."
:type 'hook :type 'hook
:local 'permanent-local
:group 'doom) :group 'doom)
(defcustom doom-first-file-hook () (defcustom doom-first-file-hook ()
"Transient hooks run before the first interactively opened file." "Transient hooks run before the first interactively opened file."
:type 'hook :type 'hook
:local 'permanent-local
:group 'doom) :group 'doom)
(defcustom doom-first-buffer-hook () (defcustom doom-first-buffer-hook ()
"Transient hooks run before the first interactively opened buffer." "Transient hooks run before the first interactively opened buffer."
:type 'hook :type 'hook
:local 'permanent-local
:group 'doom) :group 'doom)
@ -191,7 +188,7 @@ sub-packages. For example, `org' is comprised of many packages, and might be
broken up into: broken up into:
(doom-load-packages-incrementally (doom-load-packages-incrementally
'(calendar find-func format-spec org-macs org-compat \\='(calendar find-func format-spec org-macs org-compat
org-faces org-entities org-list org-pcomplete org-src org-faces org-entities org-list org-pcomplete org-src
org-footnote org-macro ob org org-clock org-agenda org-footnote org-macro ob org org-clock org-agenda
org-capture)) org-capture))

View file

@ -179,9 +179,9 @@ original state.")
(and (bound-and-true-p doom-cli--context) (and (bound-and-true-p doom-cli--context)
(doom-cli-context-suppress-prompts-p doom-cli--context))) (doom-cli-context-suppress-prompts-p doom-cli--context)))
(defadvice! doom-straight--fallback-to-tty-prompt-a (fn prompt actions) (defadvice! doom-straight--fallback-to-tty-prompt-a (prompt actions)
"Modifies straight to prompt on the terminal when in noninteractive sessions." "Modifies straight to prompt on the terminal when in noninteractive sessions."
:around #'straight--popup-raw :override #'straight--popup-raw
(if (bound-and-true-p async-in-child-emacs) (if (bound-and-true-p async-in-child-emacs)
(error "Straight prompt: %s" prompt) (error "Straight prompt: %s" prompt)
(let ((doom-straight--auto-options doom-straight--auto-options)) (let ((doom-straight--auto-options doom-straight--auto-options))
@ -231,7 +231,7 @@ original state.")
", ") ", ")
(if (not recommended) "" (if (not recommended) ""
(format "; don't know? Pick %d" (1+ recommended))))) (format "; don't know? Pick %d" (1+ recommended)))))
answer fn) answer)
(while (null (nth (setq answer (1- (read-number prompt))) options)) (while (null (nth (setq answer (1- (read-number prompt))) options))
(print! (warn "%s is not a valid answer, try again.") answer)) (print! (warn "%s is not a valid answer, try again.") answer))
(funcall (nth answer options))))))))) (funcall (nth answer options)))))))))

View file

@ -12,7 +12,9 @@ Is either a symbol representing the name of an Emacs theme, or a list thereof
(to enable in order). (to enable in order).
Set to `nil' to load no theme at all. This variable is changed by `load-theme' Set to `nil' to load no theme at all. This variable is changed by `load-theme'
and `enable-theme'.") and `enable-theme'."
:type '(choice theme (repeat theme))
:group 'doom)
(defcustom doom-font nil (defcustom doom-font nil
"The default font to use. "The default font to use.
@ -23,31 +25,38 @@ This affects the `default' and `fixed-pitch' faces.
Examples: Examples:
(setq doom-font (font-spec :family \"Fira Mono\" :size 12)) (setq doom-font (font-spec :family \"Fira Mono\" :size 12))
(setq doom-font \"Terminus (TTF):pixelsize=12:antialias=off\") (setq doom-font \"Terminus (TTF):pixelsize=12:antialias=off\")
(setq doom-font \"Fira Code-14\")") (setq doom-font \"Fira Code-14\")"
:type 'font
:group 'doom)
(defcustom doom-variable-pitch-font nil (defcustom doom-variable-pitch-font nil
"The default font to use for variable-pitch text. "The default font to use for variable-pitch text.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples. `doom-font' for examples.
An omitted font size means to inherit `doom-font''s size.") An omitted font size means to inherit `doom-font''s size."
:type 'font
:group 'doom)
(defcustom doom-serif-font nil (defcustom doom-serif-font nil
"The default font to use for the `fixed-pitch-serif' face. "The default font to use for the `fixed-pitch-serif' face.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples. `doom-font' for examples.
An omitted font size means to inherit `doom-font''s size.") An omitted font size means to inherit `doom-font''s size."
:type 'font
:group 'doom)
(define-obsolete-variable-alias 'doom-unicode-font 'doom-symbol-font "3.0.0")
(defcustom doom-symbol-font nil (defcustom doom-symbol-font nil
"Fallback font for symbols. "Fallback font for symbols.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples. Emacs defaults to Symbola. `doom-font' for examples. Emacs defaults to Symbola.
WARNING: if you specify a size for this font it will hard-lock any usage of this WARNING: if you specify a size for this font it will hard-lock any usage of this
font to that size. It's rarely a good idea to do so!") font to that size. It's rarely a good idea to do so!"
:type 'font
(define-obsolete-variable-alias 'doom-unicode-font 'doom-symbol-font "3.0.0") :group 'doom)
(defcustom doom-emoji-font nil (defcustom doom-emoji-font nil
"Fallback font for emoji. "Fallback font for emoji.
@ -55,43 +64,57 @@ Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples. `doom-font' for examples.
WARNING: if you specify a size for this font it will hard-lock any usage of this WARNING: if you specify a size for this font it will hard-lock any usage of this
font to that size. It's rarely a good idea to do so!") font to that size. It's rarely a good idea to do so!"
:type 'font
:group 'doom)
(defconst doom-emoji-fallback-font-families (defcustom doom-emoji-fallback-font-families
'("Apple Color Emoji" '("Apple Color Emoji"
"Segoe UI Emoji" "Segoe UI Emoji"
"Noto Color Emoji" "Noto Color Emoji"
"Noto Emoji") "Noto Emoji")
"A list of fallback font families to use for emojis. "A list of fallback font families to use for emojis.
These are platform-specific fallbacks for internal use. If you These are platform-specific fallbacks for internal use. If you
want to change your emoji font, use `doom-emoji-font'.") want to change your emoji font, use `doom-emoji-font'."
:type '(repeat font)
:group 'doom)
(defconst doom-symbol-fallback-font-families (defcustom doom-symbol-fallback-font-families
'("Segoe UI Symbol" '("Segoe UI Symbol"
"Apple Symbols") "Apple Symbols")
"A list of fallback font families for general symbol glyphs. "A list of fallback font families for general symbol glyphs.
These are platform-specific fallbacks for internal use. If you These are platform-specific fallbacks for internal use. If you
want to change your symbol font, use `doom-symbol-font'.") want to change your symbol font, use `doom-symbol-font'."
:type '(repeat font)
:group 'doom)
;; ;;
;;; Custom hooks ;;; Custom hooks
(defcustom doom-init-ui-hook nil (defcustom doom-init-ui-hook nil
"List of hooks to run when the UI has been initialized.") "List of hooks to run when the UI has been initialized."
:type 'hook
:group 'doom)
(defcustom doom-load-theme-hook nil (defcustom doom-load-theme-hook nil
"Hook run after a color-scheme is loaded. "Hook run after a color-scheme is loaded.
Triggered by `load-theme', `enable-theme', or reloaded with `doom/reload-theme', Triggered by `load-theme', `enable-theme', or reloaded with `doom/reload-theme',
but only for themes that declare themselves as a :kind color-scheme (which Doom but only for themes that declare themselves as a :kind color-scheme (which Doom
treats as the default).") treats as the default)."
:type 'hook
:group 'doom)
(defcustom doom-switch-buffer-hook nil (defcustom doom-switch-buffer-hook nil
"A list of hooks run after changing the current buffer.") "A list of hooks run after changing the current buffer."
:type 'hook
:group 'doom)
(defcustom doom-switch-window-hook nil (defcustom doom-switch-window-hook nil
"A list of hooks run after changing the focused windows.") "A list of hooks run after changing the focused windows."
:type 'hook
:group 'doom)
(defcustom doom-switch-frame-hook nil (defcustom doom-switch-frame-hook nil
"A list of hooks run after changing the focused frame. "A list of hooks run after changing the focused frame.
@ -100,7 +123,9 @@ This also serves as an analog for `focus-in-hook' or
`after-focus-change-function', but also preforms debouncing (see `after-focus-change-function', but also preforms debouncing (see
`doom-switch-frame-hook-debounce-delay'). It's possible for this hook to be `doom-switch-frame-hook-debounce-delay'). It's possible for this hook to be
triggered multiple times (because there are edge cases where Emacs can have triggered multiple times (because there are edge cases where Emacs can have
multiple frames focused at once).") multiple frames focused at once)."
:type 'hook
:group 'doom)
(defun doom-run-switch-buffer-hooks-h (&optional _) (defun doom-run-switch-buffer-hooks-h (&optional _)
"Trigger `doom-switch-buffer-hook' when selecting a new buffer." "Trigger `doom-switch-buffer-hook' when selecting a new buffer."
@ -446,34 +471,36 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
org-agenda-mode dired-mode) org-agenda-mode dired-mode)
"What modes to enable `hl-line-mode' in.") "What modes to enable `hl-line-mode' in.")
:config :config
(if (boundp 'global-hl-line-buffers) (with-no-warnings
(setq global-hl-line-buffers (if (boundp 'global-hl-line-buffers)
`(not (or (lambda (b) (buffer-local-value 'hl-line-mode b)) (setq global-hl-line-buffers
(lambda (b) `(not (or (lambda (b) (buffer-local-value 'hl-line-mode b))
(when global-hl-line-modes (lambda (b)
(let ((mode (buffer-local-value 'major-mode b))) (when global-hl-line-modes
(if (eq (car global-hl-line-modes) 'not) (let ((mode (buffer-local-value 'major-mode b)))
(provided-mode-derived-p mode global-hl-line-modes) (if (eq (car global-hl-line-modes) 'not)
(not (provided-mode-derived-p mode global-hl-line-modes)))))) (provided-mode-derived-p mode global-hl-line-modes)
(lambda (b) (with-current-buffer b (doom-region-active-p))) (not (provided-mode-derived-p mode global-hl-line-modes))))))
(lambda (b) (buffer-local-value 'cursor-face-highlight-mode b)) (lambda (b) (with-current-buffer b (doom-region-active-p)))
(lambda (b) (string-match-p "\\` " (buffer-name b))) (lambda (b) (buffer-local-value 'cursor-face-highlight-mode b))
minibufferp)) (lambda (b) (string-match-p "\\` " (buffer-name b)))
;; Don't display line highlights in non-focused windows, for minibufferp))
;; performance sake and to reduce UI clutter. ;; Don't display line highlights in non-focused windows, for
global-hl-line-sticky-flag 'window) ;; performance sake and to reduce UI clutter.
;; HACK: `global-hl-line-buffers' wasn't introduced until 31.1, so I global-hl-line-sticky-flag 'window)
;; reimplement to `global-hl-line-modes' give us a major mode ;; HACK: `global-hl-line-buffers' wasn't introduced until 31.1, so I
;; white/blacklist via `global-hl-line-modes'. ;; reimplement it for `global-hl-line-modes', so we have a major mode
(define-globalized-minor-mode global-hl-line-mode hl-line-mode ;; white/blacklist.
(lambda () (define-globalized-minor-mode global-hl-line-mode hl-line-mode
(and (cond (hl-line-mode nil) (lambda ()
((null global-hl-line-modes) nil) (and (cond (hl-line-mode nil)
((eq global-hl-line-modes t)) ((null global-hl-line-modes) nil)
((eq (car global-hl-line-modes) 'not) ((eq global-hl-line-modes t))
(not (derived-mode-p global-hl-line-modes))) ((eq (car global-hl-line-modes) 'not)
((apply #'derived-mode-p global-hl-line-modes))) (not (derived-mode-p global-hl-line-modes)))
(hl-line-mode +1))))) ((apply #'derived-mode-p global-hl-line-modes)))
(hl-line-mode +1)))
:group 'hl-line)))
;; Temporarily disable `hl-line-mode' when selection is active, since it ;; Temporarily disable `hl-line-mode' when selection is active, since it
;; doesn't serve much purpose when the selection is so much more visible. ;; doesn't serve much purpose when the selection is so much more visible.
@ -610,7 +637,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(push (list display plist) new-specs))) (push (list display plist) new-specs)))
(nreverse new-specs))) (nreverse new-specs)))
(put face 'face-modified nil)) (put face 'face-modified nil))
('error (error
(if (string-prefix-p "Font not available" (error-message-string e)) (if (string-prefix-p "Font not available" (error-message-string e))
(signal 'doom-font-error (list (font-get (cdr map) :family))) (signal 'doom-font-error (list (font-get (cdr map) :family)))
(signal (car e) (cdr e)))))) (signal (car e) (cdr e))))))

View file

@ -631,7 +631,7 @@ Otherwise, `en/disable-command' (in novice.el.gz) is hardcoded to write them to
(define-advice comp-run-async-workers (:around (fn &rest args) dont-litter-tmpdir) (define-advice comp-run-async-workers (:around (fn &rest args) dont-litter-tmpdir)
"Normally, native-comp writes a ton to /tmp. This advice redirects this IO "Normally, native-comp writes a ton to /tmp. This advice redirects this IO
to `doom-profile-cache-dir' instead, so it doesn't OOM tmpfs users and can be to `doom-profile-cache-dir' instead, so it doesn't OOM tmpfs users and can be
safely cleaned up with 'doom sync' or 'doom gc'." safely cleaned up with \\='doom sync' or \\='doom gc'."
(let ((temporary-file-directory (expand-file-name "comp/" doom-profile-cache-dir))) (let ((temporary-file-directory (expand-file-name "comp/" doom-profile-cache-dir)))
(make-directory temporary-file-directory t) (make-directory temporary-file-directory t)
(apply fn args))) (apply fn args)))

View file

@ -125,7 +125,7 @@ If CONSIDER-MODE? is non-nil, returns non-nil if BUF's mode is derived from
;;;###autoload ;;;###autoload
(defun doom-real-buffer-p (buffer-or-name) (defun doom-real-buffer-p (buffer-or-name)
"Returns t if BUFFER-OR-NAME is a 'real' buffer. "Returns t if BUFFER-OR-NAME is a \\='real' buffer.
A real buffer is a useful buffer; a first class citizen in Doom. Real ones A real buffer is a useful buffer; a first class citizen in Doom. Real ones
should get special treatment, because we will be spending most of our time in should get special treatment, because we will be spending most of our time in
@ -157,7 +157,7 @@ If BUFFER-OR-NAME is omitted or nil, the current buffer is tested."
;;;###autoload ;;;###autoload
(defun doom-unreal-buffer-p (buffer-or-name) (defun doom-unreal-buffer-p (buffer-or-name)
"Return t if BUFFER-OR-NAME is an 'unreal' buffer. "Return t if BUFFER-OR-NAME is an \\='unreal' buffer.
See `doom-real-buffer-p' for details on what that means." See `doom-real-buffer-p' for details on what that means."
(not (doom-real-buffer-p buffer-or-name))) (not (doom-real-buffer-p buffer-or-name)))

View file

@ -108,7 +108,7 @@ This is much faster and safer than `doom/reload', but not as comprehensive. This
reloads your package and module visibility, but does not install new packages or reloads your package and module visibility, but does not install new packages or
remove orphaned ones. It also doesn't reload your private config. remove orphaned ones. It also doesn't reload your private config.
It is useful to only pull in changes performed by 'doom sync' on the command It is useful to only pull in changes performed by \\='doom sync' on the command
line." line."
(interactive) (interactive)
(doom-require 'doom-lib 'profiles) (doom-require 'doom-lib 'profiles)
@ -123,8 +123,8 @@ line."
(defun doom/reload-env () (defun doom/reload-env ()
"Reloads your envvar file. "Reloads your envvar file.
DOES NOT REGENERATE IT. You must run 'doom env' in your shell OUTSIDE of Emacs. DOES NOT REGENERATE IT. You must run \\='doom env' in your shell OUTSIDE of
Doing so from within Emacs will taint your shell environment. Emacs. Doing so from within Emacs will taint your shell environment.
An envvar file contains a snapshot of your shell environment, which can be An envvar file contains a snapshot of your shell environment, which can be
imported into Emacs." imported into Emacs."

View file

@ -57,10 +57,7 @@
((add-to-list 'doom-debug--unbound-variables (cons spec t))))) ((add-to-list 'doom-debug--unbound-variables (cons spec t)))))
(defun doom-debug--timestamped-message-a (format-string &rest _args) (defun doom-debug--timestamped-message-a (format-string &rest _args)
"Advice to run before `message' that prepends a timestamp to each message. "Advice to run before `message' that prepends a timestamp to each message."
Activate this advice with:
(advice-add 'message :before 'doom-debug--timestamped-message-a)"
(when (and (stringp format-string) (when (and (stringp format-string)
message-log-max ; if nil, logging is disabled message-log-max ; if nil, logging is disabled
(not (equal format-string "%s%s")) (not (equal format-string "%s%s"))
@ -83,6 +80,7 @@ Activate this advice with:
(define-minor-mode doom-debug-mode (define-minor-mode doom-debug-mode
"Toggle `debug-on-error' and `init-file-debug' for verbose logging." "Toggle `debug-on-error' and `init-file-debug' for verbose logging."
:global t :global t
:group 'doom
(when (or doom-debug-mode (when (or doom-debug-mode
(and (integerp current-prefix-arg) (and (integerp current-prefix-arg)
(> current-prefix-arg 0))) (> current-prefix-arg 0)))

View file

@ -467,7 +467,7 @@ This primes `org-mode' for reading."
(org-id-locations-file doom-docs--id-location-file) (org-id-locations-file doom-docs--id-location-file)
(org-id-locations doom-docs--id-locations) (org-id-locations doom-docs--id-locations)
(org-id-files doom-docs--id-files)) (org-id-files doom-docs--id-files))
(doom/reload-docs) (doom/reload-docs force?)
(when-let* ((fname (buffer-file-name (buffer-base-buffer)))) (when-let* ((fname (buffer-file-name (buffer-base-buffer))))
(let ((id (org-id-new))) (let ((id (org-id-new)))
(org-id-add-location id fname) (org-id-add-location id fname)

View file

@ -3,18 +3,18 @@
;;; Code: ;;; Code:
(defun doom-files--build-checks (spec &optional directory) (defun doom-files--build-checks (spec &optional directory)
"Converts a simple nested series of or/and forms into a series of "Converts simple nested series of/and forms into a series of `file-exists-p'
`file-exists-p' checks. calls.
For example For example
(doom-files--build-checks (doom-files--build-checks
'(or A (and B C)) \\='(or A (and B C))
\"~\") \"~\")
Returns (not precisely, but effectively): Returns (not precisely, but effectively):
'(let* ((_directory \"~\") \\='(let* ((_directory \"~\")
(A (expand-file-name A _directory)) (A (expand-file-name A _directory))
(B (expand-file-name B _directory)) (B (expand-file-name B _directory))
(C (expand-file-name C _directory))) (C (expand-file-name C _directory)))
@ -100,7 +100,7 @@ MAP is a function or symbol which will be used to transform each entry in the
results. results.
TYPE determines what kind of path will be included in the results. This can be t TYPE determines what kind of path will be included in the results. This can be t
(files and folders), 'files or 'dirs. (files and folders), \\='files or \\='dirs.
By default, this function returns paths relative to PATH-OR-PATHS if it is a By default, this function returns paths relative to PATH-OR-PATHS if it is a
single path. If it a list of paths, this function returns absolute paths. single path. If it a list of paths, this function returns absolute paths.
@ -256,10 +256,10 @@ called with no arguments and expected to return the contents as any arbitrary
data. By default, BY is set to `buffer-string'. Otherwise, BY recognizes these data. By default, BY is set to `buffer-string'. Otherwise, BY recognizes these
special values: special values:
'insert -- insert FILE's contents into the current buffer before point. \\='insert -- insert FILE's contents into the current buffer before point.
'read -- read the first form in FILE and return it as a single S-exp. \\='read -- read the first form in FILE and return it as a single S-exp.
'read* -- read all forms in FILE and return it as a list of S-exps. \\='read* -- read all forms in FILE and return it as a list of S-exps.
'(read . N) -- read the first N (an integer) S-exps in FILE. \\='(read . N) -- read the first N (an integer) S-exps in FILE.
CODING dictates the encoding of the buffer. This defaults to `utf-8'. If set to CODING dictates the encoding of the buffer. This defaults to `utf-8'. If set to
nil, `binary' is used. nil, `binary' is used.

View file

@ -25,7 +25,7 @@ If nil, `doom-font' will be used, scaled up by `doom-big-font-increment'. See
"Return FONT as a normalized font spec. "Return FONT as a normalized font spec.
The font will be normalized (i.e. :weight, :slant, and :width will set to The font will be normalized (i.e. :weight, :slant, and :width will set to
'normal if not specified) before it is converted. \\='normal if not specified) before it is converted.
FONT can be a `font-spec', a font object, an XFT font string, or an XLFD font FONT can be a `font-spec', a font object, an XFT font string, or an XLFD font
string." string."
@ -170,6 +170,7 @@ Also resizees `doom-variable-pitch-font' and `doom-serif-font'."
:init-value nil :init-value nil
:lighter " BIG" :lighter " BIG"
:global t :global t
:group 'doom
(if doom-big-font (if doom-big-font
;; Use `doom-big-font' in lieu of `doom-font' ;; Use `doom-big-font' in lieu of `doom-font'
(doom-adjust-font-size (doom-adjust-font-size

View file

@ -176,7 +176,7 @@ selection of all minor-modes, active or not."
(defvar ivy-sort-functions-alist) (defvar ivy-sort-functions-alist)
;;;###autoload ;;;###autoload
(cl-defun doom-completing-read-org-headings (cl-defun doom-completing-read-org-headings
(prompt files &rest plist &key depth mindepth include-files initial-input extra-candidates action) (prompt files &rest plist &key _depth _mindepth _include-files initial-input extra-candidates action)
"TODO" "TODO"
(let ((alist (let ((alist
(append (apply #'doom--org-headings files plist) (append (apply #'doom--org-headings files plist)
@ -401,7 +401,7 @@ without needing to check if they are available."
(defun doom/help-modules (category module &optional visit-dir) (defun doom/help-modules (category module &optional visit-dir)
"Open the documentation for a Doom module. "Open the documentation for a Doom module.
CATEGORY is a keyword and MODULE is a symbol. e.g. :editor and 'evil. CATEGORY is a keyword and MODULE is a symbol. e.g. :editor and \\='evil.
If VISIT-DIR is non-nil, visit the module's directory rather than its If VISIT-DIR is non-nil, visit the module's directory rather than its
documentation. documentation.

View file

@ -267,7 +267,7 @@ processed."
plist))) plist)))
;;;###autoload ;;;###autoload
(defun doom-package-dependencies (package &optional recursive noerror) (defun doom-package-dependencies (package &optional recursive _noerror)
"Return a list of dependencies for a package. "Return a list of dependencies for a package.
If RECURSIVE is `tree', return a tree of dependencies. If RECURSIVE is `tree', return a tree of dependencies.
@ -319,8 +319,8 @@ non-nil."
;;;###autoload ;;;###autoload
(defun doom-package-backend (package) (defun doom-package-backend (package)
"Return 'straight, 'builtin, 'elpa or 'other, depending on how PACKAGE is "Return \\='straight, \\='builtin, \\='elpa or \\='other, depending on how
installed." PACKAGE is installed."
(cond ((gethash (symbol-name package) straight--build-cache) (cond ((gethash (symbol-name package) straight--build-cache)
'straight) 'straight)
((or (doom-package-built-in-p package) ((or (doom-package-built-in-p package)
@ -374,7 +374,6 @@ also be a list of module keys."
(let ((module-list (cond ((null module-list) (doom-module-list)) (let ((module-list (cond ((null module-list) (doom-module-list))
((symbolp module-list) (doom-module-list 'all)) ((symbolp module-list) (doom-module-list 'all))
(module-list))) (module-list)))
(packages-file doom-module-packages-file)
doom-disabled-packages doom-disabled-packages
doom-packages) doom-packages)
(letf! (defun read-packages (key) (letf! (defun read-packages (key)
@ -493,7 +492,7 @@ also be a list of module keys."
(cdr recipe)))))) (cdr recipe))))))
(defun doom--package-to-bump-string (package plist) (defun doom--package-to-bump-string (package plist)
"Return a PACKAGE and its PLIST in 'username/repo@commit' format." "Return a PACKAGE and its PLIST in \\='username/repo@commit' format."
(format "%s@%s" (format "%s@%s"
(plist-get (doom--package-merge-recipes package plist) :repo) (plist-get (doom--package-merge-recipes package plist) :repo)
(substring-no-properties (plist-get plist :pin) 0 12))) (substring-no-properties (plist-get plist :pin) 0 12)))
@ -546,10 +545,10 @@ also be a list of module keys."
;;;###autoload ;;;###autoload
(defun doom/bump-package-at-point (&optional select) (defun doom/bump-package-at-point (&optional select)
"Inserts or updates a `:pin' for the `package!' statement at point. "Inserts or updates a `:pin' for the `package!' statement at point.
Grabs the latest commit id of the package using 'git'." Grabs the latest commit id of the package using git."
(interactive "P") (interactive "P")
(doom-initialize-packages) (doom-initialize-packages)
(cl-destructuring-bind (&key package plist beg end) (cl-destructuring-bind (&key package plist _beg end)
(or (doom--package-at-point) (or (doom--package-at-point)
(user-error "Not on a `package!' call")) (user-error "Not on a `package!' call"))
(let* ((recipe (doom--package-merge-recipes package plist)) (let* ((recipe (doom--package-merge-recipes package plist))

View file

@ -186,7 +186,7 @@ Returns OUTPUT."
(cl-destructuring-bind (&key if indent level verbose title (cl-destructuring-bind (&key if indent level verbose title
;; TODO: Implement these ;; TODO: Implement these
_benchmark) _benchmark)
(cl-loop for (key val) on body by #'cddr (cl-loop for (key _val) on body by #'cddr
while (keywordp key) while (keywordp key)
collect (pop body) collect (pop body)
collect (pop body)) collect (pop body))
@ -268,7 +268,7 @@ based on the print level of the message. For example:
(cadr spec))))) (cadr spec)))))
(defun doom-print--redirect-standard-output (streamspec level &optional old-stream) (defun doom-print--redirect-standard-output (streamspec level &optional old-stream)
(let ((old (or old-stream standard-output)) (let ((_old (or old-stream standard-output))
(streams (doom-print--redirect-streams streamspec level))) (streams (doom-print--redirect-streams streamspec level)))
(lambda (ch) (lambda (ch)
(let ((str (char-to-string ch))) (let ((str (char-to-string ch)))

View file

@ -18,7 +18,7 @@ code of the process and OUTPUT is its stdout output."
"Execute COMMAND with ARGS synchronously. "Execute COMMAND with ARGS synchronously.
Unlike `doom-call-process', this pipes output to `standard-output' on the fly to Unlike `doom-call-process', this pipes output to `standard-output' on the fly to
simulate 'exec' in the shell, so batch scripts could run external programs simulate \\='exec' in the shell, so batch scripts could run external programs
synchronously without sacrificing their output. synchronously without sacrificing their output.
Warning: freezes indefinitely on any stdin prompt." Warning: freezes indefinitely on any stdin prompt."

View file

@ -252,7 +252,7 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
;;; Generators ;;; Generators
(defun doom-profile-generate (&optional _profile regenerate-only?) (defun doom-profile-generate (&optional _profile _regenerate-only?)
"Generate profile init files." "Generate profile init files."
(doom-initialize-packages) (doom-initialize-packages)
(let* ((default-directory doom-profile-dir) (let* ((default-directory doom-profile-dir)

View file

@ -139,21 +139,21 @@ See `display-line-numbers' for what these values mean."
(remove-hook 'doom-switch-window-hook #'doom--enlargened-forget-last-wconf-h)) (remove-hook 'doom-switch-window-hook #'doom--enlargened-forget-last-wconf-h))
;;;###autoload ;;;###autoload
(defun doom/window-maximize-buffer (&optional arg) (defun doom/window-maximize-buffer ()
"Close other windows to focus on this one. "Close other windows to focus on this one.
Use `winner-undo' to undo this. Alternatively, use `doom/window-enlargen'." Use `winner-undo' to undo this. Alternatively, use `doom/window-enlargen'."
(interactive "P") (interactive)
(when (and (bound-and-true-p +popup-mode) (when (and (bound-and-true-p +popup-mode)
(+popup-window-p)) (+popup-window-p))
(+popup/raise (selected-window))) (+popup/raise (selected-window)))
(delete-other-windows)) (delete-other-windows))
;;;###autoload ;;;###autoload
(defun doom/window-enlargen (&optional arg) (defun doom/window-enlargen ()
"Enlargen the current window (i.e. shrinks others) so you can focus on it. "Enlargen the current window (i.e. shrinks others) so you can focus on it.
Use `winner-undo' to undo this. Alternatively, use Use `winner-undo' to undo this. Alternatively, use
`doom/window-maximize-buffer'." `doom/window-maximize-buffer'."
(interactive "P") (interactive)
(let* ((window (selected-window)) (let* ((window (selected-window))
(dedicated-p (window-dedicated-p window)) (dedicated-p (window-dedicated-p window))
(preserved-p (window-parameter window 'window-preserved-size)) (preserved-p (window-parameter window 'window-preserved-size))

View file

@ -1,5 +1,9 @@
;;; editor/file-templates/autoload.el -*- lexical-binding: t; -*- ;;; editor/file-templates/autoload.el -*- lexical-binding: t; -*-
(defvar yas-choose-tables-first)
(defvar yas-choose-keys-first)
(defun +file-templates--set (pred plist) (defun +file-templates--set (pred plist)
(if (null (car-safe plist)) (if (null (car-safe plist))
(setq +file-templates-alist (setq +file-templates-alist

View file

@ -1,5 +1,9 @@
;;; lang/emacs-lisp/autoload/emacs-lisp.el -*- lexical-binding: t; -*- ;;; lang/emacs-lisp/autoload/emacs-lisp.el -*- lexical-binding: t; -*-
(defvar buttercup-suites)
(defvar pp-max-width)
;; ;;
;;; Library ;;; Library