[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles ca18c944ed 179/225: Show hint on start/stop r
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles ca18c944ed 179/225: Show hint on start/stop record macro |
Date: |
Wed, 12 Jan 2022 08:59:06 -0500 (EST) |
branch: elpa/evil-goggles
commit ca18c944ede4272234f9f181d6889112d39b06c3
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Show hint on start/stop record macro
---
Makefile | 3 +--
README.md | 5 ++++-
evil-goggles.el | 31 +++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index ace68659d1..4d25017409 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,7 @@
emacs ?= emacs
bemacs = $(emacs) -batch -l test/elpa.el
-all:
- compile
+all: compile
update:
$(emacs) -batch -l test/make-update.el
diff --git a/README.md b/README.md
index 5774a97483..541767c504 100644
--- a/README.md
+++ b/README.md
@@ -122,6 +122,7 @@ evil-goggles-set-marker-face
evil-goggles-undo-redo-add-face
evil-goggles-undo-redo-remove-face
evil-goggles-undo-redo-change-face
+evil-goggles-record-macro-face
```
#### Other Customizations
@@ -166,9 +167,10 @@ evil-goggles-undo-redo-change-face
;; evil-goggles-enable-set-marker
;; evil-goggles-enable-undo
;; evil-goggles-enable-redo
+;; evil-goggles-enable-record-macro
```
-## Recent Significant Changes
+## NEWS - Recent Significant Changes
- [May 28, 2017] Switched to using custom faces per action, deprecated
`evil-goggles-faces-alist`
- [May 28, 2017] Switched to using per-action on/off custom variables,
deprecated `evil-goggles-blacklist`
@@ -178,3 +180,4 @@ evil-goggles-undo-redo-change-face
- [Sep 17, 2017] Add experimental support for pulsing hints (no longer
experimental since Dec 02, 2017)
- [Nov 03, 2017] Add options `evil-goggles-async-duration` and
`evil-goggles-blocking-duration`
- [Dec 02, 2017] Pulsing hints is no longer experimental
+- [Feb 05, 2018] Show hint on start/stop macro recording
diff --git a/evil-goggles.el b/evil-goggles.el
index 9671cc800a..4ecc57ddae 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -657,6 +657,33 @@ CHAR POS ADVANCE are the arguments of the original
function."
(evil-goggles--hint-on-empty-lines t))
(evil-goggles--with-async-hint beg end 'evil-goggles-set-marker-face))))
+;;; record macro
+
+(evil-goggles--define-switch-and-face
+ evil-goggles-enable-record-macro "If non-nil, enable record macro support"
+ evil-goggles-record-macro-face "Face for record macro action")
+
+(defun evil-goggles--evil-record-macro-advice (orig-fun register)
+ "Around-advice for function `evil-record-macro'.
+
+ORIG-FUN is the original function.
+REGISTER is the argument of the original function."
+ (let ((beg (line-beginning-position))
+ (end (1+ (line-end-position)))
+ (was-defining-kbd-macro defining-kbd-macro)
+ (evil-goggles--hint-on-empty-lines t))
+
+ ;; show hint before starting to record a macro
+ (unless was-defining-kbd-macro
+ (evil-goggles--show-hint beg end 'evil-goggles-record-macro-face))
+
+ (evil-goggles--funcall-preserve-interactive orig-fun register)
+
+ ;; show hint when done defining the macro
+ (when was-defining-kbd-macro
+ (evil-goggles--show-hint beg end 'evil-goggles-record-macro-face))))
+
+
;;; ex global
(defun evil-goggles--evil-ex-global-advice (orig-fun beg end pattern command
&optional invert)
@@ -774,6 +801,9 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of
the original function
(when evil-goggles-enable-set-marker
(advice-add 'evil-set-marker :around
'evil-goggles--evil-set-marker-advice))
+ (when evil-goggles-enable-record-macro
+ (advice-add 'evil-record-macro :around
'evil-goggles--evil-record-macro-advice))
+
;; make sure :global and :v don't show the goggles overlay
(advice-add 'evil-ex-global :around 'evil-goggles--evil-ex-global-advice)
@@ -804,6 +834,7 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of
the original function
(advice-remove 'evil-shift-left 'evil-goggles--evil-shift-advice)
(advice-remove 'evil-shift-right 'evil-goggles--evil-shift-advice)
(advice-remove 'evil-set-marker 'evil-goggles--evil-set-marker-advice)
+ (advice-remove 'evil-record-macro 'evil-goggles--evil-record-macro-advice)
(advice-remove 'evil-ex-global 'evil-goggles--evil-ex-global-advice)
- [nongnu] elpa/evil-goggles 4777cd7849 121/225: Show hint after indenting, not before #7, (continued)
- [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
- [nongnu] elpa/evil-goggles 3dce5937ac 166/225: Pulsing is no longer experimental, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4d4465fd59 168/225: Improve logic deciding whether to pulse or not, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3b874c7630 178/225: Set mark advice: show hint on whitespace-only lines, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ca18c944ed 179/225: Show hint on start/stop record macro,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles 943382b367 194/225: Add hints for surround, commentary, nerd commenter, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 04d66ddc20 201/225: Add hint for `q`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles b896ca797c 211/225: Add support for evil-org. Close #21, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 2186289a01 213/225: evil-goggles--show-p: no need to check evil-inhibit-operator-value, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 42456816de 015/225: Use macros to preserve "interactivity", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles dd76fd3d28 019/225: Make sure the overlay is cleaned-up, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 1014993453 028/225: Add custom variable evil-goggles-blacklist to allow disabling individual functions, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f29820fe98 029/225: Detect only `evil-inhibit-operator-value` into account, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 9882706667 030/225: Preserve the return value of evil-paste-*, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 253613ce66 039/225: Fix check of evil-last-paste, ELPA Syncer, 2022/01/12