[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 856cb548c3 123/225: Define per-action duratio
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 856cb548c3 123/225: Define per-action durations |
Date: |
Wed, 12 Jan 2022 08:59:01 -0500 (EST) |
branch: elpa/evil-goggles
commit 856cb548c367a69dfb574c178dbb4d8d3b9d39a6
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Define per-action durations
---
evil-goggles.el | 80 ++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 53 insertions(+), 27 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index cdd2775b43..bf8a99da33 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -205,14 +205,14 @@ so this package can work with Emacs 24"
(evil-goggles--funcall-interactively ,fun ,@args)
(funcall ,fun ,@args)))
-(defmacro evil-goggles--define-switch-and-face (switch-name switch-doc
face-name face-doc)
+(defmacro evil-goggles--define-switch-face-duration (switch-name switch-doc
face-name face-doc dur-name dur-value dur-doc)
"Syntax sugar for defining a custom on/off variable and a custom face.
SWITCH-NAME is the name of the on/off variable.
SWITCH-DOC is the docstring for SWITCH-NAME.
FACE-NAME is the name of the custom face.
FACE-DOC is the docstring for FACE-NAME."
- (declare (indent 4) (debug t))
+ (declare (indent 7) (debug t))
`(progn
(defcustom ,switch-name t
,(concat switch-doc "\nThis variable must be set before
`evil-goggles-mode' is enabled")
@@ -221,7 +221,11 @@ FACE-DOC is the docstring for FACE-NAME."
(defface ,face-name
'((t (:inherit evil-goggles-default-face)))
,face-doc
- :group 'evil-goggles-faces)))
+ :group 'evil-goggles-faces)
+ (defcustom ,dur-name ,dur-value
+ ,(concat dur-doc "\nThis variable must be set before
`evil-goggles-mode' is enabled")
+ :type 'number
+ :group 'evil-goggles)))
;;; core ends here ;;;
@@ -251,9 +255,10 @@ FACE-DOC is the docstring for FACE-NAME."
;; delete
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-delete "If non-nil, enable delete support"
- evil-goggles-delete-face "Face for delete action")
+ evil-goggles-delete-face "Face for delete action"
+ evil-goggles-delete-duration evil-goggles-duration "Duration of hint when
deleting")
(defun evil-goggles--evil-delete-advice (orig-fun beg end &optional type
register yank-handler)
"Around-advice for function `evil-delete`.
@@ -265,9 +270,10 @@ BEG END &OPTIONAL TYPE REGISTER YANK-HANDLER are the
arguments of the original f
;; indent
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-indent "If non-nil, enable indent support"
- evil-goggles-indent-face "Face for indent action")
+ evil-goggles-indent-face "Face for indent action"
+ evil-goggles-indent-duration evil-goggles-duration "Duration of hint when
indenting")
(defun evil-goggles--evil-indent-advice (orig-fun beg end)
"Around-advice for function `evil-indent'.
@@ -279,9 +285,10 @@ BEG END are the arguments of the original function."
;; yank
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-yank "If non-nil, enable yank support"
- evil-goggles-yank-face "Face for yank action")
+ evil-goggles-yank-face "Face for yank action"
+ evil-goggles-yank-duration evil-goggles-duration "Duration of hint when
yankig")
(defun evil-goggles--evil-yank-advice (orig-fun beg end &optional type
register yank-handler)
"Around-advice for function `evil-yank'.
@@ -303,6 +310,16 @@ This variable must be set before `evil-goggles-mode' is
enabled"
This variable must be set before `evil-goggles-mode' is enabled"
:type 'boolean :group 'evil-goggles)
+(defcustom evil-goggles-undo-redo-add-duration evil-goggles-duration "Duration
of hint on undo/redo adding
+This variable must be set before `evil-goggles-mode' is enabled" :type 'number
:group 'evil-goggles)
+
+(defcustom evil-goggles-undo-redo-remove-duration evil-goggles-duration
"Duration of hint on undo/redo removing
+This variable must be set before `evil-goggles-mode' is enabled" :type 'number
:group 'evil-goggles)
+
+(defcustom evil-goggles-undo-redo-change-duration evil-goggles-duration
"Duration of hint on undo/redo changing
+This variable must be set before `evil-goggles-mode' is enabled" :type 'number
:group 'evil-goggles)
+
+This variable must be set before `evil-goggles-mode' is enabled" :type
'boolean :group 'evil-goggles)
(defface evil-goggles-undo-redo-add-face
'((t
(:inherit evil-goggles-default-face)))
@@ -418,9 +435,10 @@ Return a list: either ('text-added beg end) or
('text-removed beg end)"
;; join
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-join "If non-nil, enable join support"
- evil-goggles-join-face "Face for join action")
+ evil-goggles-join-face "Face for join action"
+ evil-goggles-join-duration evil-goggles-duration "Duration of hint when
joining")
(defun evil-goggles--evil-join-advice (orig-fun beg end)
"Around-advice for function `evil-join'.
@@ -437,9 +455,10 @@ BEG END are the arguments of the original function."
;; reformat (fill and move)
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-fill-and-move "If non-nil, enable fill and move
(reformat) support"
- evil-goggles-fill-and-move-face "Face for fill and move (reformat) action")
+ evil-goggles-fill-and-move-face "Face for fill and move (reformat) action"
+ evil-goggles-fill-and-move-duration evil-goggles-duration "Duration of
hint when reformating")
(defun evil-goggles--evil-fill-and-move-advice (orig-fun beg end)
"Around-advice for function `evil-fill-and-move'.
@@ -451,9 +470,10 @@ BEG END are arguments of the original function."
;; paste before and after
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-paste "If non-nil, enable paste support"
- evil-goggles-paste-face "Face for paste action")
+ evil-goggles-paste-face "Face for paste action"
+ evil-goggles-paste-duration evil-goggles-duration "Duration of hint when
pasting")
(defun evil-goggles--evil-paste-after-advice (orig-fun count &optional
register yank-handler)
"Around-advice for function `evil-paste-after'.
@@ -509,9 +529,10 @@ Argument YANK-HANDLER is the yank hanler."
;; shift left & right
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-shift "If non-nil, enable shift left/right support"
- evil-goggles-shift-face "Face for paste action")
+ evil-goggles-shift-face "Face for paste action"
+ evil-goggles-shift-duration evil-goggles-duration "Duration of hint when
shifting")
(defun evil-goggles--evil-shift-advice (orig-fun beg end &optional count
preserve-empty)
"Around-advice for function `evil-shift-left` and `evil-shift-right`.
@@ -523,9 +544,10 @@ BEG END &OPTIONAL COUNT PRESERVE-EMPTY are the arguments
of the original functio
;; set mark
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-set-marker "If non-nil, enable set mark support"
- evil-goggles-set-marker-face "Face for set mark action")
+ evil-goggles-set-marker-face "Face for set mark action"
+ evil-goggles-set-marker-duration evil-goggles-duration "Duration of hint
when setting mark")
(defun evil-goggles--evil-set-marker-advice (orig-fun char &optional pos
advance)
"Around-advice for function `evil-set-marker`.
@@ -559,9 +581,10 @@ BEG END PATTERN COMMAND &OPTIONAL INVERT are the arguments
of the original funct
;; surround
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-surround "If non-nil, enable surround support"
- evil-goggles-surround-face "Face for surround action")
+ evil-goggles-surround-face "Face for surround action"
+ evil-goggles-surround-duration evil-goggles-duration "Duration of hint
when surrounding")
(defun evil-goggles--evil-surround-region-advice (orig-fun beg end &optional
type char force-new-line)
"Around-advice for function `evil-surround-region'.
@@ -573,9 +596,10 @@ BEG END &OPTIONAL TYPE CHAR FORCE-NEW-LINE are the
arguments of the original fun
;; commentary
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-commentary "If non-nil, enable commentary support"
- evil-goggles-commentary-face "Face for commentary action")
+ evil-goggles-commentary-face "Face for commentary action"
+ evil-goggles-commentary-duration evil-goggles-duration "Duration when
using commentary")
(defun evil-goggles--evil-commentary-advice (orig-fun beg end &optional type)
"Around-advice for function `evil-commentary'.
@@ -587,9 +611,10 @@ BEG END &OPTIONAL TYPE are the arguments of the original
function."
;; nerd-commenter
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-nerd-commenter "If non-nil, enable nerd-commenter
support"
- evil-goggles-nerd-commenter-face "Face for nerd-commenter action")
+ evil-goggles-nerd-commenter-face "Face for nerd-commenter action"
+ evil-goggles-nerd-commenter-duration evil-goggles-duration "Duration when
using nerd-commenter")
(defun evil-goggles--evil-nerd-commenter-advice (orig-fun beg end &optional
type)
"Around-advice for function `evilnc-comment-operator'.
@@ -601,9 +626,10 @@ BEG END &OPTIONAL TYPE are the arguments of the original
function."
;; replace with register
-(evil-goggles--define-switch-and-face
+(evil-goggles--define-switch-face-duration
evil-goggles-enable-replace-with-register "If non-nil, enable replace with
register support"
- evil-goggles-replace-with-register-face "Face for replace with register
action")
+ evil-goggles-replace-with-register-face "Face for replace with register
action"
+ evil-goggles-replace-with-register-duration evil-goggles-duration
"Duration when using replace-with-register")
(defun evil-goggles--evil-replace-with-register-advice (orig-fun count beg
&optional end type register)
"Around-advice for function `evil-replace-with-register'.
- [nongnu] elpa/evil-goggles bb49e3a001 078/225: Make travis catch compilation warnings, (continued)
- [nongnu] elpa/evil-goggles bb49e3a001 078/225: Make travis catch compilation warnings, ELPA Syncer, 2022/01/12
- [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 <=
- [nongnu] elpa/evil-goggles 8b3889332c 126/225: Use new funcs/macros which support duration per operation, ELPA Syncer, 2022/01/12
- [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