[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 219d93e125 118/225: Add support for displayin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 219d93e125 118/225: Add support for displaying the hint after the operation |
Date: |
Wed, 12 Jan 2022 08:59:01 -0500 (EST) |
branch: elpa/evil-goggles
commit 219d93e125fa838e66fb7586963f8597e60a0a87
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Add support for displaying the hint after the operation
---
evil-goggles.el | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index 9b916476da..d28e432d43 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -156,16 +156,41 @@ overlay must not be displayed.")
"Show goggles overlay from BEG to END if the conditions are met.
OVERLAY-FACE is the face to use for the overlay.
-The goggles overlay will be displayed briefly before BODY is executed.
+The goggles overlay will be displayed before BODY is executed.
BODY will be executed but an overlay will not be allowed to be
displayed while its running."
(declare (indent defun) (debug t))
`(if (evil-goggles--show-p ,beg ,end)
- (let* ((evil-goggles--on t))
+ (let ((evil-goggles--on t))
(evil-goggles--show ,beg ,end ,overlay-face)
,@body)
,@body))
+(defmacro evil-goggles--with-after-goggles (beg end overlay-face &rest body)
+ "Add an overlay from BEG to END, make it visible with OVERLAY-FACE after
BODY."
+ (declare (indent defun) (debug t))
+ `(if (evil-goggles--show-p ,beg ,end)
+ (let ((evil-goggles--on t)
+ (ov (evil-goggles--make-overlay ,beg ,end 'insert-behind-hooks
'(evil-goggles--overlay-insert-behind-hook)))
+ (bg (evil-goggles--face-background ,overlay-face)))
+ (unwind-protect
+ (progn
+ (if evil-goggles-pulse
+ (evil-goggles--pulse-overlay ov bg) ;; pulse the overlay
+ (overlay-put ov 'face ,overlay-face)) ;; just put the face on
the overlay
+ ,@body
+ (sit-for evil-goggles-duration))
+ (delete-overlay ov)))
+ ,@body))
+
+(defun evil-goggles--overlay-insert-behind-hook (o afterp beg end &optional
len)
+ (when afterp
+ (if (zerop len)
+ (progn
+ (setq len (- end beg))
+ (move-overlay o (overlay-start o) (+ len (overlay-end o))))
+ (move-overlay o (overlay-start o) (- (overlay-end o) len) ))))
+
(defun evil-goggles--funcall-interactively (f &rest args)
"Call F with ARGS interactively.
- [nongnu] elpa/evil-goggles ef1cad8f3a 064/225: Re-add paste and fill-and-move, (continued)
- [nongnu] elpa/evil-goggles ef1cad8f3a 064/225: Re-add paste and fill-and-move, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 179c3002f2 071/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 904fc39728 072/225: Add doc for evil-goggles-use-diff-faces, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles e65aa39749 083/225: Add support for block paste, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 685e3714a5 090/225: Handle a specific u/redo case when the list has 2 connecting items, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 1e9ebe5e4c 095/225: Extend support for u/redo after some text is changed., ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 221a5ed8ea 098/225: Add support for Emacs 24 by not relying on funcall-interactively, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles aaa93841f9 103/225: Update evil-goggles.el, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f79c03ba62 108/225: Experimental: add support for pulsing, new option`evil-goggles-pulse', ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 9fa3d448ca 112/225: Update "Recent Significant Changes" section in README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 219d93e125 118/225: Add support for displaying the hint after the operation,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles c5c49d7965 127/225: Use different duration for before/after hints, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 5c313522cf 128/225: Don't call deprecated functions, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 03cb67fc4c 125/225: Remove duplicated line, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 70ed667698 131/225: Fix compile warnings, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ea0102bcf5 133/225: Use "post" hint when commenting, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3f6dd85657 151/225: Update README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 5bd77428e3 142/225: Cleanup internal API for showing a vertical hint once, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles c515477fd4 160/225: Clarify docs for evil-goggles-async-duration and evil-goggles-blocking-duration, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 674a1be5aa 188/225: Merge branch 'hint-only-when-command-is-interactive'. Close #18, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 946598059f 204/225: Fix compilation warnings, ELPA Syncer, 2022/01/12