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

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

[nongnu] elpa/multiple-cursors 8dfe725 269/434: Abort immediately when e


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors 8dfe725 269/434: Abort immediately when empty search pattern is passed to 'mc/mark-all-in-region'
Date: Sat, 7 Aug 2021 09:20:40 -0400 (EDT)

branch: elpa/multiple-cursors
commit 8dfe725c4f9684e295b96f2820372766317d53fe
Author: Maciej Katafiasz <mathrick@gmail.com>
Commit: Maciej Katafiasz <mathrick@gmail.com>

    Abort immediately when empty search pattern is passed to 
'mc/mark-all-in-region'
---
 mc-mark-more.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mc-mark-more.el b/mc-mark-more.el
index 22110c6..e84d614 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -263,15 +263,16 @@ With zero ARG, skip the last one and mark next."
     (mc/mark-all-like-this)))
 
 ;;;###autoload
-(defun mc/mark-all-in-region (beg end)
+(defun* mc/mark-all-in-region (beg end)
   "Find and mark all the parts in the region matching the given search"
   (interactive "r")
   (let ((search (read-from-minibuffer "Mark all in region: "))
         (case-fold-search nil))
+    (when (string= search "")
+      (return-from mc/mark-all-in-region nil))
     (mc/remove-fake-cursors)
     (goto-char beg)
-    (while (and (not (string= search ""))
-                (search-forward search end t))
+    (while (search-forward search end t)
       (push-mark (match-beginning 0))
       (mc/create-fake-cursor-at-point))
     (let ((first (mc/furthest-cursor-before-point)))



reply via email to

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