[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 85fad4a3b7 233/301: Merge pull request #73 from lion
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 85fad4a3b7 233/301: Merge pull request #73 from lionel-/feature-mode-line |
Date: |
Mon, 10 Jan 2022 22:59:05 -0500 (EST) |
branch: elpa/iedit
commit 85fad4a3b797e6e087380f596e0147298bd08aff
Merge: abcc27a9f0 3f9eed229e
Author: victorhge <victorhge@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #73 from lionel-/feature-mode-line
Allow custom mode-line
---
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 007a6f9c28 206/301: check if mc present, (continued)
- [nongnu] elpa/iedit 007a6f9c28 206/301: check if mc present, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7885f4beda 178/301: iedit-restrict-current-line resets expand state, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 79d0f4f3dc 155/301: Merge pull request #32 from mbneedham/master, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit df2de42fa1 149/301: Remove test-util.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 83c037d678 156/301: Fix infinite loop problem in iedit-rect-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b95c35107a 176/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 0d6193362d 144/301: Follow error convention, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c2763baaf6 168/301: Do not enable iedit from a failing isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4e8b9453ac 261/301: Update occurrences in `post-command-hook', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 3c305620ae 250/301: Optimize iedit-mode-from-isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 85fad4a3b7 233/301: Merge pull request #73 from lionel-/feature-mode-line,
ELPA Syncer <=
- [nongnu] elpa/iedit a7f5ed7cf9 257/301: Turn off iedit-mode at running `iedit-mode-toggle-on-function` twice, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 5050b7e88e 260/301: Fix a failed test case when Emacs is compiled without GUI, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit afca4e6bbf 213/301: Rename hook functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7ab2509231 225/301: Expand iedit-regexp-quote with passthrough, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit efe98b2015 248/301: fix `iedit-mode-on-fuction problem, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 01fa1e5925 217/301: Fix error if sgml-electric-tag-pair-mode not bound, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d7db0e5d19 279/301: Replace `iedit-lib-aborting-hook' with a callback function, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit dbf3f9a0e3 290/301: Add iedit-update-key-bindings, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 351bee5e0d 292/301: New iedit-record-changes, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 070775fb85 296/301: New feature: apply kmacro on occurrences, ELPA Syncer, 2022/01/10