emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/iedit c2763baaf6 168/301: Do not enable iedit from a faili


From: ELPA Syncer
Subject: [nongnu] elpa/iedit c2763baaf6 168/301: Do not enable iedit from a failing isearch
Date: Mon, 10 Jan 2022 22:59:00 -0500 (EST)

branch: elpa/iedit
commit c2763baaf6c6ac3c3d8574a537c3572ef84bae8f
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>

    Do not enable iedit from a failing isearch
---
 iedit-lib.el   |  4 ++--
 iedit-tests.el | 33 +++++++++++++++++----------------
 iedit.el       |  7 +++++--
 3 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/iedit-lib.el b/iedit-lib.el
index abd3ba624e..c8dbdc00a2 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
 
 ;; Copyright (C) 2010, 2011, 2012 Victor Ren
 
-;; Time-stamp: <2013-03-02 22:41:36 Victor Ren>
+;; Time-stamp: <2013-06-05 14:22:21 Victor Ren>
 ;; Author: Victor Ren <victorhge@gmail.com>
 ;; Keywords: occurrence region simultaneous rectangle refactoring
 ;; Version: 0.97
@@ -244,7 +244,7 @@ Return the number of occurrences."
       (if (not (if forward
                    (re-search-forward occurrence-exp nil t)
                  (re-search-backward occurrence-exp nil t)))
-          (message "No matches.")
+          (message "No match")
         (if (or (iedit-find-overlay-at-point (match-beginning 0) 
'iedit-occurrence-overlay-name)
                 (iedit-find-overlay-at-point (match-end 0) 
'iedit-occurrence-overlay-name))
             (error "Conflict region"))
diff --git a/iedit-tests.el b/iedit-tests.el
index f20cd8dac3..3ac559734f 100644
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2010, 2011, 2012 Victor Ren
 
-;; Time-stamp: <2013-02-09 00:54:03 Victor Ren>
+;; Time-stamp: <2013-02-26 13:36:47 Victor Ren>
 ;; Author: Victor Ren <victorhge@gmail.com>
 ;; Version: 0.97
 ;; X-URL: http://www.emacswiki.org/emacs/Iedit
@@ -635,21 +635,22 @@ foo"
      (iedit-show-all)
      (should (equal (iedit-hide-unmatched-lines 3) nil)))))
 
-;; (elp-instrument-list '(;; insert-and-inherit
-;;                        ;; delete-region
-;;                        ;; goto-char
-;;                        ;; iedit-occurrence-update
-;;                        ;; buffer-substring-no-properties
-;;                        ;; string=
-;;                        re-search-forward
-;;                        ;; replace-match
-;;                        text-property-not-all
-;;                        iedit-make-occurrence-overlay
-;;                        iedit-make-occurrences-overlays
-;;                        match-beginning
-;;                        match-end
-;;                        push
-;;                        ))
+;; todo add a auto performance test
+(setq elp-function-list '(;; insert-and-inherit
+                       ;; delete-region
+                       ;; goto-char
+                       ;; iedit-occurrence-update
+                       ;; buffer-substring-no-properties
+                       ;; string=
+                       re-search-forward
+                       ;; replace-match
+                       text-property-not-all
+                       iedit-make-occurrence-overlay
+                       iedit-make-occurrences-overlays
+                       match-beginning
+                       match-end
+                       push
+                       ))
 
 
 ;;; iedit-tests.el ends here
diff --git a/iedit.el b/iedit.el
index bb0a4e320d..2a360abbbc 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2010, 2011, 2012 Victor Ren
 
-;; Time-stamp: <2013-06-04 14:25:26 Victor Ren>
+;; Time-stamp: <2013-06-05 14:18:33 Victor Ren>
 ;; Author: Victor Ren <victorhge@gmail.com>
 ;; Keywords: occurrence region simultaneous refactoring
 ;; Version: 0.97
@@ -357,6 +357,8 @@ Keymap used within overlays:
 
 (defun iedit-mode-from-isearch (regexp)
   "Start Iedit mode using last search string as the regexp."
+  (or isearch-success
+      (error "No match" ))
   (interactive
    (let ((regexp (cond
                   ((functionp isearch-word)
@@ -424,7 +426,8 @@ the initial string globally."
   (setq iedit-last-occurrence-local (iedit-current-occurrence-string))
   (setq iedit-last-occurrence-global iedit-last-occurrence-local)
   (setq iedit-last-initial-string-global iedit-initial-string-local)
-  (kill-new iedit-last-occurrence-local) ; Make occurrence the latest kill in 
the kill ring.
+  (if iedit-last-occurrence-local
+      (kill-new iedit-last-occurrence-local)) ; Make occurrence the latest 
kill in the kill ring.
   (setq iedit-num-lines-to-expand-up 0)
   (setq iedit-num-lines-to-expand-down 0)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]