[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit c7abe595b4 159/301: Remove confusing messages "Locat
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit c7abe595b4 159/301: Remove confusing messages "Locate the fist occurrence" |
Date: |
Mon, 10 Jan 2022 22:58:59 -0500 (EST) |
branch: elpa/iedit
commit c7abe595b4b0f8c2c4f80425e1f060cb4087e44c
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Remove confusing messages "Locate the fist occurrence"
Fix failed testcases
---
iedit-lib.el | 45 ++++++++++++++++++++++++++-------------------
iedit-rect.el | 11 ++++-------
iedit-tests.el | 6 +++---
3 files changed, 33 insertions(+), 29 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 523a74e9d8..d52731f4ee 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-02-03 15:25:22 Victor Ren>
+;; Time-stamp: <2013-02-08 22:09:19 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -172,8 +172,8 @@ is not applied to other occurrences when it is true.")
(define-key map (kbd "M-D") 'iedit-delete-occurrences)
(define-key map (kbd "M-N") 'iedit-number-occurrences)
(define-key map (kbd "M-B") 'iedit-toggle-buffering)
- (define-key map (kbd "M-<") 'iedit-first-occurrence)
- (define-key map (kbd "M->") 'iedit-last-occurrence)
+ (define-key map (kbd "M-<") 'iedit-goto-first-occurrence)
+ (define-key map (kbd "M->") 'iedit-goto-last-occurrence)
(define-key map (kbd "C-?") 'iedit-help-for-occurrences)
map)
"Default keymap used within occurrence overlays.")
@@ -193,8 +193,8 @@ It should be set before occurrence overlay is created.")
(substitute-command-keys "\\[iedit-delete-occurrences]")
":delete "
(substitute-command-keys "\\[iedit-number-occurrences]")
":number "
(substitute-command-keys "\\[iedit-toggle-buffering]")
":buffering "
- (substitute-command-keys "\\[iedit-first-occurrence]") "/"
- (substitute-command-keys "\\[iedit-last-occurrence]")
":first/last "
+ (substitute-command-keys "\\[iedit-goto-first-occurrence]")
"/"
+ (substitute-command-keys "\\[iedit-goto-last-occurrence]")
":first/last "
)))
(defun iedit-make-occurrences-overlays (occurrence-regexp beg end)
@@ -465,26 +465,33 @@ the buffer."
(when iedit-forward-success
(goto-char pos))))
-(defun iedit-first-occurrence ()
+(defun iedit-goto-first-occurrence ()
"Move to the first occurrence."
(interactive)
- (let ((pos (if (get-char-property (point-min) 'iedit-occurrence-overlay-name)
- (point-min)
- (next-single-char-property-change
- (point-min) 'iedit-occurrence-overlay-name))))
- (setq iedit-forward-success t)
- (goto-char pos)
- (message "Located the first occurrence.")))
+ (goto-char (iedit-first-occurrence))
+ (setq iedit-forward-success t)
+ (message "Located the first occurrence."))
-(defun iedit-last-occurrence ()
+(defun iedit-first-occurrence ()
+ "return the position of the first occurrence."
+ (if (get-char-property (point-min) 'iedit-occurrence-overlay-name)
+ (point-min)
+ (next-single-char-property-change
+ (point-min) 'iedit-occurrence-overlay-name)))
+
+(defun iedit-goto-last-occurrence ()
"Move to the last occurrence."
(interactive)
+ (goto-char (iedit-last-occurrence))
+ (setq iedit-forward-success t)
+ (message "Located the last occurrence."))
+
+(defun iedit-last-occurrence ()
+ "return the position of the last occurrence."
(let ((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)))
- (setq iedit-forward-success t)
- (goto-char pos)
- (message "Located the last occurrence.")))
+ pos))
(defun iedit-toggle-unmatched-lines-visible (&optional arg)
"Toggle whether to display unmatched lines.
@@ -523,7 +530,7 @@ value of `iedit-occurrence-context-lines' is used for this
time."
(let ((prev-occurrence-end 1)
(unmatched-lines nil))
(save-excursion
- (iedit-first-occurrence)
+ (goto-char (iedit-first-occurrence))
(while (/= (point) (point-max))
;; Now at the beginning of an occurrence
(let ((current-start (point)))
@@ -712,7 +719,7 @@ FORMAT."
(let ((iedit-number-occurrence-counter start-at)
(inhibit-modification-hooks t))
(save-excursion
- (iedit-first-occurrence)
+ (goto-char (iedit-first-occurrence))
(while (/= (point) (point-max))
(insert (format format-string iedit-number-occurrence-counter))
(iedit-move-conjoined-overlays (iedit-find-current-occurrence-overlay))
diff --git a/iedit-rect.el b/iedit-rect.el
index 83eae808d3..e51032fc8c 100644
--- a/iedit-rect.el
+++ b/iedit-rect.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-02-04 01:35:54 Victor Ren>
+;; Time-stamp: <2013-02-09 00:55:45 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -158,12 +158,9 @@ The behavior is the same as `kill-rectangle' in rect mode."
(interactive "*P")
(or (and iedit-rectangle (iedit-same-column))
(error "Not a rectangle"))
- (let ((inhibit-modification-hooks t)
- (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)))
+ (let ((inhibit-modification-hooks t))
+ (kill-rectangle (marker-position (car iedit-rectangle))
+ (marker-position (cadr iedit-rectangle)) fill)))
(provide 'iedit-rect)
diff --git a/iedit-tests.el b/iedit-tests.el
index 046352b1e5..f20cd8dac3 100644
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-02-01 00:10:47 Victor Ren>
+;; Time-stamp: <2013-02-09 00:54:03 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Version: 0.97
;; X-URL: http://www.emacswiki.org/emacs/Iedit
@@ -244,9 +244,9 @@ fob")))))
barfoo
foo "
(lambda ()
- (iedit-last-occurrence)
+ (iedit-goto-last-occurrence)
(should (= (point) 24))
- (iedit-first-occurrence)
+ (iedit-goto-first-occurrence)
(should (= (point) 1))
(iedit-next-occurrence)
(should (= (point) 7))
- [nongnu] elpa/iedit a089103fa0 110/301: Fix typoes, (continued)
- [nongnu] elpa/iedit a089103fa0 110/301: Fix typoes, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 66ca4f9595 125/301: Merge pull request #21 from lewang/fix-overlay-at-eob, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 541eab7b6b 108/301: Add document for iedit-rectangle-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4b1416f83f 131/301: refactor out common test code in "test-util", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit ceb729863b 153/301: Update iedit-lib.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b3ebd84769 137/301: Merge pull request #29 from jorgenschaefer/elpa-package, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 27de77eda5 133/301: add test to ensure padding of EOL happens to make up rectangle, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7a35f3bd06 157/301: Add overlay priority option, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c274e6423b 200/301: Quit iedit mode if the number of occurrence is zero, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8c2316693a 198/301: Fix bug: C-u M-p does not work, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c7abe595b4 159/301: Remove confusing messages "Locate the fist occurrence",
ELPA Syncer <=
- [nongnu] elpa/iedit 2fe78a5ec9 201/301: Remove two confusing options, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f707cce0b8 193/301: Remove the key binding to M-[, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f9f87a0dd9 212/301: Add key bindings for iedit-quit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b4c7e41049 209/301: More doc for iedit-switch-to-mc-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 18b99c1fb4 169/301: Fix compile warning and test case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit bd3fd44691 173/301: Added the default value for iedit-replace-occurrences, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b73b977839 204/301: Merge branch 'default-occurrence', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6e6d4bc478 151/301: Merge branch 'master' of https://github.com/mbneedham/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 06bdb68bbf 203/301: Add iedit-switch-to-mc-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b2bffd978c 184/301: Merge pull request #54 from Vifon/iedit-replace-occurences_default-case, ELPA Syncer, 2022/01/10