[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 2932d91a6c 129/225: Remove deprecated functio
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 2932d91a6c 129/225: Remove deprecated functions |
Date: |
Wed, 12 Jan 2022 08:59:02 -0500 (EST) |
branch: elpa/evil-goggles
commit 2932d91a6c920eb910ba0d3a92ff7f02e4db31d6
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Remove deprecated functions
---
evil-goggles.el | 86 ++++-----------------------------------------------------
1 file changed, 6 insertions(+), 80 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index ec4151dfff..b777cc89b5 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -68,40 +68,15 @@ This option is experimental."
:group 'evil-goggles)
(defface evil-goggles--pulse-face nil
- "Temporary face used when pulsing, should not be modified.
+ "Temporary face used when pulsing, should not be customized.
This is needed because the pulse package expects to receive a face, it
can't work with input such as (backgound . \"red\")."
:group 'evil-goggles)
-(defun evil-goggles--show (beg end face)
- "Show overlay in region from BEG to END with FACE.
-
-If variable `evil-this-type' is 'block, the overlay will be a block,
-otherwise - a region."
- (if (eq evil-this-type 'block)
- (evil-goggles--show-block beg end face)
- (evil-goggles--show-region beg end face)))
-
(autoload 'pulse-momentary-highlight-overlay "pulse")
-(defun evil-goggles--show-region (beg end face)
- "Show overlay in region from BEG to END with FACE.
-
-The overlay will pulse if variable `evil-goggles-pulse' is t,
-otherwise it will just appear and disappear."
- (let ((ov (evil-goggles--make-overlay beg end))
- (bg (evil-goggles--face-background face)))
- (unwind-protect
- (progn
- (if evil-goggles-pulse
- (evil-goggles--pulse-overlay ov bg) ;; pulse the overlay
- (overlay-put ov 'face face)) ;; just put the face on the overlay
- (sit-for evil-goggles-duration))
- (delete-overlay ov))))
-
-;; TODO dur should not be optional
-(defun evil-goggles--pulse-overlay (ov background &optional dur)
+(defun evil-goggles--pulse-overlay (ov background dur)
"Pulse the overlay OV with the BACKGROUND color."
(let* ((pulse-delay 0.03)
(pulse-iterations (round (or dur evil-goggles-duration) pulse-delay)))
@@ -109,20 +84,6 @@ otherwise it will just appear and disappear."
(set-face-attribute 'evil-goggles--pulse-face nil :background background)
(pulse-momentary-highlight-overlay ov 'evil-goggles--pulse-face)))
-(defun evil-goggles--show-block (beg end face)
- "Show overlay in blcok from BEG to END with FACE."
- (let ((ovs)
- (overlay-face `(:background ,(evil-goggles--face-background face))))
- (unwind-protect
- (progn
- ;; create multiple overlays, one for each line in the block
- (evil-apply-on-block (lambda (line-beg line-end)
- (add-to-list 'ovs
- (evil-goggles--make-overlay
line-beg line-end 'face overlay-face)))
- beg end nil)
- (sit-for evil-goggles-duration))
- (mapcar 'delete-overlay ovs))))
-
(defun evil-goggles--face-background (face)
"Return the background of FACE or use a fallback.
@@ -149,8 +110,7 @@ overlay must not be re-displayed.")
(defun evil-goggles--show-p (beg end)
"Return t if the overlay should be displayed in region BEG to END."
- (and (not evil-goggles--on)
- (not evil-inhibit-operator-value)
+ (and (not evil-inhibit-operator-value)
(bound-and-true-p evil-mode)
(numberp beg)
(numberp end)
@@ -164,37 +124,6 @@ overlay must not be re-displayed.")
;; don't show overlay when the region has nothing but whitespace
(not (null (string-match-p "[^ \t\n]" (buffer-substring-no-properties
beg end))))))
-(defmacro evil-goggles--with-goggles (beg end overlay-face &rest body)
- "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 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 ,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)
@@ -438,8 +367,7 @@ N and LIST are the arguments of the original function."
;; show hint on the text which will be removed before undo/redo removes it
(pcase undo-item
(`(text-added ,beg ,end)
- (when (evil-goggles--show-p beg end)
- (evil-goggles--with-before-goggles2 beg end
'evil-goggles-undo-redo-remove-face evil-goggles-undo-redo-remove-duration))))
+ (evil-goggles--with-before-goggles2 beg end
'evil-goggles-undo-redo-remove-face evil-goggles-undo-redo-remove-duration)))
;; call the undo/redo function
(funcall orig-fun n list)
@@ -447,11 +375,9 @@ N and LIST are the arguments of the original function."
;; show hint on the text which will be added after undo/redo addes it
(pcase undo-item
(`(text-removed ,beg ,end)
- (when (evil-goggles--show-p beg end)
- (evil-goggles--with-before-goggles2 beg end
'evil-goggles-undo-redo-add-face evil-goggles-undo-redo-add-duration)))
+ (evil-goggles--with-before-goggles2 beg end
'evil-goggles-undo-redo-add-face evil-goggles-undo-redo-add-duration))
(`(text-changed ,beg ,end)
- (when (evil-goggles--show-p beg end)
- (evil-goggles--with-before-goggles2 beg end
'evil-goggles-undo-redo-change-face evil-goggles-undo-redo-change-duration))))))
+ (evil-goggles--with-before-goggles2 beg end
'evil-goggles-undo-redo-change-face evil-goggles-undo-redo-change-duration)))))
(defun evil-goggles--get-undo-item (list)
"Process LIST.
- [nongnu] elpa/evil-goggles 8aa26e9671 205/225: CI: run package-lint, (continued)
- [nongnu] elpa/evil-goggles 8aa26e9671 205/225: CI: run package-lint, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 77a8bb1785 207/225: Update README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 87722a5b46 210/225: Add hint for `D`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d7876e6566 218/225: Drop unnecessary helper macro, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 636b263361 215/225: Make async overlay cleanup more robust, without using pre-command-hook, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 12cfb80230 104/225: Use separate config, face and advice for nerd-commenter and commentary. Refs #13, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 75d124851f 156/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d4b3d873dc 155/225: Update CI setup to run evil's tests unaltered, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 761abb7b2f 145/225: Hint duration should be configured via three variables, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f282263af4 120/225: Show visual hint after shift left/right, not before #7, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 2932d91a6c 129/225: Remove deprecated functions,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles d3802c500f 141/225: Rename function with-no-hint => with-disabled-hint, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 888f064624 130/225: Add docstrings, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 7f30cbd73c 139/225: Fix default values, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 838aacbe33 176/225: evil-goggles--show-p: check for a single char *and* single line, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 5780bcf8cb 186/225: Show hint only when the command is called interactively #18, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4bfc8df8b3 191/225: Remove deprecated macros, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles bb974e38d2 193/225: Add hints for `J`, `gq` and `=`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 42051e2cb3 197/225: Keep configuration per command in a variable, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 1c72501a6f 196/225: Reduce configuration options - drop `substitute`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 2b922512fb 199/225: Refactor, ELPA Syncer, 2022/01/12