[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu b310647932 085/288: Add separator parameter of 'to' s
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu b310647932 085/288: Add separator parameter of 'to' string |
Date: |
Thu, 6 Jan 2022 03:58:42 -0500 (EST) |
branch: elpa/anzu
commit b310647932b101e4c76c5bbaf02fcc61dd0c27c4
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Add separator parameter of 'to' string
---
README.md | 10 +++++++++-
anzu.el | 12 ++++++++++--
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 8987ff6f17..15239bbb57 100644
--- a/README.md
+++ b/README.md
@@ -163,6 +163,10 @@ It is hard to see with anzu replace command when region is
active.
Thing at point of `anzu-query-replace-at-cursor-thing`.
This parameter is same as `thing-at-point`.
+#### `anzu-replace-to-string-separator`(Default is "")
+
+Separator of `to` string.
+
## Sample Configuration
@@ -173,5 +177,9 @@ This parameter is same as `thing-at-point`.
(set-face-attribute 'anzu-mode-line nil
:foreground "yellow" :weight 'bold)
-(setq anzu-search-threshold 1000)
+(custom-set-variables
+ '(anzu-mode-lighter "")
+ '(anzu-deactivate-region t)
+ '(anzu-search-threshold 1000)
+ '(anzu-replace-to-string-separator " => "))
```
diff --git a/anzu.el b/anzu.el
index 38373b750a..d2e4531b53 100644
--- a/anzu.el
+++ b/anzu.el
@@ -97,6 +97,11 @@
:type 'symbol
:group 'anzu)
+(defcustom anzu-replace-to-string-separator ""
+ "Separator of `to' string"
+ :type 'string
+ :group 'anzu)
+
(defface anzu-mode-line
'((t (:foreground "magenta" :weight bold)))
"face of anzu modeline"
@@ -393,6 +398,10 @@
collect ov into anzu-overlays
finally return (sort anzu-overlays 'anzu--overlay-sort)))
+(defsubst anzu--propertize-to-string (str)
+ (let ((separator (or anzu-replace-to-string-separator "")))
+ (propertize (concat separator str) 'face 'anzu-replace-to)))
+
(defun anzu--append-replaced-string (buf beg end use-regexp overlay-limit)
(let ((content (minibuffer-contents))
(replace-count 0))
@@ -405,8 +414,7 @@
(if replace-evaled
(incf replace-count)
(setq replace-evaled content))
- (overlay-put ov 'after-string
- (propertize replace-evaled 'face
'anzu-replace-to))))))))
+ (overlay-put ov 'after-string (anzu--propertize-to-string
replace-evaled))))))))
(defun anzu--read-to-string (from prompt beg end use-regexp overlay-limit)
(let ((curbuf (current-buffer))
- [nongnu] elpa/anzu 537b8bfd36 071/288: Add autoload cookie, (continued)
- [nongnu] elpa/anzu 537b8bfd36 071/288: Add autoload cookie, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 6b01763088 077/288: Improve replace regular expression, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu abd5953eac 018/288: Add Installation section, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 4cfbddbc07 020/288: Reset match count variables in isearch-mode-end-hook, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu de70e2fa4a 031/288: Enable mode unconditionally in examples, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 2b88e1fcbc 021/288: Improve for not regexp search commands, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5e6bad85d4 036/288: bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 169cf55674 044/288: Use previous result if regexp validation is failed, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu d256c967f3 052/288: Fix message in mode-line at replace command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 413bd09ebc 079/288: Fix different behavior from query-replace-regexp, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b310647932 085/288: Add separator parameter of 'to' string,
ELPA Syncer <=
- [nongnu] elpa/anzu 047c5eee99 083/288: add anzu replace command screencast, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 630d663238 087/288: Fix invalid return type, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 9b772435ea 090/288: Support backward replace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 81b4eb6e29 093/288: Fix increasing anzu information in mode-line issue(#13), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1ea6980019 106/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu caf83591e4 134/288: Merge pull request #28 from syohex/improve-replace-mode-line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5d209726cd 156/288: Merge pull request #36 from syohex/case-sensitive-for-at-cursor-command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ee53798dc2 160/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1c2705bb2c 164/288: Merge pull request #38 from syohex/improve-replacement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu d4dcd76f47 190/288: Merge pull request #48 from syohex/improve-history, ELPA Syncer, 2022/01/06