Introduce letf! convenience macro
A more succinct cl-letf, which allows for local functions and macros.
This commit is contained in:
parent
c3a84f0fbf
commit
d12752324a
12 changed files with 113 additions and 115 deletions
|
@ -123,8 +123,7 @@ more information on modifiers."
|
|||
(not (eq this-command 'evil-open-below))
|
||||
(evil-insert-state-p))
|
||||
(funcall orig-fn count)
|
||||
(cl-letf (((symbol-function 'evil-insert-newline-below)
|
||||
(lambda () (+evil--insert-newline))))
|
||||
(letf! (defun evil-insert-newline-below () (+evil--insert-newline))
|
||||
(let ((evil-auto-indent evil-auto-indent))
|
||||
(funcall orig-fn count)))))
|
||||
|
||||
|
@ -134,8 +133,7 @@ more information on modifiers."
|
|||
(not (eq this-command 'evil-open-above))
|
||||
(evil-insert-state-p))
|
||||
(funcall orig-fn count)
|
||||
(cl-letf (((symbol-function 'evil-insert-newline-above)
|
||||
(lambda () (+evil--insert-newline 'above))))
|
||||
(letf! (defun evil-insert-newline-above () (+evil--insert-newline 'above))
|
||||
(let ((evil-auto-indent evil-auto-indent))
|
||||
(funcall orig-fn count)))))
|
||||
|
||||
|
|
|
@ -102,6 +102,6 @@
|
|||
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)
|
||||
(cl-letf (((symbol-function #'yas-global-mode) #'yas-minor-mode)
|
||||
(yas-global-mode yas-minor-mode))
|
||||
(letf! ((#'yas-global-mode #'yas-minor-mode)
|
||||
(yas-global-mode yas-minor-mode))
|
||||
(apply orig-fn args))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue