[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 57beb10db5 141/301: Remove all the dependency to the
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 57beb10db5 141/301: Remove all the dependency to the order of iedit-occurrences-overlays |
Date: |
Mon, 10 Jan 2022 22:58:57 -0500 (EST) |
branch: elpa/iedit
commit 57beb10db5b7913093bb435c2f36b719168f0530
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Remove all the dependency to the order of iedit-occurrences-overlays
Now iedit-ocurrences-overlays are no long sorted
---
iedit-lib.el | 27 +++++++++++----------------
iedit-rect.el | 15 +++++++++------
iedit-tests.el | 3 +--
3 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 4e525cd06a..0b7d7b305c 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-12-08 23:35:32 Victor Ren>
+;; Time-stamp: <2012-12-09 00:42:28 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -77,8 +77,7 @@ mode, set it as nil."
"The occurrences slot contains a list of overlays used to
indicate the position of each editable occurrence. In addition, the
occurrence overlay is used to provide a different face
-configurable via `iedit-occurrence'. The list is sorted by
-the position of overlays.") ;todo remove sort
+configurable via `iedit-occurrence'.")
(defvar iedit-read-only-occurrences-overlays nil
"The occurrences slot contains a list of overlays used to
@@ -216,8 +215,7 @@ Return the number of occurrences."
iedit-occurrences-overlays))
(setq counter (1+ counter))))
(message "%d matches for \"%s\"" counter (iedit-printable
occurrence-regexp))
- (when (/= 0 counter) ;todo: remove nreverse
- (setq iedit-occurrences-overlays (nreverse iedit-occurrences-overlays))
+ (when (/= 0 counter)
(if iedit-unmatched-lines-invisible
(iedit-hide-unmatched-lines iedit-occurrence-context-lines))))
counter))
@@ -247,9 +245,6 @@ Return the number of occurrences."
(push (iedit-make-occurrence-overlay (match-beginning 0)
(match-end 0))
iedit-occurrences-overlays)
- (sort iedit-occurrences-overlays
- (lambda (left right)
- (< (overlay-start left) (overlay-start right))))
(message "Add one match for \"%s\"" (iedit-printable occurrence-exp))
(if iedit-unmatched-lines-invisible
(iedit-hide-unmatched-lines iedit-occurrence-context-lines))))))
@@ -271,9 +266,7 @@ there are."
(error "Conflict region."))
(push (iedit-make-occurrence-overlay beg end)
iedit-occurrences-overlays)
- (sort iedit-occurrences-overlays
- (lambda (left right)
- (< (overlay-start left) (overlay-start right)))))) ;; todo test
this function
+ )) ;; todo test this function
(defun iedit-cleanup ()
"Clean up occurrence overlay, invisible overlay and local variables."
@@ -710,12 +703,14 @@ FORMAT."
(let ((iedit-number-occurrence-counter start-at)
(inhibit-modification-hooks t))
(save-excursion
- (dolist (occurrence iedit-occurrences-overlays)
- (goto-char (overlay-start occurrence))
+ (iedit-first-occurrence)
+ (while (/= (point) (point-max))
(insert (format format-string iedit-number-occurrence-counter))
- (iedit-move-conjoined-overlays occurrence)
+ (iedit-move-conjoined-overlays (iedit-find-current-occurrence-overlay))
(setq iedit-number-occurrence-counter
- (1+ iedit-number-occurrence-counter))))))
+ (1+ iedit-number-occurrence-counter))
+ (goto-char (next-single-char-property-change (point)
'iedit-occurrence-overlay-name))
+ (goto-char (next-single-char-property-change (point)
'iedit-occurrence-overlay-name))))))
;;; help functions
@@ -813,7 +808,7 @@ Return nil if occurrence string is empty string."
(dolist (overlay iedit-occurrences-overlays)
(if (overlay-buffer overlay)
(push overlay overlays)))
- (setq iedit-occurrences-overlays (nreverse overlays))))
+ (setq iedit-occurrences-overlays overlays)))
(defun iedit-printable (string)
"Return a omitted substring that is not longer than 50.
diff --git a/iedit-rect.el b/iedit-rect.el
index a668956c9a..95d2c88e7d 100644
--- a/iedit-rect.el
+++ b/iedit-rect.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-09-05 09:49:55 Victor Ren>
+;; Time-stamp: <2012-12-09 00:34:58 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -125,10 +125,12 @@ Commands:
iedit-occurrences-overlays)
(forward-line 1))
until (> (point) end))
- (setq iedit-occurrences-overlays (nreverse iedit-occurrences-overlays))))
- (setq iedit-rectangle-mode (propertize
- (concat " Iedit-rect:" (number-to-string (length
iedit-occurrences-overlays)))
- 'face 'font-lock-warning-face))
+ ))
+ (setq iedit-rectangle-mode
+ (propertize
+ (concat " Iedit-rect:"
+ (number-to-string (length iedit-occurrences-overlays)))
+ 'face 'font-lock-warning-face))
(force-mode-line-update)
(add-hook 'kbd-macro-termination-hook 'iedit-rectangle-done nil t)
(add-hook 'change-major-mode-hook 'iedit-rectangle-done nil t)
@@ -154,7 +156,8 @@ The behavior is the same as `kill-rectangle' in rect mode."
(or (and iedit-rectangle (iedit-same-column))
(error "Not a rectangle"))
(let ((inhibit-modification-hooks t)
- (beg (overlay-start (car iedit-occurrences-overlays)))
+ (beg (overlay-start (progn (iedit-first-occurrence)
+ (iedit-find-current-occurrence-overlay))))
(end (overlay-end (progn (iedit-last-occurrence)
(iedit-find-current-occurrence-overlay)))))
(kill-rectangle beg end fill)))
diff --git a/iedit-tests.el b/iedit-tests.el
index 9a68798550..8bb59eeaae 100644
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-12-08 23:40:48 Victor Ren>
+;; Time-stamp: <2012-12-09 00:11:33 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Version: 0.97
;; X-URL: http://www.emacswiki.org/emacs/Iedit
@@ -567,7 +567,6 @@ abcd"
"12345678901234567890123456789012345678901234567890...")))
;; ;; replace-match
;; text-property-not-all
;; iedit-make-occurrence-overlay
-;; nreverse
;; iedit-make-occurrences-overlays
;; match-beginning
;; match-end
- [nongnu] elpa/iedit 61689f6ba4 057/301: Add arg handle for iedit-mode to exclude some occurrences., (continued)
- [nongnu] elpa/iedit 61689f6ba4 057/301: Add arg handle for iedit-mode to exclude some occurrences., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7479d4c947 079/301: Merge branch 'topic/multi-interface', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6cc86d58e6 086/301: Merge pull request #6 from gorakhargosh/master, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4cf803d9cb 092/301: Skip the first occurrence for occur-edit-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c5ab2c593d 094/301: Avoid to restore Iedit mode when restoring desktop, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 95eb44ee30 117/301: Add new function iedit-add-next-occurrence-overlay, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b94c75e8c6 107/301: Move iedit-help-keymap to iedit.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 84896f8be0 104/301: *** empty log message ***, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 962fcdb6cd 124/301: Fix failed test cases, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6d16d92a5a 112/301: replace iedit-occurrence-face with real face, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 57beb10db5 141/301: Remove all the dependency to the order of iedit-occurrences-overlays,
ELPA Syncer <=
- [nongnu] elpa/iedit 4efe511684 128/301: allow iedit-rectangle-mode to take beg end programatically, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e48b52e353 185/301: Merge branch 'incremental-select' of git://github.com/bmag/iedit into bmag-incremental-select, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 668ea99c51 195/301: Allow prefix for expand functions, ELPA Syncer, 2022/01/10
- [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