emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/anzu 3a7fcf2096 094/288: Merge pull request #14 from syohe


From: ELPA Syncer
Subject: [nongnu] elpa/anzu 3a7fcf2096 094/288: Merge pull request #14 from syohex/fix-increasing-anzuinfo-issue
Date: Thu, 6 Jan 2022 03:58:43 -0500 (EST)

branch: elpa/anzu
commit 3a7fcf2096010fe21fe9b5c202f5da1cde3b70c8
Merge: 156980dc69 81b4eb6e29
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>

    Merge pull request #14 from syohex/fix-increasing-anzuinfo-issue
    
    Fix increasing anzu information in mode-line issue(#13)
---
 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]