[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 4864e17126 010/301: Merge remote-tracking branch 'ts
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 4864e17126 010/301: Merge remote-tracking branch 'tsdh/master' |
Date: |
Mon, 10 Jan 2022 22:58:45 -0500 (EST) |
branch: elpa/iedit
commit 4864e17126bd952995ecec55fa056b1351a1efc5
Merge: 69d6c03e06 8e87f353fe
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Merge remote-tracking branch 'tsdh/master'
---
iedit.el | 40 ++++++++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/iedit.el b/iedit.el
index f8a9074b6b..360f738fd5 100644
--- a/iedit.el
+++ b/iedit.el
@@ -4,6 +4,7 @@
;; Time-stamp: <2012-01-14 23:12:48 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
+;; Contributors: Tassilo Horn <tassilo@member.fsf.org>
;; Keywords: occurrence region replace simultaneous
;; Version: 0.90
;; X-URL: http://www.emacswiki.org/emacs/iedit.el
@@ -30,7 +31,7 @@
;; This package provides a more intuitive way of replace-string operation:
;;
;; - Select the occurrence in the buffer
-;; In Transient Mark mode, just mark a region, the content of the
+;; In Transient Mark mode, just mark a region, the content of the
;; region will be used as the occurrence. (if Transient Mark mode is
disabled,
;; using C-u C-x C-x or C-SPC C-SPC to activate it just for this one time).
;;
@@ -90,6 +91,14 @@
:type 'boolean
:group 'iedit)
+(defcustom iedit-only-at-word-boundaries t
+ "If no-nil, matches have to start and end at work boundaries.
+ For example, when invoking iedit-mode on the \"in\" in the
+ sentence \"The king in the castle...\", the \"king\" is not
+ edited."
+ :type 'boolean
+ :group 'iedit)
+
(defcustom iedit-unmatched-lines-invisible-default nil
"If no-nil, hide lines that do not cover any occurrences by
default."
@@ -108,7 +117,7 @@ default."
(or (assq 'iedit-mode minor-mode-alist)
(nconc minor-mode-alist
- (list '(iedit-mode iedit-mode))))
+ (list '(iedit-mode iedit-mode))))
(defvar iedit-occurrences-overlays nil
"The occurrences slot contains a list of overlays used to
@@ -262,8 +271,8 @@ Commands:
(deactivate-mark)
(iedit-start occurrence))))
-(defun iedit-start (occurrence-exp)
- "Start an iedit for the occurrence-exp in the current buffer."
+(defun iedit-start (occurrence)
+ "Start an iedit for the occurrence in the current buffer."
(setq iedit-mode " Iedit")
(setq iedit-occurrences-overlays nil)
(setq iedit-unmatched-lines-invisible
iedit-unmatched-lines-invisible-default)
@@ -274,18 +283,21 @@ Commands:
(add-hook 'kbd-macro-termination-hook 'iedit-done)
;; Find and record each occurrence's markers and add the overlay to the
occurrences
(let ((counter 0)
- (case-fold-search (not iedit-case-sensitive)))
+ (case-fold-search (not iedit-case-sensitive))
+ (occurrence-exp (regexp-quote occurrence)))
(save-excursion
+ (when iedit-only-at-word-boundaries
+ (setq occurrence-exp (concat "\\<" occurrence-exp "\\>")))
(goto-char (point-min))
- (while (search-forward occurrence-exp nil t)
+ (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))
- (message "%d matches for \"%s\""
- counter
+ (message "%d matches for \"%s\""
+ counter
(if (> (length occurrence-exp) 50)
(concat (substring occurrence-exp 0 50) "...")
occurrence-exp)))))
@@ -314,8 +326,8 @@ Commands:
(defun iedit-done ()
"Exit iedit mode."
(let ((ov (car iedit-occurrences-overlays)))
- (if ov
- (setq iedit-last-occurrence-in-history
+ (if ov
+ (setq iedit-last-occurrence-in-history
(buffer-substring (overlay-start ov) (overlay-end ov)))))
(remove-overlays (point-min) (point-max) iedit-occurrence-overlay-name t)
(remove-overlays (point-min) (point-max) iedit-invisible-overlay-name t)
@@ -375,13 +387,13 @@ beginning of the buffer."
(when in-occurrence
(setq pos (next-single-char-property-change pos
'iedit-occurrence-overlay-name)))
(setq pos (next-single-char-property-change pos
'iedit-occurrence-overlay-name))
-
+
(if (/= pos (point-max))
(setq iedit-forward-success t)
(if (and iedit-forward-success in-occurrence)
(progn (message "This is the last occurrence.")
(setq iedit-forward-success nil))
- (progn
+ (progn
(if (get-char-property (point-min) 'iedit-occurrence-overlay-name)
(setq pos (point-min))
(setq pos (next-single-char-property-change (point-min)
'iedit-occurrence-overlay-name)))
@@ -404,12 +416,12 @@ the buffer."
;; At the start of the first occurrence
(if (or (and (eq pos (point-min))
(not (get-char-property (point-min)
'iedit-occurrence-overlay-name)))
- (and (eq (point) (point-min))
+ (and (eq (point) (point-min))
in-occurrence))
(if (and iedit-forward-success in-occurrence)
(progn (message "This is the first occurrence.")
(setq iedit-forward-success nil))
- (progn
+ (progn
(setq pos (previous-single-char-property-change (point-max)
'iedit-occurrence-overlay-name))
(if (not (get-char-property (- (point-max) 1)
'iedit-occurrence-overlay-name))
(setq pos (previous-single-char-property-change pos
'iedit-occurrence-overlay-name)))
- [nongnu] elpa/iedit a75c44645a 031/301: fix bug with autopair and iedit-rect, (continued)
- [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, 2022/01/10
- [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 <=
- [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
- [nongnu] elpa/iedit 1d32922c04 089/301: Run after-change-functions hook for every occurrence, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c935255053 083/301: minor change, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d29bf65e5e 096/301: Do not update mode line when buffering modification, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1c410fc2b8 101/301: Fix iedit-number-occurrences with conjointed occurrences problem, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 73a5884b4c 126/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10