[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 06a2985 362/434: * mc-mark-more.el (mc/ma
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 06a2985 362/434: * mc-mark-more.el (mc/mark-all-in-region-regexp): Don't infloop when regexp matches empty string |
Date: |
Sat, 7 Aug 2021 09:21:00 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 06a2985db00663567f44c6b53bed6cb8b5d7a4ca
Author: Nicolas Richard <youngfrog@members.fsf.org>
Commit: Nicolas Richard <youngfrog@members.fsf.org>
* mc-mark-more.el (mc/mark-all-in-region-regexp): Don't infloop when regexp
matches empty string
---
mc-mark-more.el | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index 02a67f4..ab72a82 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -347,7 +347,7 @@ With zero ARG, skip the last one and mark next."
;;;###autoload
(defun mc/mark-all-in-region-regexp (beg end)
- "Find and mark all the parts in the region matching the given regexp"
+ "Find and mark all the parts in the region matching the given regexp."
(interactive "r")
(let ((search (read-regexp "Mark regexp in region: "))
(case-fold-search nil))
@@ -356,9 +356,17 @@ With zero ARG, skip the last one and mark next."
(progn
(mc/remove-fake-cursors)
(goto-char beg)
- (while (search-forward-regexp search end t)
- (push-mark (match-beginning 0))
- (mc/create-fake-cursor-at-point))
+ (let ((lastmatch))
+ (while (and (< (point) end) ; can happen because of (forward-char)
+ (search-forward-regexp search end t))
+ (push-mark (match-beginning 0))
+ (mc/create-fake-cursor-at-point)
+ (setq lastmatch (point))
+ (when (= (point) (match-beginning 0))
+ (forward-char)))
+ (when lastmatch (goto-char lastmatch)))
+ (when (> (mc/num-cursors) 0)
+ (goto-char (match-end 0)))
(let ((first (mc/furthest-cursor-before-point)))
(if (not first)
(error "Search failed for %S" search)
- [nongnu] elpa/multiple-cursors 912342e 315/434: Add missing ###autoload markers, (continued)
- [nongnu] elpa/multiple-cursors 912342e 315/434: Add missing ###autoload markers, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 66eefa2 317/434: Add cperl-electric-backspace to default run-for-all list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dc1bfbf 325/434: Add cua-delete-region to default run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 89e360e 333/434: Merge pull request #193 from dovej/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4969d38 331/434: Move mc/list-file to the user-emacs-directory, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 49c9f7f 340/434: Merge remote-tracking branch 'upstream/master', ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9b53e89 344/434: Merge pull request #203 from dovej/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ca822cd 347/434: Add mc/insert-letters function and test cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 54c05c3 356/434: Add more aliases for cl stuff, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 40eb74e 357/434: Extend mc/add-cursor-on-click to toggle fake cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 06a2985 362/434: * mc-mark-more.el (mc/mark-all-in-region-regexp): Don't infloop when regexp matches empty string,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 4bf9860 364/434: Use cl-lib instead of shimming, which breaks in older emacsen, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d5b544e 365/434: Merge pull request #246 from purcell/cl-lib, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b3bd49c 372/434: Bump version to 1.4.0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 741eec6 374/434: Update some copyright years, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a9daac1 375/434: Add/fix docstring to functions. fix #161, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors be149f9 378/434: Create customizable mc/insert-numbers-default, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fd847ae 379/434: added mc/always-run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 2ccfc74 382/434: Merge pull request #252 from bb2020/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 616fd84 395/434: Add ivy-done (from ivy) to the list of commands that are only executed once by default., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6d8c6fc 389/434: Pass tests., ELPA Syncer, 2021/08/07