[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors da2a9ab 298/434: Add mc/mark-all-in-regio
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors da2a9ab 298/434: Add mc/mark-all-in-region-regexp |
Date: |
Sat, 7 Aug 2021 09:20:46 -0400 (EDT) |
branch: elpa/multiple-cursors
commit da2a9abfd84045701048e0b2e28c5e1e8430531b
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Add mc/mark-all-in-region-regexp
Thanks to Gabriel Antonioli :-)
---
mc-mark-more.el | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index ef4b877..45a87fc 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -292,6 +292,28 @@ With zero ARG, skip the last one and mark next."
(multiple-cursors-mode 1)
(multiple-cursors-mode 0))))))
+;;;###autoload
+(defun mc/mark-all-in-region-regexp (beg end)
+ "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))
+ (if (string= search "")
+ (message "Mark aborted")
+ (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 ((first (mc/furthest-cursor-before-point)))
+ (if (not first)
+ (error "Search failed for %S" search)
+ (mc/pop-state-from-overlay first)))
+ (if (> (mc/num-cursors) 1)
+ (multiple-cursors-mode 1)
+ (multiple-cursors-mode 0))))))
+
(when (not (fboundp 'set-temporary-overlay-map))
;; Backport this function from newer emacs versions
(defun set-temporary-overlay-map (map &optional keep-pred)
- [nongnu] elpa/multiple-cursors 6745142 250/434: Move from Carton to Cask, (continued)
- [nongnu] elpa/multiple-cursors 6745142 250/434: Move from Carton to Cask, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors bf01772 230/434: Use phi-search for C-s in mc-mode when available., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 186cb3b 255/434: Release 1.2.3, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c94eca5 254/434: Fix broken let binding, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d8c5227 268/434: Merge pull request #103 from mathrick/compat-24.2, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 239acbf 281/434: Skip folded lines with mc/edit-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5cd6ddf 293/434: Merge pull request #125 from kyanagi/fix-cycle-cursors-on-edge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d1ad51f 296/434: Gitignore *.elc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a3e6ec7 297/434: Merge pull request #135 from jistr/gitignore_elc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fc39dab 299/434: Adds jedi-mode to list of unsupported minor modes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors da2a9ab 298/434: Add mc/mark-all-in-region-regexp,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 7ddda85 312/434: Added vertical align commands, ELPA Syncer, 2021/08/07
- [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