[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 8b3889332c 126/225: Use new funcs/macros whic
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 8b3889332c 126/225: Use new funcs/macros which support duration per operation |
Date: |
Wed, 12 Jan 2022 08:59:02 -0500 (EST) |
branch: elpa/evil-goggles
commit 8b3889332cb93fd5d98e062c5b3faa64ea58bedc
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Use new funcs/macros which support duration per operation
---
evil-goggles.el | 46 ++++++++++++++++++++++++++++------------------
1 file changed, 28 insertions(+), 18 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index d93d5437e2..6646a6874b 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -40,7 +40,18 @@
(require 'cl-lib)
(defcustom evil-goggles-duration 0.200
- "Time if floating seconds that the goggles overlay should last."
+ "Time in floating seconds that the goggles overlay should last.
+
+This affects the hints which are displayed before the operation, such
+as when deleting. "
+ :type 'number
+ :group 'evil-goggles)
+
+;; TODO better name
+(defcustom evil-goggles-duration2 0.800
+ "Time in floating seconds that the goggles overlay should last.
+
+This affects the hints which are displayed before the operation"
:type 'number
:group 'evil-goggles)
@@ -332,7 +343,7 @@ FACE-DOC is the docstring for FACE-NAME."
ORIG-FUN is the original function.
BEG END &OPTIONAL TYPE REGISTER YANK-HANDLER are the arguments of the original
function."
- (evil-goggles--with-goggles beg end 'evil-goggles-delete-face
+ (evil-goggles--with-before-goggles2 beg end 'evil-goggles-delete-face
evil-goggles-delete-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end type register
yank-handler)))
;; indent
@@ -347,7 +358,7 @@ BEG END &OPTIONAL TYPE REGISTER YANK-HANDLER are the
arguments of the original f
ORIG-FUN is the original function.
BEG END are the arguments of the original function."
- (evil-goggles--with-after-goggles beg end 'evil-goggles-indent-face
+ (evil-goggles--with-after-goggles2 beg end 'evil-goggles-indent-face
evil-goggles-indent-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end)))
;; yank
@@ -362,7 +373,7 @@ BEG END are the arguments of the original function."
ORIG-FUN is the original function.
BEG END &OPTIONAL TYPE REGISTER YANK-HANDLER are the arguments of the original
function."
- (evil-goggles--with-goggles beg end 'evil-goggles-yank-face
+ (evil-goggles--with-after-goggles2 beg end 'evil-goggles-yank-face
evil-goggles-yank-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end type register
yank-handler)))
;; undo & redo
@@ -515,7 +526,7 @@ BEG END are the arguments of the original function."
(end-line (line-number-at-pos end))
(line-count (- end-line beg-line)))
(if (> line-count 1) ;; don't show goggles for single lines ("J"/"gJ"
without count)
- (evil-goggles--with-goggles beg end 'evil-goggles-join-face
+ (evil-goggles--with-before-goggles2 beg end 'evil-goggles-join-face
evil-goggles-join-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end))
(evil-goggles--funcall-preserve-interactive orig-fun beg end))))
@@ -531,7 +542,7 @@ BEG END are the arguments of the original function."
ORIG-FUN is the original function.
BEG END are arguments of the original function."
- (evil-goggles--with-after-goggles beg end 'evil-goggles-fill-and-move-face
+ (evil-goggles--with-after-goggles2 beg end 'evil-goggles-fill-and-move-face
evil-goggles-fill-and-move-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end)))
;; paste before and after
@@ -573,11 +584,10 @@ Argument YANK-HANDLER is the yank hanler."
(let* ((beg (save-excursion (evil-goto-mark ?\[) (point)))
(end (save-excursion (evil-goto-mark ?\]) (point)))
(is-beg-at-eol (save-excursion (goto-char beg) (eolp)))
- (beg-corrected (if is-beg-at-eol (1+ beg) beg))
- (show-fn (if (evil-goggles--evil-paste-block-p register
yank-handler)
- 'evil-goggles--show-block
- 'evil-goggles--show)))
- (funcall show-fn beg-corrected end 'evil-goggles-paste-face))))
+ (beg-corrected (if is-beg-at-eol (1+ beg) beg)))
+ (if (evil-goggles--evil-paste-block-p register yank-handler)
+ (evil-goggles--show-block-overlay beg-corrected end
'evil-goggles-paste-face evil-goggles-paste-duration)
+ (evil-goggles--show-overlay beg-corrected end 'evil-goggles-paste-face
evil-goggles-paste-duration)))))
(defun evil-goggles--evil-paste-block-p (register yank-handler)
"Return t if the paste was a vertical block.
@@ -605,7 +615,7 @@ Argument YANK-HANDLER is the yank hanler."
ORIG-FUN is the original function.
BEG END &OPTIONAL COUNT PRESERVE-EMPTY are the arguments of the original
function."
- (evil-goggles--with-after-goggles beg end 'evil-goggles-shift-face
+ (evil-goggles--with-after-goggles2 beg end 'evil-goggles-shift-face
evil-goggles-shift-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end count
preserve-empty)))
;; set mark
@@ -633,7 +643,7 @@ CHAR POS ADVANCE are the arguments of the original
function."
(end (1+ (save-excursion
(move-end-of-line nil)
(point)))))
- (evil-goggles--show beg end 'evil-goggles-set-marker-face)))))
+ (evil-goggles--show-overlay beg end 'evil-goggles-set-marker-face
evil-goggles-set-marker-duration)))))
;; ex global
@@ -642,7 +652,7 @@ CHAR POS ADVANCE are the arguments of the original
function."
ORIG-FUN is the original function.
BEG END PATTERN COMMAND &OPTIONAL INVERT are the arguments of the original
function."
- (let* ((evil-goggles--on t)) ;; set to `t' to prevent showing the overlay
+ (evil-goggles--with-no-hint
(evil-goggles--funcall-preserve-interactive orig-fun beg end pattern
command invert)))
;; surround
@@ -657,7 +667,7 @@ BEG END PATTERN COMMAND &OPTIONAL INVERT are the arguments
of the original funct
ORIG-FUN is the original function.
BEG END &OPTIONAL TYPE CHAR FORCE-NEW-LINE are the arguments of the original
function."
- (evil-goggles--with-goggles beg end 'evil-goggles-surround-face
+ (evil-goggles--with-before-goggles2 beg end 'evil-goggles-surround-face
evil-goggles-surround-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end type char
force-new-line)))
;; commentary
@@ -672,7 +682,7 @@ BEG END &OPTIONAL TYPE CHAR FORCE-NEW-LINE are the
arguments of the original fun
ORIG-FUN is the original function.
BEG END &OPTIONAL TYPE are the arguments of the original function."
- (evil-goggles--with-goggles beg end 'evil-goggles-commentary-face
+ (evil-goggles--with-before-goggles2 beg end 'evil-goggles-commentary-face
evil-goggles-commentary-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end type)))
;; nerd-commenter
@@ -687,7 +697,7 @@ BEG END &OPTIONAL TYPE are the arguments of the original
function."
ORIG-FUN is the original function.
BEG END &OPTIONAL TYPE are the arguments of the original function."
- (evil-goggles--with-goggles beg end 'evil-goggles-nerd-commenter-face
+ (evil-goggles--with-before-goggles2 beg end
'evil-goggles-nerd-commenter-face evil-goggles-nerd-commenter-duration
(evil-goggles--funcall-preserve-interactive orig-fun beg end type)))
;; replace with register
@@ -702,7 +712,7 @@ BEG END &OPTIONAL TYPE are the arguments of the original
function."
ORIG-FUN is the original function.
COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of the original
function."
- (evil-goggles--with-after-goggles beg end 'evil-goggles-nerd-commenter-face
+ (evil-goggles--with-after-goggles2 beg end 'evil-goggles-nerd-commenter-face
evil-goggles-replace-with-register-duration
(evil-goggles--funcall-preserve-interactive orig-fun count beg end type
register)))
;;; mode defined below ;;;
- [nongnu] elpa/evil-goggles 5b9a3af1af 080/225: Make pasting from a register show the goggles overlay, (continued)
- [nongnu] elpa/evil-goggles 5b9a3af1af 080/225: Make pasting from a register show the goggles overlay, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3d71c2c24c 081/225: Add support for evil-set-marker, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 2b7331aa62 082/225: Make checkdoc happy, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 7aaddd2d84 092/225: Use `evil-test-helpers` for testing, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 8738d28e48 091/225: Improve doc, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 02d649ccde 101/225: Enable undo/redo by default, it's no longer experimental, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 1ffd97d6b8 102/225: add support for evil-nerd-commenter, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 33ea1247a7 109/225: Add helper to make evil-goggles use magit-diff-* faces, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles e14b865d80 114/225: Don't ignore foreground color when not pulsing. Fix #16, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 856cb548c3 123/225: Define per-action durations, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 8b3889332c 126/225: Use new funcs/macros which support duration per operation,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles 90da624f36 115/225: Improve docs, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 92d614e731 119/225: Display the hint after indenting and "replacing with register" #7, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles c7e3f6ff17 116/225: Remove incorrectly commited snippet, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4777cd7849 121/225: Show hint after indenting, not before #7, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 287491d0a0 124/225: Add WIP support for per-action durations, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f5e98355f4 135/225: Use one function for `evil-paste-after` and `evil-paste-before` advices, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d705bef9d4 134/225: Fix CI failing, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f6519214b8 149/225: Update README.md, ELPA Syncer, 2022/01/12
- [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