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

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

[nongnu] elpa/anzu df60e608f1 233/288: Update document about update func


From: ELPA Syncer
Subject: [nongnu] elpa/anzu df60e608f1 233/288: Update document about update function
Date: Thu, 6 Jan 2022 03:58:56 -0500 (EST)

branch: elpa/anzu
commit df60e608f1d2a51e3bdfb44af028c6dbd5d3e2e7
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>

    Update document about update function
---
 README.md | 11 ++++++-----
 anzu.el   |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 8f6be8f448..d35b23f095 100644
--- a/README.md
+++ b/README.md
@@ -98,10 +98,9 @@ Face of to-string of replacement
 
 #### `anzu-mode-line-update-function`
 
-Function which constructs mode-line string. If you color mode-line string,
-you propertize string by yourself. The function takes 2 integer arguments, 
current position,
-and total matched. This function is called at searching, inputting replaced 
word,
-replacing. Global variable `anzu--state` indicates those states(`'search`, 
`'replace-query`, `replace`).
+Function which constructs mode-line string. anzu.el puts its output to 
mode-line. It is called at searching, inputting replaced word, replacing. This 
must be non-nil.
+
+The function takes 2 integer arguments, current position and total match 
number. You can get current-state from `anzu--state`(`'search`, 
`'replace-query`, `replace`).
 
 ```lisp
 (defun my/anzu-update-func (here total)
@@ -111,7 +110,9 @@ replacing. Global variable `anzu--state` indicates those 
states(`'search`, `'rep
                     (replace-query (format "(%d Replaces)" total))
                     (replace (format "<%d/%d>" here total)))))
       (propertize status 'face 'anzu-mode-line))))
-(setq anzu-mode-line-update-function #'my/anzu-update-func)
+
+(custom-set-variables
+ '(anzu-mode-line-update-function #'my/anzu-update-func))
 ```
 
 #### `anzu-cons-mode-line-p`(Default is `t`)
diff --git a/anzu.el b/anzu.el
index 444734b709..72124e207a 100644
--- a/anzu.el
+++ b/anzu.el
@@ -72,7 +72,7 @@
   :type 'boolean)
 
 (defcustom anzu-mode-line-update-function #'anzu--update-mode-line-default
-  "Function which return mode-line string"
+  "Function which return mode-line string. This must be non-nil."
   :type 'function)
 
 (defcustom anzu-regexp-search-commands '(isearch-forward-regexp



reply via email to

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