[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 81b4eb6e29 093/288: Fix increasing anzu information i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 81b4eb6e29 093/288: Fix increasing anzu information in mode-line issue(#13) |
Date: |
Thu, 6 Jan 2022 03:58:43 -0500 (EST) |
branch: elpa/anzu
commit 81b4eb6e2930fcce7dfc9e99cb103d94390d568d
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Fix increasing anzu information in mode-line issue(#13)
anzu.el assumes anzu information is first element of mode-line-format.
anzu.el decides there is no anzu information if first element of
mode-line-format is not anzu information. But this is sometimes wrong.
If some element is consed mode-line-format during anzu information showing,
anzu.el mistakes that there is no anzu information and cons anzu information
again to mode-line-format. This causes increasing anzu information.
So I fixed anzu.el checks whether there is anzu information in
mode-line-format
by 'member' function and remove anzu information from mode-line-format by
'delete' function.
---
anzu.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/anzu.el b/anzu.el
index 7a49a14670..fd58df937a 100644
--- a/anzu.el
+++ b/anzu.el
@@ -194,9 +194,11 @@
anzu--last-isearch-string isearch-string)
(force-mode-line-update)))))
+(defconst anzu--mode-line-format '(:eval (anzu--update-mode-line)))
+
(defsubst anzu--mode-line-not-set-p ()
(and (listp mode-line-format)
- (equal (car mode-line-format) '(:eval (anzu--update-mode-line)))))
+ (member anzu--mode-line-format mode-line-format)))
(defun anzu--cons-mode-line-search ()
(anzu--cons-mode-line 'search))
@@ -204,8 +206,7 @@
(defun anzu--cons-mode-line (state)
(setq anzu--state state)
(when (and anzu-cons-mode-line-p (not (anzu--mode-line-not-set-p)))
- (setq mode-line-format (cons '(:eval (anzu--update-mode-line))
- mode-line-format))))
+ (setq mode-line-format (cons anzu--mode-line-format mode-line-format))))
(defsubst anzu--reset-status ()
(setq anzu--total-matched 0
@@ -217,7 +218,7 @@
(defun anzu--reset-mode-line ()
(anzu--reset-status)
(when (and anzu-cons-mode-line-p (anzu--mode-line-not-set-p))
- (setq mode-line-format (cdr mode-line-format))))
+ (setq mode-line-format (delete anzu--mode-line-format mode-line-format))))
(defsubst anzu--format-here-position (here total)
(if (and anzu--overflow-p (zerop here))
- [nongnu] elpa/anzu de70e2fa4a 031/288: Enable mode unconditionally in examples, (continued)
- [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, 2022/01/06
- [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 <=
- [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
- [nongnu] elpa/anzu 370b9f162f 181/288: Merge pull request #45 from syohex/fix-zero-width-replacement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 8a1eb22317 174/288: Merge pull request #42 from syohex/fix-replace-command-bug, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a1f56b6dad 193/288: Merge pull request #50 from syohex/fix-default-input-49, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 6dd966b4e2 186/288: Implement separator feature of Emacs 25, ELPA Syncer, 2022/01/06