[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 52c4865e5b 197/301: Add special prefix argument 1
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 52c4865e5b 197/301: Add special prefix argument 1 |
Date: |
Mon, 10 Jan 2022 22:59:02 -0500 (EST) |
branch: elpa/iedit
commit 52c4865e5b4784efa995aed27ec952fc784694d5
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Add special prefix argument 1
With digital prefix argument 1, Iedit mode is limited on the
current symbol or the active region, which means just one
instance is highlighted. This behavior serves as a start point
of incremental selection work flow.
---
iedit-lib.el | 5 +++--
iedit.el | 36 +++++++++++++++++++++++++-----------
2 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 70b34ff869..8c0f70b7f0 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2016-05-24 10:36:51 Victor Ren>
+;; Time-stamp: <2016-06-08 10:44:42 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -888,7 +888,8 @@ it just means mark is active."
(and (if iedit-transient-mark-sensitive
transient-mark-mode
t)
- mark-active (not (equal (mark) (point)))))
+ mark-active
+ (not (equal (mark) (point)))))
(defun iedit-barf-if-lib-active()
"Signal error if Iedit lib is active."
diff --git a/iedit.el b/iedit.el
index bb9c93d712..3b722ddf49 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2016-05-30 09:51:08 Victor Ren>
+;; Time-stamp: <2016-06-08 10:58:11 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.97
@@ -310,6 +310,11 @@ Iedit mode is turned off last time (might be in other
buffer) is
used as occurrence. If region active, Iedit mode is limited
within the current region.
+With digital prefix argument 1, Iedit mode is limited on the
+current symbol or the active region, which means just one
+instance is highlighted. This behavior serves as a start point
+of incremental selection work flow.
+
If Iedit mode is on and region is active, Iedit mode is
restricted in the region, e.g. the occurrences outside of the
region is excluded.
@@ -336,6 +341,7 @@ Keymap used within overlays:
(next-single-char-property-change 1 'read-only)
(point-min)))
(end (point-max)))
+ ;; Get the occurrence
(cond ((and arg
(= 4 (prefix-numeric-value arg))
iedit-last-occurrence-local)
@@ -354,15 +360,21 @@ Keymap used within overlays:
(when iedit-only-at-symbol-boundaries
(setq complete-symbol t)))
(t (error "No candidate of the occurrence, cannot enable Iedit
mode")))
+ ;; Get the scope
(when arg
- (if (= 0 (prefix-numeric-value arg))
- (save-excursion
- (mark-defun)
- (setq beg (region-beginning))
- (setq end (region-end)))
- (when (iedit-region-active)
- (setq beg (region-beginning))
- (setq end (region-end)))))
+ (cond ((= 0 (prefix-numeric-value arg))
+ (save-excursion
+ (mark-defun)
+ (setq beg (region-beginning))
+ (setq end (region-end))))
+ ((and (= 1 (prefix-numeric-value arg))
+ (not (iedit-region-active)))
+ (let ((region (bounds-of-thing-at-point 'symbol)))
+ (setq beg (car region))
+ (setq end (cdr region))))
+ ((iedit-region-active)
+ (setq beg (region-beginning))
+ (setq end (region-end)))))
(setq iedit-only-complete-symbol-local complete-symbol)
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)
@@ -591,7 +603,8 @@ prefix, bring the bottom of the region back up one
occurrence."
(progn (iedit-restrict-region
(iedit-first-occurrence)
(1- (iedit-last-occurrence)))
- (goto-char (iedit-last-occurrence)))
+ (when iedit-mode
+ (goto-char (iedit-last-occurrence))))
(iedit-expand-to-occurrence t)))
(defun iedit-expand-up-to-occurrence (&optional arg)
@@ -603,7 +616,8 @@ prefix, bring the top of the region back down one
occurrence."
(progn (iedit-restrict-region
(1+ (iedit-first-occurrence))
(+ (iedit-occurrence-string-length) (iedit-last-occurrence)))
- (goto-char (iedit-first-occurrence)))
+ (when iedit-mode
+ (goto-char (iedit-first-occurrence))))
(iedit-expand-to-occurrence nil)))
(defun iedit-expand-to-occurrence (forward)
- [nongnu] elpa/iedit c55fcd5bac 189/301: avoid error if iedit-toggle-key-default already bound to iedit-mode, (continued)
- [nongnu] elpa/iedit c55fcd5bac 189/301: avoid error if iedit-toggle-key-default already bound to iedit-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit adb0d2e92d 179/301: Expand to next occurence ("incremental select"), ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d25b655768 207/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d31bafa97c 171/301: Refactored for easier to show different messages, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 2d9017daea 181/301: Merge pull request #51 from jasminpatry/fix/restrict-current-line-resets-expand, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 048d8417cf 202/301: *** empty log message ***, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a8ab03848d 158/301: complete iedit-toggle-selection, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c0d108da3b 166/301: make the occurrence the latest kill in the kill ring, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d89ee51834 148/301: Merge branch 'redo-prs' of github.com:lewang/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit fd801e77df 165/301: Merge pull request #38 from mgalgs/narrow-around-current-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 52c4865e5b 197/301: Add special prefix argument 1,
ELPA Syncer <=
- [nongnu] elpa/iedit 8d20094a11 182/301: Use the original case in the iedit-replace default value, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1242c675d2 164/301: Add save-window-excursion, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b5a3415b00 180/301: Merge pull request #47 from zhenya1007/help-char-can-be-meta, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6019d3c376 170/301: defvar iedit-current-symbol, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 22f4729ae9 150/301: Add test case for iedit-hide-unmatched-lines, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4884f61a3b 188/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 607e82c7b0 208/301: rename `iedit-current-symbol` to `iedit-default-occurrence`, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1eabaa061a 210/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a6d8568379 161/301: Merge pull request #35 from lewang/ensure-skip-mofication-once, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 54b2495af7 214/301: More default occurrence types, ELPA Syncer, 2022/01/10