diff --git a/bin/org-tangle b/bin/org-tangle index 467ecf0b4..b662ecbd5 100755 --- a/bin/org-tangle +++ b/bin/org-tangle @@ -58,12 +58,12 @@ " of these options.\n") (princ (buffer-string)))) -(defun *org-babel-tangle (orig-fn &rest args) +(defun *org-babel-tangle (fn &rest args) "Don't write tangled blocks to files, print them to stdout." (cl-letf (((symbol-function 'write-region) (lambda (start end filename &optional append visit lockname mustbenew) (princ (buffer-string))))) - (apply orig-fn args))) + (apply fn args))) (defun *org-babel-tangle-collect-blocks (&optional language tangle-file) "Like `org-babel-tangle-collect-blocks', but will ignore blocks that are in diff --git a/core/autoload/sandbox.el b/core/autoload/sandbox.el index d243e09c0..1dab32279 100644 --- a/core/autoload/sandbox.el +++ b/core/autoload/sandbox.el @@ -64,9 +64,9 @@ doom-emacs-dir ,doom-emacs-dir doom-cache-dir ,(expand-file-name "cache/" doom-sandbox-dir) doom-etc-dir ,(expand-file-name "etc/" doom-sandbox-dir)) - (defun doom--write-to-etc-dir-a (orig-fn &rest args) + (defun doom--write-to-etc-dir-a (fn &rest args) (let ((user-emacs-directory doom-etc-dir)) - (apply orig-fn args))) + (apply fn args))) (advice-add #'locate-user-emacs-file :around #'doom--write-to-etc-dir-a) ;; emacs essential variables (setq before-init-time (current-time) diff --git a/core/autoload/ui.el b/core/autoload/ui.el index 5ad04f2cd..bd09a0f33 100644 --- a/core/autoload/ui.el +++ b/core/autoload/ui.el @@ -32,24 +32,24 @@ are open." (recenter)) ;;;###autoload -(defun doom-preserve-window-position-a (orig-fn &rest args) +(defun doom-preserve-window-position-a (fn &rest args) "Generic advice for preserving cursor position on screen after scrolling." (let ((row (cdr (posn-col-row (posn-at-point))))) - (prog1 (apply orig-fn args) + (prog1 (apply fn args) (save-excursion (let ((target-row (- (line-number-at-pos) row))) (unless (< target-row 0) (evil-scroll-line-to-top target-row))))))) ;;;###autoload -(defun doom-shut-up-a (orig-fn &rest args) +(defun doom-shut-up-a (fn &rest args) "Generic advisor for silencing noisy functions. In interactive Emacs, this just inhibits messages from appearing in the minibuffer. They are still logged to *Messages*. In tty Emacs, messages are suppressed completely." - (quiet! (apply orig-fn args))) + (quiet! (apply fn args))) ;; diff --git a/core/cli/lib/straight-hacks.el b/core/cli/lib/straight-hacks.el index 728d9f90d..685556d35 100644 --- a/core/cli/lib/straight-hacks.el +++ b/core/cli/lib/straight-hacks.el @@ -36,11 +36,11 @@ original state.") ;; HACK Replace GUI popup prompts (which hang indefinitely in tty Emacs) with ;; simple prompts. -(defadvice! doom--straight-fallback-to-y-or-n-prompt-a (orig-fn &optional prompt) +(defadvice! doom--straight-fallback-to-y-or-n-prompt-a (fn &optional prompt) :around #'straight-are-you-sure (or doom-auto-accept (if doom-interactive-p - (funcall orig-fn prompt) + (funcall fn prompt) (y-or-n-p (format! "%s" (or prompt "")))))) (defun doom--straight-recommended-option-p (prompt option) @@ -48,11 +48,11 @@ original state.") if (string-match-p prompt-re prompt) return (string-match-p opt-re option))) -(defadvice! doom--straight-fallback-to-tty-prompt-a (orig-fn prompt actions) +(defadvice! doom--straight-fallback-to-tty-prompt-a (fn prompt actions) "Modifies straight to prompt on the terminal when in noninteractive sessions." :around #'straight--popup-raw (if doom-interactive-p - (funcall orig-fn prompt actions) + (funcall fn prompt actions) (let ((doom--straight-auto-options doom--straight-auto-options)) ;; We can't intercept C-g, so no point displaying any options for this key ;; when C-c is the proper way to abort batch Emacs. diff --git a/core/core-editor.el b/core/core-editor.el index 9e48559c1..7d6d7afe3 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -142,7 +142,7 @@ tell you about it. Very annoying. This prevents that." ;; filesystem will murder your family. To appease it, I compress ;; `buffer-file-name' to a stable 40 characters. ;; TODO PR this upstream; should be a universal issue! -(defadvice! doom-make-hashed-auto-save-file-name-a (orig-fn) +(defadvice! doom-make-hashed-auto-save-file-name-a (fn) "Compress the auto-save file name so paths don't get too long." :around #'make-auto-save-file-name (let ((buffer-file-name @@ -157,11 +157,11 @@ tell you about it. Very annoying. This prevents that." 'make-auto-save-file-name)) buffer-file-name (sha1 buffer-file-name)))) - (funcall orig-fn))) + (funcall fn))) ;; HACK Does the same for Emacs backup files, but also packages that use ;; `make-backup-file-name-1' directly (like undo-tree). -(defadvice! doom-make-hashed-backup-file-name-a (orig-fn file) +(defadvice! doom-make-hashed-backup-file-name-a (fn file) "A few places use the backup file name so paths don't get too long." :around #'make-backup-file-name-1 (let ((alist backup-directory-alist) @@ -171,7 +171,7 @@ tell you about it. Very annoying. This prevents that." (if (string-match (car elt) file) (setq backup-directory (cdr elt) alist nil)))) - (let ((file (funcall orig-fn file))) + (let ((file (funcall fn file))) (if (or (null backup-directory) (not (file-name-absolute-p backup-directory))) file @@ -385,17 +385,17 @@ the unwritable tidbits." :after-while #'save-place-find-file-hook (if buffer-file-name (ignore-errors (recenter)))) - (defadvice! doom--inhibit-saveplace-in-long-files-a (orig-fn &rest args) + (defadvice! doom--inhibit-saveplace-in-long-files-a (fn &rest args) :around #'save-place-to-alist (unless doom-large-file-p - (apply orig-fn args))) + (apply fn args))) - (defadvice! doom--dont-prettify-saveplace-cache-a (orig-fn) + (defadvice! doom--dont-prettify-saveplace-cache-a (fn) "`save-place-alist-to-file' uses `pp' to prettify the contents of its cache. `pp' can be expensive for longer lists, and there's no reason to prettify cache files, so this replace calls to `pp' with the much faster `prin1'." :around #'save-place-alist-to-file - (letf! ((#'pp #'prin1)) (funcall orig-fn)))) + (letf! ((#'pp #'prin1)) (funcall fn)))) (use-package! server @@ -426,20 +426,20 @@ files, so this replace calls to `pp' with the much faster `prin1'." (global-set-key [remap evil-jump-backward] #'better-jumper-jump-backward) (global-set-key [remap xref-pop-marker-stack] #'better-jumper-jump-backward) :config - (defun doom-set-jump-a (orig-fn &rest args) - "Set a jump point and ensure ORIG-FN doesn't set any new jump points." + (defun doom-set-jump-a (fn &rest args) + "Set a jump point and ensure fn doesn't set any new jump points." (better-jumper-set-jump (if (markerp (car args)) (car args))) (let ((evil--jumps-jumping t) (better-jumper--jumping t)) - (apply orig-fn args))) + (apply fn args))) - (defun doom-set-jump-maybe-a (orig-fn &rest args) - "Set a jump point if ORIG-FN returns non-nil." + (defun doom-set-jump-maybe-a (fn &rest args) + "Set a jump point if fn returns non-nil." (let ((origin (point-marker)) (result (let* ((evil--jumps-jumping t) (better-jumper--jumping t)) - (apply orig-fn args)))) + (apply fn args)))) (unless result (with-current-buffer (marker-buffer origin) (better-jumper-set-jump @@ -489,7 +489,7 @@ files, so this replace calls to `pp' with the much faster `prin1'." (push '(t tab-width) dtrt-indent-hook-generic-mapping-list) (defvar dtrt-indent-run-after-smie) - (defadvice! doom--fix-broken-smie-modes-a (orig-fn arg) + (defadvice! doom--fix-broken-smie-modes-a (fn arg) "Some smie modes throw errors when trying to guess their indentation, like `nim-mode'. This prevents them from leaving Emacs in a broken state." :around #'dtrt-indent-mode @@ -502,7 +502,7 @@ files, so this replace calls to `pp' with the much faster `prin1'." (message "[WARNING] Indent detection: %s" (error-message-string e)) (message ""))))) ; warn silently - (funcall orig-fn arg))))) + (funcall fn arg))))) (use-package! helpful ;; a better *help* buffer @@ -517,11 +517,11 @@ files, so this replace calls to `pp' with the much faster `prin1'." (global-set-key [remap describe-key] #'helpful-key) (global-set-key [remap describe-symbol] #'helpful-symbol) - (defun doom-use-helpful-a (orig-fn &rest args) - "Force ORIG-FN to use helpful instead of the old describe-* commands." + (defun doom-use-helpful-a (fn &rest args) + "Force FN to use helpful instead of the old describe-* commands." (letf! ((#'describe-function #'helpful-function) (#'describe-variable #'helpful-variable)) - (apply orig-fn args))) + (apply fn args))) (after! apropos ;; patch apropos buttons to call helpful instead of help diff --git a/core/core-modules.el b/core/core-modules.el index be6334182..a1fe7b365 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -367,13 +367,13 @@ This value is cached. If REFRESH-P, then don't use the cached value." ;; HACK Fix `:load-path' so it resolves relative paths to the containing file, ;; rather than `user-emacs-directory'. This is a done as a convenience ;; for users, wanting to specify a local directory. - (defadvice! doom--resolve-load-path-from-containg-file-a (orig-fn label arg &optional recursed) + (defadvice! doom--resolve-load-path-from-containg-file-a (fn label arg &optional recursed) "Resolve :load-path from the current directory." :around #'use-package-normalize-paths ;; `use-package-normalize-paths' resolves paths relative to ;; `user-emacs-directory', so we change that. (let ((user-emacs-directory (if (stringp arg) (dir!)))) - (funcall orig-fn label arg recursed))) + (funcall fn label arg recursed))) ;; Adds two keywords to `use-package' to expand its lazy-loading capabilities: ;; diff --git a/core/core-packages.el b/core/core-packages.el index 282006519..4398e4d06 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -102,10 +102,10 @@ uses a straight or package.el command directly).") ;; `let-alist' is built into Emacs 26 and onwards (add-to-list 'straight-built-in-pseudo-packages 'let-alist)) -(defadvice! doom--read-pinned-packages-a (orig-fn &rest args) +(defadvice! doom--read-pinned-packages-a (fn &rest args) "Read `:pin's in `doom-packages' on top of straight's lockfiles." :around #'straight--lockfile-read-all - (append (apply orig-fn args) ; lockfiles still take priority + (append (apply fn args) ; lockfiles still take priority (doom-package-pinned-list))) diff --git a/core/core-projects.el b/core/core-projects.el index 898557bd2..bffd26c2f 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -181,7 +181,7 @@ And if it's a function, evaluate it." (if IS-WINDOWS " --path-separator=/"))) ("find . -type f -print0")))) - (defadvice! doom--projectile-default-generic-command-a (orig-fn &rest args) + (defadvice! doom--projectile-default-generic-command-a (fn &rest args) "If projectile can't tell what kind of project you're in, it issues an error when using many of projectile's command, e.g. `projectile-compile-command', `projectile-run-project', `projectile-test-project', and @@ -190,7 +190,7 @@ when using many of projectile's command, e.g. `projectile-compile-command', This suppresses the error so these commands will still run, but prompt you for the command instead." :around #'projectile-default-generic-command - (ignore-errors (apply orig-fn args)))) + (ignore-errors (apply fn args)))) ;; diff --git a/core/core-ui.el b/core/core-ui.el index e78d6009d..de4600983 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -103,30 +103,30 @@ font to that size. It's rarely a good idea to do so!") (run-hooks 'doom-switch-frame-hook) (setq doom--last-frame (selected-frame))))) -(defun doom-run-switch-buffer-hooks-a (orig-fn buffer-or-name &rest args) +(defun doom-run-switch-buffer-hooks-a (fn buffer-or-name &rest args) (if (or doom-inhibit-switch-buffer-hooks (and buffer-or-name (eq (current-buffer) (get-buffer buffer-or-name))) - (and (eq orig-fn #'switch-to-buffer) (car args))) - (apply orig-fn buffer-or-name args) + (and (eq fn #'switch-to-buffer) (car args))) + (apply fn buffer-or-name args) (let ((gc-cons-threshold most-positive-fixnum) (doom-inhibit-switch-buffer-hooks t) (inhibit-redisplay t)) - (when-let (buffer (apply orig-fn buffer-or-name args)) + (when-let (buffer (apply fn buffer-or-name args)) (with-current-buffer (if (windowp buffer) (window-buffer buffer) buffer) (run-hooks 'doom-switch-buffer-hook)) buffer)))) -(defun doom-run-switch-to-next-prev-buffer-hooks-a (orig-fn &rest args) +(defun doom-run-switch-to-next-prev-buffer-hooks-a (fn &rest args) (if doom-inhibit-switch-buffer-hooks - (apply orig-fn args) + (apply fn args) (let ((gc-cons-threshold most-positive-fixnum) (doom-inhibit-switch-buffer-hooks t) (inhibit-redisplay t)) - (when-let (buffer (apply orig-fn args)) + (when-let (buffer (apply fn args)) (with-current-buffer buffer (run-hooks 'doom-switch-buffer-hook)) buffer)))) @@ -499,13 +499,13 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (set-fontset-font t 'unicode font nil 'append))))) :config (cond ((daemonp) - (defadvice! doom--disable-all-the-icons-in-tty-a (orig-fn &rest args) + (defadvice! doom--disable-all-the-icons-in-tty-a (fn &rest args) "Return a blank string in tty Emacs, which doesn't support multiple fonts." :around '(all-the-icons-octicon all-the-icons-material all-the-icons-faicon all-the-icons-fileicon all-the-icons-wicon all-the-icons-alltheicon) (if (or (not after-init-time) (display-multi-font-p)) - (apply orig-fn args) + (apply fn args) ""))) ((not (display-graphic-p)) (defadvice! doom--disable-all-the-icons-in-tty-a (&rest _) @@ -617,7 +617,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (with-selected-frame (or frame (selected-frame)) (load-theme doom-theme t)))) -(defadvice! doom--load-theme-a (orig-fn theme &optional no-confirm no-enable) +(defadvice! doom--load-theme-a (fn theme &optional no-confirm no-enable) "Record `doom-theme', disable old themes, and trigger `doom-load-theme-hook'." :around #'load-theme ;; Run `load-theme' from an estranged buffer, where we can ensure that @@ -628,7 +628,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original ;; Disable previous themes so there are no conflicts. If you truly want ;; multiple themes enabled, then use `enable-theme' instead. (mapc #'disable-theme custom-enabled-themes) - (prog1 (funcall orig-fn theme no-confirm no-enable) + (prog1 (funcall fn theme no-confirm no-enable) (when (and (not no-enable) (custom-theme-enabled-p theme)) (setq doom-theme theme) (put 'doom-theme 'previous-themes (or last-themes 'none)) diff --git a/core/core.el b/core/core.el index 7ba0ef1d6..e0defa26a 100644 --- a/core/core.el +++ b/core/core.el @@ -243,20 +243,15 @@ users).") request-storage-directory (concat doom-cache-dir "request") shared-game-score-directory (concat doom-etc-dir "shared-game-score/")) -(defadvice! doom--write-to-etc-dir-a (orig-fn &rest args) - "Resolve Emacs storage directory to `doom-etc-dir', to keep local files from -polluting `doom-emacs-dir'." - :around #'locate-user-emacs-file - (let ((user-emacs-directory doom-etc-dir)) - (apply orig-fn args))) - -(defadvice! doom--write-enabled-commands-to-doomdir-a (orig-fn &rest args) +(defadvice! doom--write-to-sane-paths-a (fn &rest args) "When enabling a disabled command, the `put' call is written to ~/.emacs.d/init.el, which causes issues for Doom, so write it to the user's config.el instead." :around #'en/disable-command - (let ((user-init-file custom-file)) - (apply orig-fn args))) + :around #'locate-user-emacs-file + (let ((user-emacs-directory doom-etc-dir) + (user-init-file custom-file)) + (apply fn args))) ;; diff --git a/modules/checkers/spell/config.el b/modules/checkers/spell/config.el index 05d7e087d..6041b6f23 100644 --- a/modules/checkers/spell/config.el +++ b/modules/checkers/spell/config.el @@ -139,7 +139,7 @@ #'+spell/correct)) ;; TODO PR this fix upstream! - (defadvice! +spell--fix-face-detection-a (orig-fn &rest args) + (defadvice! +spell--fix-face-detection-a (fn &rest args) "`spell-fu--faces-at-point' uses face detection that won't penetrary overlays (like `hl-line'). This makes `spell-fu-faces-exclude' demonstrably less useful when it'll still spellcheck excluded faces on any line that `hl-line' is @@ -148,7 +148,7 @@ displayed on, even momentarily." (letf! (defun get-char-property (pos prop &optional obj) (or (plist-get (text-properties-at pos) prop) (funcall get-char-property pos prop obj))) - (apply orig-fn args))) + (apply fn args))) (defadvice! +spell--create-word-dict-a (_word words-file _action) "Prevent `spell-fu--word-add-or-remove' from throwing non-existant diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 70a8efaf6..5a50874c9 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -211,10 +211,10 @@ results buffer.") ;; HACK Fix an issue where `counsel-projectile-find-file-action' would try to ;; open a candidate in an occur buffer relative to the wrong buffer, ;; causing it to fail to find the file we want. - (defadvice! +ivy--run-from-ivy-directory-a (orig-fn &rest args) + (defadvice! +ivy--run-from-ivy-directory-a (fn &rest args) :around #'counsel-projectile-find-file-action (let ((default-directory (ivy-state-directory ivy-last))) - (apply orig-fn args))) + (apply fn args))) ;; Don't use ^ as initial input. Set this here because `counsel' defines more ;; of its own, on top of the defaults. diff --git a/modules/editor/evil/autoload/advice.el b/modules/editor/evil/autoload/advice.el index bac8b79c6..a9466dfce 100644 --- a/modules/editor/evil/autoload/advice.el +++ b/modules/editor/evil/autoload/advice.el @@ -118,26 +118,26 @@ more information on modifiers." (back-to-indentation))))))) ;;;###autoload -(defun +evil--insert-newline-below-and-respect-comments-a (orig-fn count) +(defun +evil--insert-newline-below-and-respect-comments-a (fn count) (if (or (not +evil-want-o/O-to-continue-comments) (not (eq this-command 'evil-open-below)) (evil-insert-state-p) (evil-emacs-state-p)) - (funcall orig-fn count) + (funcall fn count) (letf! (defun evil-insert-newline-below () (+evil--insert-newline)) (let ((evil-auto-indent evil-auto-indent)) - (funcall orig-fn count))))) + (funcall fn count))))) ;;;###autoload -(defun +evil--insert-newline-above-and-respect-comments-a (orig-fn count) +(defun +evil--insert-newline-above-and-respect-comments-a (fn count) (if (or (not +evil-want-o/O-to-continue-comments) (not (eq this-command 'evil-open-above)) (evil-insert-state-p) (evil-emacs-state-p)) - (funcall orig-fn count) + (funcall fn count) (letf! (defun evil-insert-newline-above () (+evil--insert-newline 'above)) (let ((evil-auto-indent evil-auto-indent)) - (funcall orig-fn count))))) + (funcall fn count))))) ;;;###autoload (autoload '+evil-window-split-a "editor/evil/autoload/advice" nil t) (evil-define-command +evil-window-split-a (&optional count file) @@ -179,7 +179,7 @@ more information on modifiers." (if file (evil-edit file))) ;;;###autoload (autoload '+evil-join-a "editor/evil/autoload/advice" nil nil) -(defun +evil-join-a (orig-fn beg end) +(defun +evil-join-a (fn beg end) "Join the selected lines. This advice improves on `evil-join' by removing comment delimiters when joining @@ -189,7 +189,7 @@ From https://github.com/emacs-evil/evil/issues/606" ;; But revert to the default we're not in a comment, where ;; `fill-region-as-paragraph' is too greedy. (if (not (doom-point-in-comment-p (min (max beg (1+ (point))) end))) - (funcall orig-fn beg end) + (funcall fn beg end) (let* ((count (count-lines beg end)) (count (if (> count 1) (1- count) count)) (fixup-mark (make-marker))) diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index 7f7ea319e..e64d14621 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -134,9 +134,9 @@ directives. By default, this only recognizes C directives.") ;; HACK '=' moves the cursor to the beginning of selection. Disable this, ;; since it's more disruptive than helpful. - (defadvice! +evil--dont-move-cursor-a (orig-fn &rest args) + (defadvice! +evil--dont-move-cursor-a (fn &rest args) :around #'evil-indent - (save-excursion (apply orig-fn args))) + (save-excursion (apply fn args))) ;; REVIEW In evil, registers 2-9 are buffer-local. In vim, they're global, ;; so... Perhaps this should be PRed upstream? @@ -166,11 +166,11 @@ directives. By default, this only recognizes C directives.") ;; Prevent gw (`evil-fill') and gq (`evil-fill-and-move') from squeezing ;; spaces. It doesn't in vim, so it shouldn't in evil. - (defadvice! +evil--no-squeeze-on-fill-a (orig-fn &rest args) + (defadvice! +evil--no-squeeze-on-fill-a (fn &rest args) :around '(evil-fill evil-fill-and-move) (letf! (defun fill-region (from to &optional justify nosqueeze to-eop) (funcall fill-region from to justify t to-eop)) - (apply orig-fn args))) + (apply fn args))) ;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'. (advice-add #'evil-force-normal-state :after #'+evil-escape-a) diff --git a/modules/editor/evil/init.el b/modules/editor/evil/init.el index 611f226f0..54276ea15 100644 --- a/modules/editor/evil/init.el +++ b/modules/editor/evil/init.el @@ -251,10 +251,10 @@ and complains if a module is loaded too early (during startup)." (with-demoted-errors "evil-collection error: %s" (evil-collection-init (list module))))) - (defadvice! +evil-collection-disable-blacklist-a (orig-fn) + (defadvice! +evil-collection-disable-blacklist-a (fn) :around #'evil-collection-vterm-toggle-send-escape ; allow binding to ESC (let (evil-collection-key-blacklist) - (funcall-interactively orig-fn))) + (funcall-interactively fn))) ;; These modes belong to packages that Emacs always loads at startup, causing ;; evil-collection and it's co-packages to all load immediately. We avoid this diff --git a/modules/editor/file-templates/config.el b/modules/editor/file-templates/config.el index f9ac6886e..3de046a39 100644 --- a/modules/editor/file-templates/config.el +++ b/modules/editor/file-templates/config.el @@ -146,10 +146,10 @@ must be non-read-only, empty, and there must be a rule in (when-let (rule (cl-find-if #'+file-template-p +file-templates-alist)) (apply #'+file-templates--expand rule)))) -(defadvice! +file-templates-inhibit-in-org-capture-a (orig-fn &rest args) +(defadvice! +file-templates-inhibit-in-org-capture-a (fn &rest args) :around #'org-capture (let ((+file-templates-inhibit t)) - (apply orig-fn args))) + (apply fn args))) ;; diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index 2e689ba52..b06290da9 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -99,7 +99,7 @@ Stolen shamelessly from go-mode" (if fmt (intern fmt)))) ;;;###autoload -(defun +format-probe-a (orig-fn) +(defun +format-probe-a (fn) "Use `+format-with' instead, if it is set. Prompts for a formatter if universal arg is set." (cond ((or buffer-read-only (eq +format-with :none)) @@ -118,7 +118,7 @@ Prompts for a formatter if universal arg is set." (bound-and-true-p eglot--managed-mode) (eglot--server-capable :documentFormattingProvider)) (list 'eglot nil)) - ((funcall orig-fn)))) + ((funcall fn)))) ;;;###autoload (defun +format-buffer-a (formatter mode-result) diff --git a/modules/editor/format/config.el b/modules/editor/format/config.el index 9ce07183c..95c61114e 100644 --- a/modules/editor/format/config.el +++ b/modules/editor/format/config.el @@ -71,7 +71,7 @@ This is controlled by `+format-on-save-enabled-modes'." ;; Don't pop up imposing warnings about missing formatters, but still log it in ;; to *Messages*. -(defadvice! +format--all-buffer-from-hook-a (orig-fn &rest args) +(defadvice! +format--all-buffer-from-hook-a (fn &rest args) :around #'format-all-buffer--from-hook (letf! (defun format-all-buffer--with (formatter mode-result) (when (or (eq formatter 'lsp) @@ -83,4 +83,4 @@ This is controlled by `+format-on-save-enabled-modes'." (gethash formatter format-all--executable-table)) nil))) (funcall format-all-buffer--with formatter mode-result))) - (apply orig-fn args))) + (apply fn args))) diff --git a/modules/editor/multiple-cursors/config.el b/modules/editor/multiple-cursors/config.el index a4411c95e..90f093ec6 100644 --- a/modules/editor/multiple-cursors/config.el +++ b/modules/editor/multiple-cursors/config.el @@ -92,7 +92,7 @@ ;; HACK Allow these commands to be repeated by prefixing them with a numerical ;; argument. See gabesoft/evil-mc#110 - (defadvice! +multiple-cursors--make-repeatable-a (orig-fn) + (defadvice! +multiple-cursors--make-repeatable-a (fn) :around '(evil-mc-make-and-goto-first-cursor evil-mc-make-and-goto-last-cursor evil-mc-make-and-goto-prev-cursor @@ -104,7 +104,7 @@ evil-mc-skip-and-goto-prev-match evil-mc-skip-and-goto-next-match) (dotimes (i (if (integerp current-prefix-arg) current-prefix-arg 1)) - (funcall orig-fn))) + (funcall fn))) ;; If we're entering insert mode, it's a good bet that we want to start using ;; our multiple cursors diff --git a/modules/editor/snippets/autoload/snippets.el b/modules/editor/snippets/autoload/snippets.el index 7f5a1f63d..2b5f70c1d 100644 --- a/modules/editor/snippets/autoload/snippets.el +++ b/modules/editor/snippets/autoload/snippets.el @@ -297,15 +297,14 @@ shadow the default snippet)." ;;; Advice ;;;###autoload -(defun +snippets-expand-on-region-a (orig-fn &optional no-condition) +(defun +snippets-expand-on-region-a (fn &optional no-condition) "Fix off-by-one when expanding snippets on an evil visual region. Also strips whitespace out of selection. Also switches to insert mode. If -`evil-local-mode' isn't enabled, or we're not in visual mode, run ORIG-FN as -is." +`evil-local-mode' isn't enabled, or we're not in visual mode, run FN as is." (if (not (and (bound-and-true-p evil-local-mode) (evil-visual-state-p))) - (funcall orig-fn no-condition) + (funcall fn no-condition) ;; Trim whitespace in selected region, so as not to introduce extra ;; whitespace into `yas-selected-text'. (evil-visual-select (save-excursion @@ -319,7 +318,7 @@ is." 'inclusive) (letf! ((defun region-beginning () evil-visual-beginning) (defun region-end () evil-visual-end)) - (funcall orig-fn no-condition))) + (funcall fn no-condition))) (when (and (bound-and-true-p evil-local-mode) (not (or (evil-emacs-state-p) (evil-insert-state-p))) diff --git a/modules/editor/snippets/config.el b/modules/editor/snippets/config.el index 07d100940..87816b590 100644 --- a/modules/editor/snippets/config.el +++ b/modules/editor/snippets/config.el @@ -124,11 +124,11 @@ :defer t :config (setq aya-persist-snippets-dir +snippets-dir) - (defadvice! +snippets--inhibit-yas-global-mode-a (orig-fn &rest args) + (defadvice! +snippets--inhibit-yas-global-mode-a (fn &rest args) "auto-yasnippet enables `yas-global-mode'. This is obnoxious for folks like us who use yas-minor-mode and enable yasnippet more selectively. This advice swaps `yas-global-mode' with `yas-minor-mode'." :around '(aya-expand aya-open-line) (letf! ((#'yas-global-mode #'yas-minor-mode) (yas-global-mode yas-minor-mode)) - (apply orig-fn args)))) + (apply fn args)))) diff --git a/modules/editor/word-wrap/autoload.el b/modules/editor/word-wrap/autoload.el index 5e1b95ed8..6b382561a 100644 --- a/modules/editor/word-wrap/autoload.el +++ b/modules/editor/word-wrap/autoload.el @@ -7,10 +7,10 @@ (defvar +word-wrap--major-mode-indent-var nil) (defvar adaptive-wrap-extra-indent) -(defun +word-wrap--adjust-extra-indent-a (orig-fn beg end) +(defun +word-wrap--adjust-extra-indent-a (fn beg end) "Contextually adjust extra word-wrap indentation." (let ((adaptive-wrap-extra-indent (+word-wrap--calc-extra-indent beg))) - (funcall orig-fn beg end))) + (funcall fn beg end))) (defun +word-wrap--calc-extra-indent (p) "Calculate extra word-wrap indentation at point." diff --git a/modules/emacs/vc/config.el b/modules/emacs/vc/config.el index cd81bd26f..7f729c397 100644 --- a/modules/emacs/vc/config.el +++ b/modules/emacs/vc/config.el @@ -49,7 +49,7 @@ (setq git-timemachine-show-minibuffer-details t) ;; TODO PR this to `git-timemachine' - (defadvice! +vc-support-git-timemachine-a (orig-fn) + (defadvice! +vc-support-git-timemachine-a (fn) "Allow `browse-at-remote' commands in git-timemachine buffers to open that file in your browser at the visited revision." :around #'browse-at-remote-get-url @@ -71,7 +71,7 @@ file in your browser at the visited revision." (funcall url-formatter repo-url ref relname (if start-line start-line) (if (and end-line (not (equal start-line end-line))) end-line))) - (funcall orig-fn))) + (funcall fn))) (defadvice! +vc-update-header-line-a (revision) "Show revision details in the header-line, instead of the minibuffer. diff --git a/modules/email/mu4e/config.el b/modules/email/mu4e/config.el index 9893f3f80..2c85e7e98 100644 --- a/modules/email/mu4e/config.el +++ b/modules/email/mu4e/config.el @@ -273,20 +273,20 @@ Usefull for affecting HTML export config.") (setq +mu4e-compose-org-msg-toggle-next (not +mu4e-compose-org-msg-toggle-next)))) - (defadvice! +mu4e-maybe-toggle-org-msg-a (orig-fn &optional toggle-p) + (defadvice! +mu4e-maybe-toggle-org-msg-a (fn &optional toggle-p) :around #'mu4e-compose-new :around #'mu4e-compose-reply :around #'mu4e-compose-forward :around #'mu4e-compose-resend (interactive "p") (+mu4e-compose-org-msg-handle-toggle (/= 1 (or toggle-p 0))) - (funcall orig-fn)) + (funcall fn)) - (defadvice! +mu4e-draft-open-signature-a (orig-fn &rest args) + (defadvice! +mu4e-draft-open-signature-a (fn &rest args) "Prevent `mu4e-compose-signature' from being used with `org-msg-mode'." :around #'mu4e-draft-open (let ((mu4e-compose-signature (unless org-msg-mode mu4e-compose-signature))) - (apply orig-fn args))) + (apply fn args))) (map! :map org-msg-edit-mode-map "TAB" #'org-msg-tab) ; only bound by default diff --git a/modules/email/notmuch/autoload.el b/modules/email/notmuch/autoload.el index 1110b36d5..75b8666d4 100644 --- a/modules/email/notmuch/autoload.el +++ b/modules/email/notmuch/autoload.el @@ -155,7 +155,7 @@ ;; Advice ;;;###autoload -(defun +notmuch-dont-confirm-on-kill-process-a (orig-fn &rest args) +(defun +notmuch-dont-confirm-on-kill-process-a (fn &rest args) "Don't prompt for confirmation when killing notmuch sentinel." (let (confirm-kill-processes) - (apply orig-fn args))) + (apply fn args))) diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index e32818726..ba42f2a8f 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -70,9 +70,9 @@ This is ignored by ccls.") ;; HACK Suppress 'Args out of range' error in when multiple modifications are ;; performed at once in a `c++-mode' buffer, e.g. with `iedit' or ;; multiple cursors. - (undefadvice! +cc--suppress-silly-errors-a (orig-fn &rest args) + (undefadvice! +cc--suppress-silly-errors-a (fn &rest args) :around #'c-after-change-mark-abnormal-strings - (ignore-errors (apply orig-fn args))) + (ignore-errors (apply fn args))) ;; Custom style, based off of linux (setq c-basic-offset tab-width diff --git a/modules/lang/csharp/config.el b/modules/lang/csharp/config.el index d90802cab..0aa6c63df 100644 --- a/modules/lang/csharp/config.el +++ b/modules/lang/csharp/config.el @@ -35,13 +35,13 @@ (when (featurep! +lsp) (add-hook 'csharp-mode-local-vars-hook #'lsp!)) - (defadvice! +csharp-disable-clear-string-fences-a (orig-fn &rest args) + (defadvice! +csharp-disable-clear-string-fences-a (fn &rest args) "This turns off `c-clear-string-fences' for `csharp-mode'. When on for `csharp-mode' font lock breaks after an interpolated string or terminating simple string." :around #'csharp-disable-clear-string-fences (unless (eq major-mode 'csharp-mode) - (apply orig-fn args)))) + (apply fn args)))) (use-package! omnisharp :unless (featurep! +lsp) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index d0495a01e..3efd82a36 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -115,10 +115,10 @@ employed so that flycheck still does *some* helpful linting.") ;; Recenter window after following definition (advice-add #'elisp-def :after #'doom-recenter-a) - (defadvice! +emacs-lisp-append-value-to-eldoc-a (orig-fn sym) + (defadvice! +emacs-lisp-append-value-to-eldoc-a (fn sym) "Display variable value next to documentation in eldoc." :around #'elisp-get-var-docstring - (when-let (ret (funcall orig-fn sym)) + (when-let (ret (funcall fn sym)) (if (boundp sym) (concat ret " " (let* ((truncated " [...]") @@ -209,10 +209,10 @@ employed so that flycheck still does *some* helpful linting.") (advice-add 'describe-function-1 :after #'elisp-demos-advice-describe-function-1) (advice-add 'helpful-update :after #'elisp-demos-advice-helpful-update) :config - (defadvice! +emacs-lisp--add-doom-elisp-demos-a (orig-fn symbol) + (defadvice! +emacs-lisp--add-doom-elisp-demos-a (fn symbol) "Add Doom's own demos to help buffers." :around #'elisp-demos--search - (or (funcall orig-fn symbol) + (or (funcall fn symbol) (when-let (demos-file (doom-module-locate-path :lang 'emacs-lisp "demos.org")) (with-temp-buffer (insert-file-contents demos-file) diff --git a/modules/lang/haskell/+dante.el b/modules/lang/haskell/+dante.el index b10853818..2683abd8c 100644 --- a/modules/lang/haskell/+dante.el +++ b/modules/lang/haskell/+dante.el @@ -19,7 +19,7 @@ (set-company-backend! 'dante-mode #'dante-company) - (defadvice! +haskell--restore-modified-state-a (orig-fn &rest args) + (defadvice! +haskell--restore-modified-state-a (fn &rest args) "Marks the buffer as falsely modified. Dante quietly saves the current buffer (without triggering save hooks) before invoking flycheck, unexpectedly leaving the buffer in an unmodified state. This @@ -27,7 +27,7 @@ is annoying if we depend on save hooks to do work on the buffer (like reformatting)." :around #'dante-async-load-current-buffer (let ((modified-p (buffer-modified-p))) - (apply orig-fn args) + (apply fn args) (if modified-p (set-buffer-modified-p t)))) (when (featurep 'evil) diff --git a/modules/lang/java/+meghanada.el b/modules/lang/java/+meghanada.el index dd14aa72c..94c067d6d 100644 --- a/modules/lang/java/+meghanada.el +++ b/modules/lang/java/+meghanada.el @@ -15,11 +15,11 @@ :definition #'meghanada-jump-declaration :references #'meghanada-reference) - (defadvice! +java-meghanada-fail-gracefully-a (orig-fn &rest args) + (defadvice! +java-meghanada-fail-gracefully-a (fn &rest args) "Toggle `meghanada-mode'. Fail gracefully if java is unavailable." :around #'meghanada-mode (if (executable-find meghanada-java-path) - (apply orig-fn args) + (apply fn args) (message "Can't find %S binary. Is java installed? Aborting `meghanada-mode'." meghanada-java-path))) diff --git a/modules/lang/latex/+viewers.el b/modules/lang/latex/+viewers.el index 04f07d11b..a58bfdcb6 100644 --- a/modules/lang/latex/+viewers.el +++ b/modules/lang/latex/+viewers.el @@ -51,7 +51,7 @@ (setq latex-preview-pane-multifile-mode 'auctex) ;; TODO PR this to maintained fork. Original project appears abandoned - (defadvice! +latex--dont-reopen-preview-pane-a (orig-fn &rest args) + (defadvice! +latex--dont-reopen-preview-pane-a (fn &rest args) "Once the preview pane has been closed it should not be reopened." :around #'latex-preview-pane-update (letf! (defun init-latex-preview-pane (&rest _) @@ -59,7 +59,7 @@ ;; window, but it's already gone, so it ends up deleting the ;; wrong window. (setq-local latex-preview-pane-mode nil)) - (apply orig-fn args))) + (apply fn args))) (define-key! doc-view-mode-map "ESC" #'delete-window diff --git a/modules/lang/latex/config.el b/modules/lang/latex/config.el index 2c2929eee..95f27fb14 100644 --- a/modules/lang/latex/config.el +++ b/modules/lang/latex/config.el @@ -167,19 +167,19 @@ Math faces should stay fixed by the mixed-pitch blacklist, this is mostly for (add-to-list 'LaTeX-indent-environment-list `(,env +latex-indent-item-fn))) ;; Fix #1849: allow fill-paragraph in itemize/enumerate - (defadvice! +latex--re-indent-itemize-and-enumerate-a (orig-fn &rest args) + (defadvice! +latex--re-indent-itemize-and-enumerate-a (fn &rest args) :around #'LaTeX-fill-region-as-para-do (let ((LaTeX-indent-environment-list (append LaTeX-indent-environment-list '(("itemize" +latex-indent-item-fn) ("enumerate" +latex-indent-item-fn))))) - (apply orig-fn args))) - (defadvice! +latex--dont-indent-itemize-and-enumerate-a (orig-fn &rest args) + (apply fn args))) + (defadvice! +latex--dont-indent-itemize-and-enumerate-a (fn &rest args) :around #'LaTeX-fill-region-as-paragraph (let ((LaTeX-indent-environment-list LaTeX-indent-environment-list)) (delq! "itemize" LaTeX-indent-environment-list 'assoc) (delq! "enumerate" LaTeX-indent-environment-list 'assoc) - (apply orig-fn args)))) + (apply fn args)))) (use-package! preview diff --git a/modules/lang/ledger/config.el b/modules/lang/ledger/config.el index 168f96bfe..b9973e33c 100644 --- a/modules/lang/ledger/config.el +++ b/modules/lang/ledger/config.el @@ -13,11 +13,11 @@ '(("^\\*Ledger Report" :size 0.5 :quit 'other :ttl 0) ("^\\*Ledger Error" :quit t :ttl 0))) - (defadvice! +ledger--fail-gracefully-if-absent-a (orig-fn) + (defadvice! +ledger--fail-gracefully-if-absent-a (fn) "Fail gracefully if ledger binary isn't available." :around #'ledger-check-version (if (executable-find ledger-binary-path) - (funcall orig-fn) + (funcall fn) (message "Couldn't find '%s' executable" ledger-binary-path))) ;; `ledger-mode' lacks imenu support out of the box, so we gie it some. At @@ -74,10 +74,10 @@ "s" #'ledger-display-ledger-stats "b" #'ledger-display-balance-at-point))) - (defadvice! +ledger--fix-key-help-a (orig-fn &rest args) + (defadvice! +ledger--fix-key-help-a (fn &rest args) "Fix inaccurate keybind message." :around #'ledger-report - (quiet! (apply orig-fn args)) + (quiet! (apply fn args)) (with-current-buffer (get-buffer ledger-report-buffer-name) (setq header-line-format (substitute-command-keys diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index e5c63f6e3..51ca77cae 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -238,7 +238,7 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default (after! ob (add-to-list 'org-babel-default-lob-header-args '(:sync))) - (defadvice! +org-babel-disable-async-maybe-a (orig-fn &optional fn arg info params) + (defadvice! +org-babel-disable-async-maybe-a (fn &optional orig-fn arg info params) "Use ob-comint where supported, disable async altogether where it isn't. We have access to two async backends: ob-comint or ob-async, which have @@ -251,8 +251,8 @@ Note: ob-comint support will only kick in for languages listed in Also adds support for a `:sync' parameter to override `:async'." :around #'ob-async-org-babel-execute-src-block - (if (null fn) - (funcall orig-fn fn arg info params) + (if (null orig-fn) + (funcall fn orig-fn arg info params) (let* ((info (or info (org-babel-get-src-block-info))) (params (org-babel-merge-params (nth 2 info) params))) (if (or (assq :sync params) @@ -271,8 +271,8 @@ Also adds support for a `:sync' parameter to override `:async'." (car info)) (sleep-for 0.2)) t)) - (funcall fn arg info params) - (funcall orig-fn fn arg info params))))) + (funcall orig-fn arg info params) + (funcall fn orig-fn arg info params))))) (defadvice! +org-fix-newline-and-indent-in-src-blocks-a (&optional indent _arg _interactive) "Mimic `newline-and-indent' in src blocks w/ lang-appropriate indentation." @@ -283,10 +283,10 @@ Also adds support for a `:sync' parameter to override `:async'." (org-babel-do-in-edit-buffer (call-interactively #'indent-for-tab-command)))) - (defadvice! +org-inhibit-mode-hooks-a (orig-fn datum name &optional initialize &rest args) + (defadvice! +org-inhibit-mode-hooks-a (fn datum name &optional initialize &rest args) "Prevent potentially expensive mode hooks in `org-babel-do-in-edit-buffer' ops." :around #'org-src--edit-element - (apply orig-fn datum name + (apply fn datum name (if (and (eq org-src-window-setup 'switch-invisibly) (functionp initialize)) ;; org-babel-do-in-edit-buffer is used to execute quick, one-off @@ -426,9 +426,9 @@ I like: ;; HACK Doom doesn't support `customize'. Best not to advertise it as an ;; option in `org-capture's menu. - (defadvice! +org--remove-customize-option-a (orig-fn table title &optional prompt specials) + (defadvice! +org--remove-customize-option-a (fn table title &optional prompt specials) :around #'org-mks - (funcall orig-fn table title prompt + (funcall fn table title prompt (remove '("C" "Customize org-capture-templates") specials))) @@ -572,14 +572,14 @@ relative to `org-directory', unless it is an absolute path." (mathjax . t) (variable . "revealjs-url=https://revealjs.com")))) - (defadvice! +org--dont-trigger-save-hooks-a (orig-fn &rest args) + (defadvice! +org--dont-trigger-save-hooks-a (fn &rest args) "Exporting and tangling trigger save hooks; inadvertantly triggering mutating hooks on exported output, like formatters." :around '(org-export-to-file org-babel-tangle) (let (before-save-hook after-save-hook) - (apply orig-fn args))) + (apply fn args))) - (defadvice! +org--fix-async-export-a (orig-fn &rest args) + (defadvice! +org--fix-async-export-a (fn &rest args) :around '(org-export-to-file org-export-as) (let ((old-async-init-file org-export-async-init-file) (org-export-async-init-file (make-temp-file "doom-org-async-export"))) @@ -593,7 +593,7 @@ mutating hooks on exported output, like formatters." nil t) (delete-file load-file-name))) (current-buffer))) - (apply orig-fn args)))) + (apply fn args)))) (defun +org-init-habit-h () @@ -662,14 +662,14 @@ With numerical argument N, show content up to level N." (when (get-buffer-window) (recenter))) - (defadvice! +org--strip-properties-from-outline-a (orig-fn &rest args) + (defadvice! +org--strip-properties-from-outline-a (fn &rest args) "Fix variable height faces in eldoc breadcrumbs." :around #'org-format-outline-path (let ((org-level-faces (cl-loop for face in org-level-faces collect `(:foreground ,(face-foreground face nil t) :weight bold)))) - (apply orig-fn args))) + (apply fn args))) (after! org-eldoc ;; HACK Fix #2972: infinite recursion when eldoc kicks in in 'org' or @@ -710,7 +710,7 @@ can grow up to be fully-fledged org-mode buffers." nil 'local))))) (defvar recentf-exclude) - (defadvice! +org--optimize-backgrounded-agenda-buffers-a (orig-fn file) + (defadvice! +org--optimize-backgrounded-agenda-buffers-a (fn file) "Prevent temporarily opened agenda buffers from polluting recentf." :around #'org-get-agenda-file-buffer (let ((recentf-exclude (list (lambda (_file) t))) @@ -720,18 +720,18 @@ can grow up to be fully-fledged org-mode buffers." vc-handled-backends org-mode-hook find-file-hook) - (funcall orig-fn file))) + (funcall fn file))) ;; HACK With https://code.orgmode.org/bzg/org-mode/commit/48da60f4, inline ;; image previews broke for users with imagemagick support built in. This ;; reverses the problem, but should be removed once it is addressed ;; upstream (if ever). - (defadvice! +org--fix-inline-images-for-imagemagick-users-a (orig-fn &rest args) + (defadvice! +org--fix-inline-images-for-imagemagick-users-a (fn &rest args) :around #'org-display-inline-images (letf! (defun create-image (file-or-data &optional type data-p &rest props) (let ((type (if (plist-get props :width) type))) (apply create-image file-or-data type data-p props))) - (apply orig-fn args))) + (apply fn args))) (defadvice! +org--fix-inconsistent-uuidgen-case-a (uuid) "Ensure uuidgen always produces lowercase output regardless of system." @@ -1023,12 +1023,12 @@ compelling reason, so..." :config (setq toc-org-hrefify-default "gh") - (defadvice! +org-inhibit-scrolling-a (orig-fn &rest args) + (defadvice! +org-inhibit-scrolling-a (fn &rest args) "Prevent the jarring scrolling that occurs when the-ToC is regenerated." :around #'toc-org-insert-toc (let ((p (set-marker (make-marker) (point))) (s (window-start))) - (prog1 (apply orig-fn args) + (prog1 (apply fn args) (goto-char p) (set-window-start nil s t) (set-marker p nil))))) diff --git a/modules/lang/org/contrib/present.el b/modules/lang/org/contrib/present.el index fdf494828..a27df4de3 100644 --- a/modules/lang/org/contrib/present.el +++ b/modules/lang/org/contrib/present.el @@ -45,7 +45,7 @@ headings as titles, and you have more freedom to place them wherever you like.") :n [C-left] #'org-tree-slide-move-previous-tree) (add-hook 'org-tree-slide-mode-hook #'evil-normalize-keymaps)) - (defadvice! +org-present--hide-first-heading-maybe-a (orig-fn &rest args) + (defadvice! +org-present--hide-first-heading-maybe-a (fn &rest args) "Omit the first heading if `+org-present-hide-first-heading' is non-nil." :around #'org-tree-slide--display-tree-with-narrow (letf! (defun org-narrow-to-subtree () @@ -64,4 +64,4 @@ headings as titles, and you have more freedom to place them wherever you like.") (when (and (org-at-heading-p) (not (eobp))) (backward-char 1)) (point))))))) - (apply orig-fn args)))) + (apply fn args)))) diff --git a/modules/lang/org/contrib/roam2.el b/modules/lang/org/contrib/roam2.el index 3e4389ebd..1acdb7774 100644 --- a/modules/lang/org/contrib/roam2.el +++ b/modules/lang/org/contrib/roam2.el @@ -29,14 +29,14 @@ of org-mode to properly utilize ID links.") ;; Don't display warning message dedicated for v1 users. Need to be set early. (setq org-roam-v2-ack t) - (defadvice! +org-roam-suppress-sqlite-build-a (orig-fn &rest args) + (defadvice! +org-roam-suppress-sqlite-build-a (fn &rest args) "Suppress automatic building of sqlite3 binary when loading `org-roam'. This is a blocking operation that can take a while to complete and better be deferred when there will be an actual demand for the database. See `+org-init-roam-h' for the launch process." :around #'emacsql-sqlite-ensure-binary (if (not (boundp 'org-roam-db-version)) - (apply orig-fn args) + (apply fn args) (advice-remove #'emacsql-sqlite-ensure-binary #'+org-roam-suppress-sqlite-build-a) nil)) diff --git a/modules/lang/rest/config.el b/modules/lang/rest/config.el index a4cbcd748..d885adede 100644 --- a/modules/lang/rest/config.el +++ b/modules/lang/rest/config.el @@ -10,12 +10,12 @@ (setq-hook! 'restclient-mode-hook imenu-generic-expression '((nil "^[A-Z]+\s+.+" 0))) - (defadvice! +rest--permit-self-signed-ssl-a (orig-fn &rest args) + (defadvice! +rest--permit-self-signed-ssl-a (fn &rest args) "Forces underlying SSL verification to prompt for self-signed or invalid certs, rather than reject them silently." :around #'restclient-http-do (let (gnutls-verify-error tls-checktrust) - (apply orig-fn args))) + (apply fn args))) (map! :map restclient-mode-map :n [return] #'+rest/dwim-at-point diff --git a/modules/tools/editorconfig/config.el b/modules/tools/editorconfig/config.el index de1b590da..e6d52b3c5 100644 --- a/modules/tools/editorconfig/config.el +++ b/modules/tools/editorconfig/config.el @@ -30,7 +30,7 @@ (add-to-list 'editorconfig-exclude-regexps "\\.\\(zip\\|\\(doc\\|xls\\|ppt\\)x\\)\\'") - (defadvice! +editorconfig--smart-detection-a (orig-fn) + (defadvice! +editorconfig--smart-detection-a (fn) "Retrieve the properties for the current file. If it doesn't have an extension, try to guess one." :around #'editorconfig-call-editorconfig-exec @@ -42,7 +42,7 @@ extension, try to guess one." (if-let (ext (alist-get major-mode +editorconfig-mode-alist)) (concat "." ext) ""))))) - (funcall orig-fn))) + (funcall fn))) (add-hook! 'editorconfig-after-apply-functions (defun +editorconfig-disable-indent-detection-h (props) diff --git a/modules/tools/gist/config.el b/modules/tools/gist/config.el index 4430ab029..cd902c213 100644 --- a/modules/tools/gist/config.el +++ b/modules/tools/gist/config.el @@ -9,9 +9,9 @@ (set-popup-rule! "^\\*gist-" :ignore t) - (defadvice! +gist--open-in-popup-a (orig-fn &rest args) + (defadvice! +gist--open-in-popup-a (fn &rest args) :around #'gist-list-render - (funcall orig-fn (car args) t) + (funcall fn (car args) t) (unless (cadr args) (pop-to-buffer (current-buffer)))) diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index b7e1a0d73..cb795022d 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -151,10 +151,10 @@ Dictionary.app behind the scenes to get definitions.") ;; xref to be one too. (remove-hook 'xref-backend-functions #'etags--xref-backend) ;; ...however, it breaks `projectile-find-tag', unless we put it back. - (defadvice! +lookup--projectile-find-tag-a (orig-fn) + (defadvice! +lookup--projectile-find-tag-a (fn) :around #'projectile-find-tag (let ((xref-backend-functions '(etags--xref-backend t))) - (funcall orig-fn))) + (funcall fn))) ;; This integration is already built into evil (unless (featurep! :editor evil) @@ -170,12 +170,12 @@ Dictionary.app behind the scenes to get definitions.") ;; HACK Fix #4386: `ivy-xref-show-xrefs' calls `fetcher' twice, which has ;; side effects that breaks in some cases (i.e. on `dired-do-find-regexp'). - (defadvice! +lookup--fix-ivy-xrefs (orig-fn fetcher alist) + (defadvice! +lookup--fix-ivy-xrefs (fn fetcher alist) :around #'ivy-xref-show-xrefs (when (functionp fetcher) (setf (alist-get 'fetched-xrefs alist) (funcall fetcher))) - (funcall orig-fn fetcher alist))) + (funcall fn fetcher alist))) (use-package! helm-xref :when (featurep! :completion helm)) diff --git a/modules/tools/lsp/+eglot.el b/modules/tools/lsp/+eglot.el index a941b8222..c97625811 100644 --- a/modules/tools/lsp/+eglot.el +++ b/modules/tools/lsp/+eglot.el @@ -27,7 +27,7 @@ (after! flycheck (load! "autoload/flycheck-eglot"))) - (defadvice! +lsp--defer-server-shutdown-a (orig-fn &optional server) + (defadvice! +lsp--defer-server-shutdown-a (fn &optional server) "Defer server shutdown for a few seconds. This gives the user a chance to open other project files before the server is auto-killed (which is a potentially expensive process). It also prevents the @@ -45,4 +45,4 @@ server getting expensively restarted when reverting buffers." (prog1 (funcall eglot-shutdown server) (+lsp-optimization-mode -1)))) server))) - (funcall orig-fn server)))) + (funcall fn server)))) diff --git a/modules/tools/lsp/+lsp.el b/modules/tools/lsp/+lsp.el index d1a0b98ce..d6e39e4a6 100644 --- a/modules/tools/lsp/+lsp.el +++ b/modules/tools/lsp/+lsp.el @@ -73,14 +73,14 @@ about it (it will be logged to *Messages* however).") :implementations '(lsp-find-implementation :async t) :type-definition #'lsp-find-type-definition) - (defadvice! +lsp--respect-user-defined-checkers-a (orig-fn &rest args) + (defadvice! +lsp--respect-user-defined-checkers-a (fn &rest args) "Ensure user-defined `flycheck-checker' isn't overwritten by `lsp'." :around #'lsp-diagnostics-flycheck-enable (if flycheck-checker (let ((old-checker flycheck-checker)) - (apply orig-fn args) + (apply fn args) (setq-local flycheck-checker old-checker)) - (apply orig-fn args))) + (apply fn args))) (add-hook! 'lsp-mode-hook (defun +lsp-display-guessed-project-root-h () @@ -102,7 +102,7 @@ about it (it will be logged to *Messages* however).") (remq 'company-capf company-backends)))))))) (defvar +lsp--deferred-shutdown-timer nil) - (defadvice! +lsp-defer-server-shutdown-a (orig-fn &optional restart) + (defadvice! +lsp-defer-server-shutdown-a (fn &optional restart) "Defer server shutdown for a few seconds. This gives the user a chance to open other project files before the server is auto-killed (which is a potentially expensive process). It also prevents the @@ -112,7 +112,7 @@ server getting expensively restarted when reverting buffers." restart (null +lsp-defer-shutdown) (= +lsp-defer-shutdown 0)) - (prog1 (funcall orig-fn restart) + (prog1 (funcall fn restart) (+lsp-optimization-mode -1)) (when (timerp +lsp--deferred-shutdown-timer) (cancel-timer +lsp--deferred-shutdown-timer)) @@ -123,11 +123,11 @@ server getting expensively restarted when reverting buffers." (with-lsp-workspace workspace (unless (lsp--workspace-buffers workspace) (let ((lsp-restart 'ignore)) - (funcall orig-fn)) + (funcall fn)) (+lsp-optimization-mode -1)))) lsp--cur-workspace)))) - (defadvice! +lsp-dont-prompt-to-install-servers-maybe-a (orig-fn &rest args) + (defadvice! +lsp-dont-prompt-to-install-servers-maybe-a (fn &rest args) :around #'lsp (when (buffer-file-name) (require 'lsp-mode) @@ -136,7 +136,7 @@ server getting expensively restarted when reverting buffers." (-andfn #'lsp--matching-clients? #'lsp--server-binary-present?)) (not (memq +lsp-prompt-to-install-server '(nil quiet)))) - (apply orig-fn args) + (apply fn args) ;; HACK `lsp--message' overrides `inhibit-message', so use `quiet!' (let ((doom-debug-p (or doom-debug-p @@ -169,12 +169,12 @@ server getting expensively restarted when reverting buffers." (use-package! lsp-ui :hook (lsp-mode . lsp-ui-mode) :init - (defadvice! +lsp--use-hook-instead-a (orig-fn &rest args) + (defadvice! +lsp--use-hook-instead-a (fn &rest args) "Change `lsp--auto-configure' to not force `lsp-ui-mode' on us. Using a hook instead is more sensible." :around #'lsp--auto-configure (letf! ((#'lsp-ui-mode #'ignore)) - (apply orig-fn args))) + (apply fn args))) :config (when (featurep! +peek) diff --git a/modules/tools/pdf/config.el b/modules/tools/pdf/config.el index a4d6f7968..d0a0637af 100644 --- a/modules/tools/pdf/config.el +++ b/modules/tools/pdf/config.el @@ -18,11 +18,11 @@ (add-hook 'kill-buffer-hook #'+pdf-cleanup-windows-h nil t))) :config - (defadvice! +pdf--install-epdfinfo-a (orig-fn &rest args) + (defadvice! +pdf--install-epdfinfo-a (fn &rest args) "Install epdfinfo after the first PDF file, if needed." :around #'pdf-view-mode (if (file-executable-p pdf-info-epdfinfo-program) - (apply orig-fn args) + (apply fn args) ;; If we remain in pdf-view-mode, it'll spit out cryptic errors. This ;; graceful failure is better UX. (fundamental-mode) @@ -74,10 +74,10 @@ nil 'local)))))) ;; Silence "File *.pdf is large (X MiB), really open?" prompts for pdfs - (defadvice! +pdf-suppress-large-file-prompts-a (orig-fn size op-type filename &optional offer-raw) + (defadvice! +pdf-suppress-large-file-prompts-a (fn size op-type filename &optional offer-raw) :around #'abort-if-file-too-large (unless (string-match-p "\\.pdf\\'" filename) - (funcall orig-fn size op-type filename offer-raw)))) + (funcall fn size op-type filename offer-raw)))) (use-package! saveplace-pdf-view diff --git a/modules/tools/prodigy/config.el b/modules/tools/prodigy/config.el index a5dd1a3ee..cb9ae8b01 100644 --- a/modules/tools/prodigy/config.el +++ b/modules/tools/prodigy/config.el @@ -1,12 +1,12 @@ ;;; tools/prodigy/config.el -*- lexical-binding: t; -*- (after! prodigy - (defadvice! +prodigy--add-project-property-a (orig-fn &rest args) + (defadvice! +prodigy--add-project-property-a (fn &rest args) "Adds a new :project property to prodigy services, which hides the service unless invoked from the relevant project." :around #'prodigy-services (let ((project-root (downcase (or (doom-project-root) default-directory))) - (services (apply orig-fn args))) + (services (apply fn args))) (if current-prefix-arg services (cl-remove-if-not (lambda (service) diff --git a/modules/ui/hl-todo/config.el b/modules/ui/hl-todo/config.el index c18819a30..3d010f388 100644 --- a/modules/ui/hl-todo/config.el +++ b/modules/ui/hl-todo/config.el @@ -28,12 +28,12 @@ ("XXX" font-lock-constant-face bold))) - (defadvice! +hl-todo-clamp-font-lock-fontify-region-a (orig-fn &rest args) + (defadvice! +hl-todo-clamp-font-lock-fontify-region-a (fn &rest args) "Fix an `args-out-of-range' error in some modes." :around #'hl-todo-mode (letf! (defun font-lock-fontify-region (beg end &optional loudly) (funcall font-lock-fontify-region (max beg 1) end loudly)) - (apply orig-fn args))) + (apply fn args))) ;; Use a more primitive todo-keyword detection method in major modes that ;; don't use/have a valid syntax table entry for comments. diff --git a/modules/ui/hydra/config.el b/modules/ui/hydra/config.el index 40a870fbe..4cfe56e45 100644 --- a/modules/ui/hydra/config.el +++ b/modules/ui/hydra/config.el @@ -9,7 +9,7 @@ ;;;###package hydra (setq lv-use-separator t) -(defadvice! +hydra--inhibit-window-switch-hooks-a (orig-fn) +(defadvice! +hydra--inhibit-window-switch-hooks-a (fn) :around #'lv-window (let ((doom-inhibit-switch-window-hooks t)) - (funcall orig-fn))) + (funcall fn))) diff --git a/modules/ui/modeline/config.el b/modules/ui/modeline/config.el index c75c9ab89..5797b9e87 100644 --- a/modules/ui/modeline/config.el +++ b/modules/ui/modeline/config.el @@ -41,10 +41,10 @@ :config ;; HACK Fix #4102 due to empty all-the-icons return value (caused by ;; `doom--disable-all-the-icons-in-tty-a' advice) in tty daemon frames. - (defadvice! +modeline-disable-icon-in-daemon-a (orig-fn &rest args) + (defadvice! +modeline-disable-icon-in-daemon-a (fn &rest args) :around #'doom-modeline-propertize-icon (when (display-graphic-p) - (apply orig-fn args))) + (apply fn args))) ;; Fix an issue where these two variables aren't defined in TTY Emacs on MacOS (defvar mouse-wheel-down-event nil) @@ -64,9 +64,9 @@ ;; Some functions modify the buffer, causing the modeline to show a false ;; modified state, so force them to behave. - (defadvice! +modeline--inhibit-modification-hooks-a (orig-fn &rest args) + (defadvice! +modeline--inhibit-modification-hooks-a (fn &rest args) :around #'ws-butler-after-save - (with-silent-modifications (apply orig-fn args))) + (with-silent-modifications (apply fn args))) ;; diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index c2e1af38f..0e26d9446 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -26,14 +26,14 @@ ;; ;;; Core functions -(defadvice! +popup--make-case-sensitive-a (orig-fn &rest args) +(defadvice! +popup--make-case-sensitive-a (fn &rest args) "Make regexps in `display-buffer-alist' case-sensitive. To reduce fewer edge cases and improve performance when `display-buffer-alist' grows larger." :around #'display-buffer-assq-regexp (let (case-fold-search) - (apply orig-fn args))) + (apply fn args))) ;; Don't try to resize popup windows (advice-add #'balance-windows :around #'+popup-save-a) @@ -50,14 +50,14 @@ to this commmand." (+popup/close nil 'force)))) (global-set-key [remap quit-window] #'+popup/quit-window) -(defadvice! +popup-override-display-buffer-alist-a (orig-fn &rest args) +(defadvice! +popup-override-display-buffer-alist-a (fn &rest args) "When `pop-to-buffer' is called with non-nil ACTION, that ACTION should override `display-buffer-alist'." :around #'switch-to-buffer-other-tab :around #'switch-to-buffer-other-window :around #'switch-to-buffer-other-frame (let ((display-buffer-alist nil)) - (apply orig-fn args))) + (apply fn args))) ;; @@ -68,21 +68,21 @@ override `display-buffer-alist'." ;;;###package company -(defadvice! +popup--dont-select-me-a (orig-fn &rest args) +(defadvice! +popup--dont-select-me-a (fn &rest args) :around #'company-show-doc-buffer (let ((+popup--inhibit-select t)) - (apply orig-fn args))) + (apply fn args))) ;;;###package compile -(defadvice! +popup--compilation-goto-locus-a (orig-fn &rest args) +(defadvice! +popup--compilation-goto-locus-a (fn &rest args) "Fix links in popup compilation buffers creating a new window each time they were followed." :around #'compilation-goto-locus (letf! (defun pop-to-buffer (buffer &optional action norecord) (let ((pop-up-windows (not (+popup-buffer-p (current-buffer))))) (funcall pop-to-buffer buffer action norecord))) - (apply orig-fn args))) + (apply fn args))) ;;;###package eshell @@ -213,7 +213,7 @@ the command buffer." (setq helm-default-display-buffer-functions '(+popup-display-buffer-stacked-side-window-fn)) ;; Fix #897: "cannot open side window" error when TAB-completing file links - (defadvice! +popup--helm-hide-org-links-popup-a (orig-fn &rest args) + (defadvice! +popup--helm-hide-org-links-popup-a (fn &rest args) :around #'org-insert-link (letf! ((defun org-completing-read (&rest args) (when-let (win (get-buffer-window "*Org Links*")) @@ -227,7 +227,7 @@ the command buffer." ;; ...but it must exist for org to clean up later. (get-buffer-create "*Org Links*")) (apply org-completing-read args))) - (apply #'funcall-interactively orig-fn args))) + (apply #'funcall-interactively fn args))) ;; Fix left-over popup window when closing persistent help for `helm-M-x' (defadvice! +popup--helm-elisp--persistent-help-a (candidate _fun &optional _name) @@ -248,24 +248,24 @@ the command buffer." ;;;###package org (after! org - ;; Org has a scorched-earth window management policy I'm not fond of. i.e. it - ;; kills all other windows just so it can monopolize the frame. No thanks. We - ;; can do better. - (defadvice! +popup--suppress-delete-other-windows-a (orig-fn &rest args) - :around '(org-add-log-note - org-capture-place-template - org-export--dispatch-ui - org-agenda-get-restriction-and-command - org-goto-location - org-fast-tag-selection - org-fast-todo-selection) + (defadvice! +popup--suppress-delete-other-windows-a (fn &rest args) + "Org has a scorched-earth window management policy I'm not fond of. i.e. it +kills all other windows just so it can monopolize the frame. No thanks. We can +do better." + :around #'org-add-log-note + :around #'org-capture-place-template + :around #'org-export--dispatch-ui + :around #'org-agenda-get-restriction-and-command + :around #'org-goto-location + :around #'org-fast-tag-selection + :around #'org-fast-todo-selection (if +popup-mode (letf! ((#'delete-other-windows #'ignore) (#'delete-window #'ignore)) - (apply orig-fn args)) - (apply orig-fn args))) + (apply fn args)) + (apply fn args))) - (defadvice! +popup--org-fix-goto-a (orig-fn &rest args) + (defadvice! +popup--org-fix-goto-a (fn &rest args) "`org-goto' uses `with-output-to-temp-buffer' to display its help buffer, for some reason, which is very unconventional, and so requires these gymnastics to tame (i.e. to get the popup manager to handle it)." @@ -277,10 +277,10 @@ to tame (i.e. to get the popup manager to handle it)." (with-current-buffer buffer (+popup-buffer-mode +1)) (funcall internal-temp-output-buffer-show buffer))) - (apply orig-fn args)) - (apply orig-fn args))) + (apply fn args)) + (apply fn args))) - (defadvice! +popup--org-fix-popup-window-shrinking-a (orig-fn &rest args) + (defadvice! +popup--org-fix-popup-window-shrinking-a (fn &rest args) "Hides the mode-line in *Org tags* buffer so you can actually see its content and displays it in a side window without deleting all other windows. Ugh, such an ugly hack." @@ -299,32 +299,32 @@ Ugh, such an ugly hack." (when (> (window-buffer-height window) (window-height window)) (fit-window-to-buffer window (window-buffer-height window))))) - (apply orig-fn args)) - (apply orig-fn args))) + (apply fn args)) + (apply fn args))) - (defadvice! +popup--org-edit-src-exit-a (orig-fn &rest args) + (defadvice! +popup--org-edit-src-exit-a (fn &rest args) "If you switch workspaces or the src window is recreated..." :around #'org-edit-src-exit (let* ((window (selected-window)) (popup-p (+popup-window-p window))) - (prog1 (apply orig-fn args) + (prog1 (apply fn args) (when (and popup-p (window-live-p window)) (delete-window window))))) ;; Ensure todo, agenda, and other minor popups are delegated to the popup system. - (defadvice! +popup--org-pop-to-buffer-a (orig-fn buf &optional norecord) + (defadvice! +popup--org-pop-to-buffer-a (fn buf &optional norecord) "Use `pop-to-buffer' instead of `switch-to-buffer' to open buffer.'" :around #'org-switch-to-buffer-other-window (if +popup-mode (pop-to-buffer buf nil norecord) - (funcall orig-fn buf norecord)))) + (funcall fn buf norecord)))) ;;;###package org-journal -(defadvice! +popup--use-popup-window-a (orig-fn &rest args) +(defadvice! +popup--use-popup-window-a (fn &rest args) :around #'org-journal-search-by-string (letf! ((#'switch-to-buffer #'pop-to-buffer)) - (apply orig-fn args))) + (apply fn args))) ;;;###package persp-mode @@ -352,10 +352,10 @@ Ugh, such an ugly hack." ;;;###package profiler -(defadvice! +popup--profiler-report-find-entry-in-other-window-a (orig-fn function) +(defadvice! +popup--profiler-report-find-entry-in-other-window-a (fn function) :around #'profiler-report-find-entry (letf! ((#'find-function #'find-function-other-window)) - (funcall orig-fn function))) + (funcall fn function))) ;;;###package wgrep @@ -384,11 +384,11 @@ Ugh, such an ugly hack." ;;;###package windmove ;; Users should be able to hop into popups easily, but Elisp shouldn't. -(defadvice! +popup--ignore-window-parameters-a (orig-fn &rest args) +(defadvice! +popup--ignore-window-parameters-a (fn &rest args) "Allow *interactive* window moving commands to traverse popups." :around '(windmove-up windmove-down windmove-left windmove-right) (letf! (defun windmove-find-other-window (dir &optional arg window) (window-in-direction (pcase dir (`up 'above) (`down 'below) (_ dir)) window (bound-and-true-p +popup-mode) arg windmove-wrap-around t)) - (apply orig-fn args))) + (apply fn args))) diff --git a/modules/ui/popup/autoload/popup.el b/modules/ui/popup/autoload/popup.el index 3b62c396b..51e944ba2 100644 --- a/modules/ui/popup/autoload/popup.el +++ b/modules/ui/popup/autoload/popup.el @@ -464,10 +464,10 @@ window and return that window." (+popup/close nil t)) ;;;###autoload -(defun +popup-save-a (orig-fn &rest args) +(defun +popup-save-a (fn &rest args) "Sets aside all popups before executing the original function, usually to prevent the popup(s) from messing up the UI (or vice versa)." - (save-popups! (apply orig-fn args))) + (save-popups! (apply fn args))) ;;;###autoload (defun +popup-display-buffer-fullframe-fn (buffer alist) diff --git a/modules/ui/treemacs/config.el b/modules/ui/treemacs/config.el index 198aeaf26..9a095e9dc 100644 --- a/modules/ui/treemacs/config.el +++ b/modules/ui/treemacs/config.el @@ -27,12 +27,12 @@ This must be set before `treemacs' has loaded.") treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist")) :config ;; ...but not from treemacs-visit-node-ace-* commands. - (defadvice! +treemacs--ace-window-ignore-treemacs-buffer-a (orig-fn &rest args) + (defadvice! +treemacs--ace-window-ignore-treemacs-buffer-a (fn &rest args) :around '(treemacs-visit-node-ace treemacs-visit-node-ace-horizontal-split treemacs-visit-node-ace-vertical-split) (let ((aw-ignored-buffers (cons 'treemacs-mode aw-ignored-buffers))) - (apply orig-fn args))) + (apply fn args))) ;; Don't follow the cursor (treemacs-follow-mode -1) diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index c9407e1e3..e59611ae3 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -577,8 +577,8 @@ This be hooked to `projectile-after-switch-project-hook'." ;;; Advice ;;;###autoload -(defun +workspaces-autosave-real-buffers-a (orig-fn &rest args) +(defun +workspaces-autosave-real-buffers-a (fn &rest args) "Don't autosave if no real buffers are open." (when (doom-real-buffer-list) - (apply orig-fn args)) + (apply fn args)) t)