[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 8d6fc41234 023/225: Doc strings
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 8d6fc41234 023/225: Doc strings |
Date: |
Wed, 12 Jan 2022 08:58:39 -0500 (EST) |
branch: elpa/evil-goggles
commit 8d6fc412347c2ba0e9ca5204b9a6efd7606d6f9e
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Doc strings
---
evil-goggles.el | 42 ++++++++++++++++++++++++++++++------------
1 file changed, 30 insertions(+), 12 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index 18ed98bca6..aaccb5892c 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -35,8 +35,13 @@
;;
;;; Code:
-(defvar evil-goggles--on nil)
-(defvar evil-goggles-show-for 0.200) ;; .100 or .200 seem best
+(defcustom evil-goggles-show-for 0.200
+ "Time if floating seconds that the goggles overlay should last."
+ :type 'number)
+
+(defcustom evil-goggles-default-face
+ 'region
+ "Deafult face for the overlay")
(defcustom evil-goggles-faces-alist
`(
@@ -45,10 +50,6 @@
)
"Association list of faces to use for different commands")
-(defcustom evil-goggles-default-face
- 'region
- "Deafult face for the overlay")
-
(defun evil-goggles--face (command)
"Return the configured face for COMMAND, or the default face."
(or
@@ -86,13 +87,27 @@
;; don't show overlay when the region has nothing but whitespace
(not (null (string-match-p "[^ \t\n]" (buffer-substring-no-properties
beg end))))))
+(defvar evil-goggles--on nil
+ "When non-nil, the goggles overlay must not be displayed.
+
+Used to prevent displaying multiple overlays for the same command. For
+example, when the user executes `evil-delete', the overlay should be
+displayed, but when `evil-delete' calls internally `evil-yank', the
+overlay must not be displayed.")
+
(defmacro evil-goggles--with-goggles (beg end adviced-fun &rest body)
+ "Show goggles overlay from BEG to END if the conditions are met.
+
+ADVICED-FUN is used to lookup which face should the overlay use.
+The goggles overlay will be displayed briefly 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))
- (evil-goggles--show ,beg ,end (evil-goggles--face ,adviced-fun))
- (progn ,@body))
- (progn ,@body)))
+ (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 (fun &rest args)
"Call FUN with ARGS with `funcall' or `funcall-interactively'."
@@ -111,14 +126,17 @@
(evil-goggles--advice-remove-all)
)))
-(defvar evil-goggles--advices (make-hash-table))
+(defvar evil-goggles--advices (make-hash-table)
+ "Hast table with functions which should be advice-d when evil-goggles-mode
is toggled.")
(defun evil-goggles--advice-add (fun advice-fun)
+ "Add advice around FUN with ADVICE-FUN.
+
+Toggling evil-goggles-mode will add/remove the advice"
(when evil-goggles-mode
;; clear any old advice
(let ((old-advice-fun (gethash fun evil-goggles--advices)))
(when old-advice-fun
- (message "Replacing advice of %s" fun)
(advice-remove fun old-advice-fun)))
;; add the new advice
- [nongnu] elpa/evil-goggles 2117f62dff 087/225: Alternative implementation for undo/redo, (continued)
- [nongnu] elpa/evil-goggles 2117f62dff 087/225: Alternative implementation for undo/redo, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 6ab09a09c7 093/225: Don't use `caadr`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d274e1572c 096/225: Make Travis run all of evil's tests under (evil-goggles-mode), ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 513ba2eb3e 094/225: Polish u/redo implementation to handle u/redo after "o"/"O", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles cbcad38344 021/225: Cleanup code, add some doc strings, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3dc8417950 040/225: Add evil-fill-and-move "=", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles bc4a117f6c 059/225: Rename evil-goggles-face to evil-goggles-default-face, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 02a8072435 011/225: Use evil faces for delete and yank, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles a4958cf377 012/225: Add evil-commentary and evil-replace-with-register, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles dc4ce17b65 013/225: Add license header, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 8d6fc41234 023/225: Doc strings,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles 743fd1d96d 027/225: Indent tweak, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 805e20dcde 022/225: Don't show overlay when :global or :vglobal is executed, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ac3b272cdb 031/225: Reduce byte compiler errors, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles dd9a888516 032/225: Test infrastructure, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 412ed4ce79 035/225: Initial README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles fd417360a2 038/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 6e4d0fab3c 047/225: Add missing :group to custom variable, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d759e22ba3 062/225: Re-add support for yank, join, commentary, surround, replace with register, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 336f6038a3 066/225: Don't inherit diff-mode's faces by default, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 214fb33c8f 063/225: Re-add :g/:v. Fix disabling the mode, ELPA Syncer, 2022/01/12