[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 3f9eed229e 232/301: Allow custom mode-line
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 3f9eed229e 232/301: Allow custom mode-line |
Date: |
Mon, 10 Jan 2022 22:59:05 -0500 (EST) |
branch: elpa/iedit
commit 3f9eed229ead8ae59c890503f6e8967195630c77
Author: Lionel Henry <lionel.hry@gmail.com>
Commit: Lionel Henry <lionel.hry@gmail.com>
Allow custom mode-line
Adds `iedit-mode-line' user variable.
---
iedit.el | 38 ++++++++++++++------------------------
1 file changed, 14 insertions(+), 24 deletions(-)
diff --git a/iedit.el b/iedit.el
index d6cf30e22a..9a054fe905 100644
--- a/iedit.el
+++ b/iedit.el
@@ -150,6 +150,14 @@ use this variable:
(buffer-substring-no-properties (car bound) (cdr
bound))))))))
'$%@*' will be included in the occurrences in perl mode.")
+(defcustom iedit-mode-line
+ `(" Iedit:" (:eval (format ,(propertize "%d" 'face 'font-lock-warning-face)
+ (iedit-counter))))
+ "Mode-line format for Iedit.
+This should be set before Iedit is loaded."
+ :group 'iedit)
+(put 'iedit-mode-line 'risky-local-variable t)
+
(make-variable-buffer-local 'iedit-mode)
(make-variable-buffer-local 'iedit-use-symbol-boundaries)
(make-variable-buffer-local 'iedit-occurrence-type-local)
@@ -160,7 +168,7 @@ use this variable:
(or (assq 'iedit-mode minor-mode-alist)
(nconc minor-mode-alist
- (list '(iedit-mode iedit-mode))))
+ (list `(iedit-mode ,iedit-mode-line))))
;;; Define iedit help map.
(eval-when-compile (require 'help-macro))
@@ -223,6 +231,10 @@ This is like `describe-bindings', but displays only Iedit
keys."
(let (same-window-buffer-names same-window-regexps)
(describe-function 'iedit-mode)))
+(defun iedit-counter ()
+ "Return the number of active occurrences."
+ (length iedit-occurrences-overlays))
+
;;; Default key bindings:
(when (and iedit-toggle-key-default (null (where-is-internal 'iedit-mode)))
(let ((key-def (lookup-key (current-global-map) iedit-toggle-key-default)))
@@ -425,12 +437,7 @@ Keymap used within overlays:
(message "%d matches for \"%s\""
counter
(iedit-printable occurrence-regexp))
- (setq iedit-mode
- (propertize
- (concat " Iedit:" (number-to-string counter))
- 'face
- 'font-lock-warning-face))
- (force-mode-line-update))
+ (setq iedit-mode t))
(run-hooks 'iedit-mode-hook)
(add-hook 'before-revert-hook 'iedit-done nil t)
(add-hook 'kbd-macro-termination-hook 'iedit-done nil t)
@@ -600,10 +607,6 @@ the initial string globally."
(point-min)))
(iedit-add-next-occurrence-overlay
(iedit-regexp-quote current-occurrence-string)))
- (setq iedit-mode (propertize
- (concat " Iedit:" (number-to-string
- (length
iedit-occurrences-overlays)))
- 'face 'font-lock-warning-face))
(force-mode-line-update))))))
(defun iedit-restrict-function(&optional arg)
@@ -702,10 +705,6 @@ prefix, bring the top of the region back down one
occurrence."
forward)))
(when pos
(goto-char pos)
- (setq iedit-mode (propertize
- (concat " Iedit:" (number-to-string
- (length
iedit-occurrences-overlays)))
- 'face 'font-lock-warning-face))
(force-mode-line-update))))
(defun iedit-restrict-region (beg end &optional inclusive)
@@ -721,10 +720,6 @@ prefix, bring the top of the region back down one
occurrence."
(iedit-cleanup-occurrences-overlays beg end inclusive)
(if iedit-unmatched-lines-invisible
(iedit-hide-unmatched-lines iedit-occurrence-context-lines))
- (setq iedit-mode (propertize
- (concat " Iedit:" (number-to-string
- (length iedit-occurrences-overlays)))
- 'face 'font-lock-warning-face))
(force-mode-line-update)))
(defun iedit-toggle-case-sensitive ()
@@ -747,11 +742,6 @@ prefix, bring the top of the region back down one
occurrence."
"ignores case")
counter
(iedit-printable occurrence-regexp))
- (setq iedit-mode
- (propertize
- (concat " Iedit:" (number-to-string counter))
- 'face
- 'font-lock-warning-face))
(force-mode-line-update))))
(provide 'iedit)
- [nongnu] elpa/iedit 9a40f6fa36 205/301: check if mc present, (continued)
- [nongnu] elpa/iedit 9a40f6fa36 205/301: check if mc present, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 97ad9d0600 254/301: removed downcasing the from-string in iedit-lib.el/iedit-replace-occurrences to allow case sensitivity., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7a3725cd04 267/301: Small optimizations, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 42654ba7ed 266/301: iedit-rect.el: Don't set iedit-initial-string-local, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d335d6842a 183/301: Check if the default keybinding of iedit-mode is taken, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e575cbf569 256/301: Allow adding a incremented number in each occurence, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 796ee5298d 237/301: fix the key conflict with yas-minor-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e1decb37e5 245/301: Fix verion numbers, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f09b675c67 249/301: Add an option 'iedit-auto-narrow', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 44601e01fa 269/301: fix an issue with electric pair, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 3f9eed229e 232/301: Allow custom mode-line,
ELPA Syncer <=
- [nongnu] elpa/iedit 9c08a48c88 281/301: Remove the workaround for slow c-before-change, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 01767ddca3 258/301: Fix a failed testcase in batch mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7e507b370b 255/301: Set the FIXEDCASE argument of replace-match in iedit-replace-occurrences to T to allow preserving case., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 745ea6f812 239/301: Rename iedit-toggle-unmatched-lines-visible to iedit-show/hide-unmatched-lines, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit dfed75064e 285/301: Save and restore `line-move-ignore-invisible', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c448864424 216/301: Remove iedit-unmatched-lines-invisible-default, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 5fdf89edc9 238/301: Fix switch to mc mode problem, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit de54411d0e 220/301: Detect markup tag only if region inactive, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit ac51555341 282/301: New feature: ignore hidden occurrences, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 31986b640a 289/301: Take iedit-goto-first-occurrence back, ELPA Syncer, 2022/01/10