[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 00aea4c 289/434: Show appropriate error m
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 00aea4c 289/434: Show appropriate error messages on trying skipping/unmarking commands with no fake cursors |
Date: |
Sat, 7 Aug 2021 09:20:44 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 00aea4c9d741be9650c917de17e402713f8fa3bf
Author: Kouhei Yanagita <yanagi@shakenbu.org>
Commit: Kouhei Yanagita <yanagi@shakenbu.org>
Show appropriate error messages on trying skipping/unmarking commands with
no fake cursors
---
mc-mark-more.el | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index c957ce8..ef4b877 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -107,17 +107,19 @@ Use like case-fold-search, don't recommend setting it
globally.")
(match-point-getter (ecase direction
(forwards 'match-beginning)
(backwards 'match-end))))
- (mc/save-excursion
- (goto-char start-char)
- (when skip-last
- (mc/remove-fake-cursor furthest-cursor))
- (if (funcall search-function re nil t)
- (progn
- (push-mark (funcall match-point-getter 0))
- (when point-out-of-order
- (exchange-point-and-mark))
- (mc/create-fake-cursor-at-point))
- (error "no more matches found.")))))
+ (if (and skip-last (not furthest-cursor))
+ (error "No cursors to be skipped")
+ (mc/save-excursion
+ (goto-char start-char)
+ (when skip-last
+ (mc/remove-fake-cursor furthest-cursor))
+ (if (funcall search-function re nil t)
+ (progn
+ (push-mark (funcall match-point-getter 0))
+ (when point-out-of-order
+ (exchange-point-and-mark))
+ (mc/create-fake-cursor-at-point))
+ (error "no more matches found."))))))
;;;###autoload
(defun mc/mark-next-like-this (arg)
@@ -127,7 +129,10 @@ With zero ARG, skip the last one and mark next."
(interactive "p")
(if (region-active-p)
(if (< arg 0)
- (mc/remove-fake-cursor (mc/furthest-cursor-after-point))
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
(mc/mark-more-like-this (= arg 0) 'forwards))
(mc/mark-lines arg 'forwards))
(mc/maybe-multiple-cursors-mode))
@@ -152,7 +157,10 @@ With zero ARG, skip the last one and mark next."
(interactive "p")
(if (region-active-p)
(if (< arg 0)
- (mc/remove-fake-cursor (mc/furthest-cursor-before-point))
+ (let ((cursor (mc/furthest-cursor-before-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
(mc/mark-more-like-this (= arg 0) 'backwards))
(mc/mark-lines arg 'backwards))
(mc/maybe-multiple-cursors-mode))
- [nongnu] elpa/multiple-cursors a374031 257/434: Add gnu repo to Cask, which is needed for cl-lib on Emacs <24.3, (continued)
- [nongnu] elpa/multiple-cursors a374031 257/434: Add gnu repo to Cask, which is needed for cl-lib on Emacs <24.3, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5e879f9 261/434: Guard against empty search pattern in 'mc/mark-all-in-region', otherwise it will enter an infinite loop, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors af66635 264/434: Make 'mc/mark-all-dwim' into 'mc/edit-lines' if prefix arg is passed, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 45ed43e 265/434: Test edit-lines functionality in 'mc/mark-all-dwim', ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 68dfa46 271/434: Merge pull request #109 from mathrick/fix-mark-all-in-region-hang, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 65c0c0c 275/434: Merge pull request #104 from mathrick/mark-all-dwim, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d17c89e 276/434: Release 1.3.0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ad79ad8 273/434: Mention only 'mc/mark-all-dwim' in README to prevent confusing redundancy, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 54e408f 279/434: Update README.md, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors aed5d59 287/434: fix compilation warnings (#66), ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 00aea4c 289/434: Show appropriate error messages on trying skipping/unmarking commands with no fake cursors,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors b3fd49c 306/434: Revert "Change file load timing", ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 38d6013 307/434: Merge pull request #156 from magnars/revert-152-master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 49fe803 316/434: Merge pull request #163 from Silex/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7cf6374 326/434: Typo fixo., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 142fdd6 337/434: Use locate-user-emacs-file to find directory for .mc-lists.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 2588cce 338/434: Revert "Support unmarking with no region. Change mc/mark-lines to preserve point.", ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 2e904a0 342/434: Add safety ceiling to cursor count at creation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9a5c9cd 005/434: Refactored setup of unsupported commands., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6cac5f4 018/434: Even more white-listing., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f2da52a 085/434: Update readme with new testing info., ELPA Syncer, 2021/08/07