branch: elpa/anzu
commit 1afa7d7b0f15e2d20c88fc21d15b3f0d44804bef
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>

    Add flag whether anzu.el cons search info to mode-line(#4)
---
 anzu.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/anzu.el b/anzu.el
index 3ba212522b..0ed9ae250d 100644
--- a/anzu.el
+++ b/anzu.el
@@ -46,6 +46,11 @@
   :type 'string
   :group 'anzu)
 
+(defcustom anzu-cons-mode-line-p t
+  "Set nil if you use your own setting"
+  :type 'boolean
+  :group 'anzu)
+
 (defcustom anzu-use-migemo nil
   "Flag of using migemo"
   :type 'boolean
@@ -105,12 +110,12 @@
        (equal (car mode-line-format) '(:eval (anzu--update-mode-line)))))
 
 (defun anzu--cons-mode-line ()
-  (unless (anzu--mode-line-not-set-p)
+  (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))))
 
 (defun anzu--reset-mode-line ()
-  (when (anzu--mode-line-not-set-p)
+  (when (and anzu-cons-mode-line-p (anzu--mode-line-not-set-p))
     (setq mode-line-format (cdr mode-line-format))))
 
 (defun anzu--update-mode-line-default (here total)

Reply via email to