[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 9b3aaa8f21 037/301: Fix occurrence from history does
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 9b3aaa8f21 037/301: Fix occurrence from history does not exist problem |
Date: |
Mon, 10 Jan 2022 22:58:48 -0500 (EST) |
branch: elpa/iedit
commit 9b3aaa8f2156d0bb54ef6fb17bc56b335d0a9cdf
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Fix occurrence from history does not exist problem
---
iedit.el | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/iedit.el b/iedit.el
index 240403c99e..21b55a1dbf 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,10 +2,10 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-01-27 23:33:49 Victor Ren>
+;; Time-stamp: <2012-01-29 00:15:42 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region replace simultaneous
-;; Version: 0.91
+;; Version: 0.92
;; X-URL: http://www.emacswiki.org/emacs/iedit.el
;; Compatibility: GNU Emacs: 22.x, 23.x, 24.x
@@ -56,11 +56,11 @@
;; (define-key isearch-mode-map (kbd "C-;") 'iedit-mode)
;;; todo:
+;; - profile to find bottleneck for huge file
+;; - Add more easy access keys for whole occurrence
;; - C-n,C-p is slow when unmatched lines are hided.
-;; - Lazy highlight feature (from isearch)?
;; - toggle blank line between matched lines?
;; - ert unit test
-;; - profile to find bottleneck for huge file
;;; Contributors
;; Adam Lindberg <eproxus@gmail.com> added a case sensitivity option that can
be toggled.
@@ -68,7 +68,8 @@
;; Tassilo Horn <tassilo@member.fsf.org> added an option to match only complete
;; words, not inside words
-;; Le Wang <l26wang@gmail.com> proposed to match only complete symbols, not
inside symbols, contribite iedit-rect mode
+;; Le Wang <l26wang@gmail.com> proposed to match only complete symbols,
not
+;; inside symbols, contribited iedit-rect mode
;;; Code:
@@ -318,14 +319,10 @@ Commands:
(defun iedit-start (occurrence-exp)
"Start an iedit for the occurrence-exp in the current buffer."
- (setq iedit-mode (propertize " Iedit" 'face 'font-lock-warning-face))
(setq iedit-occurrences-overlays nil)
(setq iedit-unmatched-lines-invisible
iedit-unmatched-lines-invisible-default)
(setq iedit-case-sensitive iedit-case-sensitive-default)
- (force-mode-line-update)
- (run-hooks 'iedit-mode-hook)
- ;; (add-hook 'mouse-leave-buffer-hook 'iedit-done)
- (add-hook 'kbd-macro-termination-hook 'iedit-done)
+ (setq iedit-aborting nil)
;; Find and record each occurrence's markers and add the overlay to the
occurrences
(let ((counter 0)
(case-fold-search (not iedit-case-sensitive)))
@@ -334,15 +331,25 @@ Commands:
(while (re-search-forward occurrence-exp nil t)
(push (iedit-make-occurrence-overlay (match-beginning 0) (match-end 0))
iedit-occurrences-overlays)
- (setq counter (1+ counter))) ; at less 1
- (setq iedit-occurrences-overlays (nreverse iedit-occurrences-overlays))
- (if iedit-unmatched-lines-invisible
- (iedit-hide-unmatched-lines))
+ (setq counter (1+ counter)))
+ (if (= 0 counter)
+ (error "0 matches for \"%s\""
+ (if (> (length occurrence-exp) 50)
+ (concat (substring occurrence-exp 0 50) "...")
+ occurrence-exp))
+ (setq iedit-occurrences-overlays (nreverse iedit-occurrences-overlays))
+ (if iedit-unmatched-lines-invisible
+ (iedit-hide-unmatched-lines)))
(message "%d matches for \"%s\""
counter
(if (> (length occurrence-exp) 50)
(concat (substring occurrence-exp 0 50) "...")
- occurrence-exp)))))
+ occurrence-exp))))
+ (setq iedit-mode (propertize " Iedit" 'face 'font-lock-warning-face))
+ (force-mode-line-update)
+ (run-hooks 'iedit-mode-hook)
+ ;; (add-hook 'mouse-leave-buffer-hook 'iedit-done)
+ (add-hook 'kbd-macro-termination-hook 'iedit-done))
(defun iedit-reset-aborting ()
"Turning iedit-mode off and reset iedit-aborting. `iedit-done'
- [nongnu] elpa/iedit e6f558539e 025/301: fix org-mode text-property compatibility (use insert-and-inherit), (continued)
- [nongnu] elpa/iedit e6f558539e 025/301: fix org-mode text-property compatibility (use insert-and-inherit), ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 039c0e23ab 023/301: Postpone iedit-done after commands are excuted., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c5a0d4de84 028/301: fix zero-width rectangle insertion, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 13ecba138a 026/301: Merge branch 'upstream-master', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1d070b7d36 029/301: move init code for iedit-mode-map inside defvar, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a75c44645a 031/301: fix bug with autopair and iedit-rect, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 20c1075948 032/301: remove conditions on setting `iedit-before-modification-string'., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c4091203ea 033/301: Merge pull request #3 from lewang/master, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b81b9d6025 034/301: Clean code., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 17ce97381b 035/301: Clean up code, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9b3aaa8f21 037/301: Fix occurrence from history does not exist problem,
ELPA Syncer <=
- [nongnu] elpa/iedit b9ebb768b7 190/301: Merge pull request #60 from danrharms/issue-59-hotfix, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f7b2d60989 167/301: Make occurrence string the latest kill in the kill ring, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c25992ef7f 199/301: Fix doc strings, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 19f35aa1a0 172/301: Change the default key binding for `iedit-rectangle-mode' to c-x-r-ret, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4864e17126 010/301: Merge remote-tracking branch 'tsdh/master', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit fc71952cf9 014/301: Boolean `t', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit df6c2ad919 017/301: fix search to use regexp-quote when needed, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 30971294b2 071/301: Remove a limitation of empty occurrence string, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit df9e958703 082/301: Add more short-cut to iedit on function, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 06fac017b4 087/301: explain what "quite different" means in rectangle context in README, ELPA Syncer, 2022/01/10