[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 12cfb80230 104/225: Use separate config, face
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 12cfb80230 104/225: Use separate config, face and advice for nerd-commenter and commentary. Refs #13 |
Date: |
Wed, 12 Jan 2022 08:59:00 -0500 (EST) |
branch: elpa/evil-goggles
commit 12cfb802306906d9598558e87eb370f439fc4f14
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Use separate config, face and advice for nerd-commenter and commentary.
Refs #13
---
README.md | 5 ++++-
evil-goggles.el | 22 +++++++++++++++++++---
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 18b76019f1..2d66306df7 100644
--- a/README.md
+++ b/README.md
@@ -66,7 +66,8 @@ evil-goggles
#### evil plugins with hint
- surround [evil-surround](https://github.com/timcharper/evil-surround)
-- comment [evil-commentary](https://github.com/linktohack/evil-commentary) and
[evil-nerd-commenter](https://github.com/redguardtoo/evil-nerd-commenter)
+- commentary [evil-commentary](https://github.com/linktohack/evil-commentary)
+- nerd-commenter
[evil-nerd-commenter](https://github.com/redguardtoo/evil-nerd-commenter)
- replace with register
[evil-ReplaceWithRegister](https://github.com/Dewdrops/evil-ReplaceWithRegister)
## Customizations
@@ -103,6 +104,7 @@ evil-goggles-paste-face
evil-goggles-shift-face
evil-goggles-surround-face
evil-goggles-commentary-face
+evil-goggles-nerd-commenter-face
evil-goggles-replace-with-register-face
evil-goggles-set-marker-face
evil-goggles-undo-redo-add-face
@@ -133,6 +135,7 @@ evil-goggles-undo-redo-change-face
;; evil-goggles-enable-shift
;; evil-goggles-enable-surround
;; evil-goggles-enable-commentary
+;; evil-goggles-enable-nerd-commenter
;; evil-goggles-enable-replace-with-register
;; evil-goggles-enable-set-marker
;; evil-goggles-enable-undo
diff --git a/evil-goggles.el b/evil-goggles.el
index d6fdd7a4b0..072c23d4be 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -516,6 +516,20 @@ BEG END &OPTIONAL TYPE are the arguments of the original
function."
(evil-goggles--with-goggles beg end 'evil-goggles-commentary-face
(evil-goggles--funcall-preserve-interactive orig-fun beg end type)))
+;; nerd-commenter
+
+(evil-goggles--define-switch-and-face
+ evil-goggles-enable-nerd-commenter "If non-nil, enable nerd-commenter
support"
+ evil-goggles-nerd-commenter-face "Face for nerd-commenter action")
+
+(defun evil-goggles--evil-nerd-commenter-advice (orig-fun beg end &optional
type)
+ "Around-advice for function `evilnc-comment-operator'.
+
+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--funcall-preserve-interactive orig-fun beg end type)))
+
;; replace with register
(evil-goggles--define-switch-and-face
@@ -594,8 +608,10 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of
the original function
(advice-add 'evil-surround-region :around
'evil-goggles--evil-surround-region-advice))
(when evil-goggles-enable-commentary
- (advice-add 'evil-commentary :around
'evil-goggles--evil-commentary-advice)
- (advice-add 'evilnc-comment-operator :around
'evil-goggles--evil-commentary-advice))
+ (advice-add 'evil-commentary :around
'evil-goggles--evil-commentary-advice))
+
+ (when evil-goggles-enable-nerd-commenter
+ (advice-add 'evilnc-comment-operator :around
'evil-goggles--evil-nerd-commenter-advice))
(when evil-goggles-enable-replace-with-register
(advice-add 'evil-replace-with-register :around
'evil-goggles--evil-replace-with-register-advice)))
@@ -619,7 +635,7 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of
the original function
;; evil non-core functions
(advice-remove 'evil-surround-region
'evil-goggles--evil-surround-region-advice)
(advice-remove 'evil-commentary 'evil-goggles--evil-commentary-advice)
- (advice-remove 'evilnc-comment-operator
'evil-goggles--evil-commentary-advice)
+ (advice-remove 'evilnc-comment-operator
'evil-goggles--evil-nerd-commenter-advice)
(advice-remove 'evil-replace-with-register
'evil-goggles--evil-replace-with-register-advice))))
(provide 'evil-goggles)
- [nongnu] elpa/evil-goggles c515477fd4 160/225: Clarify docs for evil-goggles-async-duration and evil-goggles-blocking-duration, (continued)
- [nongnu] elpa/evil-goggles c515477fd4 160/225: Clarify docs for evil-goggles-async-duration and evil-goggles-blocking-duration, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 674a1be5aa 188/225: Merge branch 'hint-only-when-command-is-interactive'. Close #18, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 946598059f 204/225: Fix compilation warnings, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles b756edf31e 182/225: Show hint on u/redo after inserting text with "O", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 6d2ce52faa 200/225: Add hint for `m`, ELPA Syncer, 2022/01/12
- [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 <=
- [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, 2022/01/12
- [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