[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 5d677f7 341/434: Unrevert "Support unmark
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 5d677f7 341/434: Unrevert "Support unmarking with no region. Change mc/mark-lines to preserve point." |
Date: |
Sat, 7 Aug 2021 09:20:55 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 5d677f765c114fdf3aafd2b37f13721166a17596
Author: Justin Dove <dove@mit.edu>
Commit: Justin Dove <dove@mit.edu>
Unrevert "Support unmarking with no region. Change mc/mark-lines to
preserve point."
This reverts commit 2588ccef6939b77896105f23642483c30c4a4e06.
---
mc-mark-more.el | 48 ++++++++++++++++++++++++++----------------------
1 file changed, 26 insertions(+), 22 deletions(-)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index fc8a9af..1e87521 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -127,14 +127,14 @@ Use like case-fold-search, don't recommend setting it
globally.")
With negative ARG, delete the last one instead.
With zero ARG, skip the last one and mark next."
(interactive "p")
- (if (region-active-p)
- (if (< arg 0)
- (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))
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'forwards)
+ (mc/mark-lines arg 'forwards)))
(mc/maybe-multiple-cursors-mode))
;;;###autoload
@@ -155,14 +155,14 @@ With zero ARG, skip the last one and mark next."
With negative ARG, delete the last one instead.
With zero ARG, skip the last one and mark next."
(interactive "p")
- (if (region-active-p)
- (if (< arg 0)
- (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))
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-before-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'backwards)
+ (mc/mark-lines arg 'backwards)))
(mc/maybe-multiple-cursors-mode))
;;;###autoload
@@ -179,12 +179,16 @@ With zero ARG, skip the last one and mark next."
(defun mc/mark-lines (num-lines direction)
(dotimes (i num-lines)
- (mc/create-fake-cursor-at-point)
- (ecase direction
- (forwards (loop do (next-logical-line 1 nil)
- while (mc/all-fake-cursors (point) (1+ (point)))))
- (backwards (loop do (previous-logical-line 1 nil)
- while (mc/all-fake-cursors (point) (1+ (point))))))))
+ (mc/save-excursion
+ (let ((furthest-cursor (ecase direction
+ (forwards (mc/furthest-cursor-after-point))
+ (backwards (mc/furthest-cursor-before-point)))))
+ (if (overlayp furthest-cursor)
+ (goto-char (overlay-get furthest-cursor 'point))))
+ (ecase direction
+ (forwards (next-logical-line 1 nil))
+ (backwards (previous-logical-line 1 nil)))
+ (mc/create-fake-cursor-at-point))))
;;;###autoload
(defun mc/mark-next-lines (arg)
- [nongnu] elpa/multiple-cursors 17c48f9 278/434: Merge pull request #111 from mathrick/mark-all-dwim, (continued)
- [nongnu] elpa/multiple-cursors 17c48f9 278/434: Merge pull request #111 from mathrick/mark-all-dwim, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors cfe4bd9 280/434: Add python-indent-dedent-line-backspace to run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3cfae1d 290/434: Merge pull request #122 from kyanagi/appropriate-error-messages-when-no-fake-cursors-exist, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f5866d6 294/434: Fix typo in readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0847147 300/434: Merge pull request #143 from mjdarby/jedi-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d184f35 301/434: Add company-mode to the list of unsupported minor modes., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4b0e912 310/434: Added description of mc-hide-unmached-mode to Readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f3daf86 311/434: Merge pull request #157 from lexa/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b46f795 314/434: Fix style issues, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors faf331d 334/434: Merge pull request #183 from grettke/patch-1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5d677f7 341/434: Unrevert "Support unmarking with no region. Change mc/mark-lines to preserve point.",
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 97e5db1 346/434: Merge pull request #207 from vermiculus/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 55af659 354/434: Speedup mc--numbers-to-letters, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 97da977 141/434: Intercept some reading commands, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors da069c8 366/434: Merge pull request #236 from jtamagnan/insert_letters_fix, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 432a3fc 370/434: Merge pull request #250 from nispio/mark-lines-allows-skip, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a508978 376/434: Add /.ecukes-failing-scenarios to gitignore, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d9a6047 384/434: Fix mc/cursor-is-bar as per @cpitclaudel, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c945665 399/434: Merge pull request #294 from nispio/fix-293, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors eba1020 409/434: Add temporary-goal-column to mc/cursor-specific-vars, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 35ff8b5 412/434: Add customization group definition, ELPA Syncer, 2021/08/07