refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an :around advice.
This commit is contained in:
parent
12732be155
commit
06392a723f
51 changed files with 223 additions and 229 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue