[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 42456816de 015/225: Use macros to preserve "i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 42456816de 015/225: Use macros to preserve "interactivity" |
Date: |
Wed, 12 Jan 2022 08:58:38 -0500 (EST) |
branch: elpa/evil-goggles
commit 42456816def77e0c6c9fea1b995b96097946624d
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Use macros to preserve "interactivity"
---
evil-goggles.el | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index 5636c7bf8e..52062907b2 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -93,10 +93,22 @@
(funcall-interactively orig-fun beg end type register yank-handler))
(funcall-interactively orig-fun beg end type register yank-handler)))
-(defun evil-goggles--evil-indent-advice (orig-fun &rest args)
- (let ((beg (nth 0 args))
- (end (nth 1 args)))
- (evil-goggles--generic-advice beg end orig-fun args (evil-goggles--face
'evil-indent))))
+(defun evil-goggles--evil-indent-advice (orig-fun beg end)
+ (evil-goggles--with-goggles beg end 'evil-indent
+ (evil-goggles--funcall-preserve-interactive orig-fun beg end)))
+
+(defmacro evil-goggles--with-goggles (beg end adviced-fun &rest body)
+ (declare (indent defun) (debug t))
+ `(if (evil-goggles--show-p ,beg ,end)
+ (let* ((evil-goggles--on t))
+ (evil-goggles--show ,beg ,end (evil-goggles--face ,adviced-fun))
+ (progn ,@body))
+ (progn ,@body)))
+
+(defmacro evil-goggles--funcall-preserve-interactive (orig-fun &rest args)
+ `(if (called-interactively-p 'any)
+ (funcall-interactively ,orig-fun ,@args)
+ (funcall ,orig-fun ,@args)))
(defun evil-goggles--evil-yank-advice (orig-fun &rest args)
(let ((beg (nth 0 args))
- [nongnu] elpa/evil-goggles 5db6848df8 154/225: Undo adds should show a blocking hint, (continued)
- [nongnu] elpa/evil-goggles 5db6848df8 154/225: Undo adds should show a blocking hint, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 440324a1ed 161/225: Silence compilation warning for unused lexical variable, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3dce5937ac 166/225: Pulsing is no longer experimental, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4d4465fd59 168/225: Improve logic deciding whether to pulse or not, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3b874c7630 178/225: Set mark advice: show hint on whitespace-only lines, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ca18c944ed 179/225: Show hint on start/stop record macro, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 943382b367 194/225: Add hints for surround, commentary, nerd commenter, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 04d66ddc20 201/225: Add hint for `q`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles b896ca797c 211/225: Add support for evil-org. Close #21, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 2186289a01 213/225: evil-goggles--show-p: no need to check evil-inhibit-operator-value, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 42456816de 015/225: Use macros to preserve "interactivity",
ELPA Syncer <=
- [nongnu] elpa/evil-goggles dd76fd3d28 019/225: Make sure the overlay is cleaned-up, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 1014993453 028/225: Add custom variable evil-goggles-blacklist to allow disabling individual functions, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f29820fe98 029/225: Detect only `evil-inhibit-operator-value` into account, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 9882706667 030/225: Preserve the return value of evil-paste-*, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 253613ce66 039/225: Fix check of evil-last-paste, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 788c73d505 041/225: Make lighter configurable, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 97498ef1ba 050/225: Clarify package should be on Melpa, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles bf6f836609 056/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 10512f5b3b 054/225: Check evil-mode is on with bound-and-true-p, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ae77a5c6f0 067/225: Replace the boilerplate in evil-goggles-faces.el with a macro, ELPA Syncer, 2022/01/12