[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 40eb74e 357/434: Extend mc/add-cursor-on-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 40eb74e 357/434: Extend mc/add-cursor-on-click to toggle fake cursors |
Date: |
Sat, 7 Aug 2021 09:20:59 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 40eb74e3e44aa72948db92dc58a8769153fd83f3
Author: Ingo Lohmar <i.lohmar@gmail.com>
Commit: Ingo Lohmar <i.lohmar@gmail.com>
Extend mc/add-cursor-on-click to toggle fake cursors
- rename function accordingly and add alias
---
mc-mark-more.el | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index 68addce..f63887d 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -576,8 +576,9 @@ If the region is inactive or on a single line, it will
behave like
(<= (point) end))))
;;;###autoload
-(defun mc/add-cursor-on-click (event)
- "Add a cursor where you click."
+(defun mc/toggle-cursor-on-click (event)
+ "Add a cursor where you click, or remove a fake cursor that is
+already there."
(interactive "e")
(mouse-minibuffer-check event)
;; Use event-end in case called from mouse-drag-region.
@@ -589,10 +590,17 @@ If the region is inactive or on a single line, it will
behave like
(if (numberp (posn-point position))
(save-excursion
(goto-char (posn-point position))
- (mc/create-fake-cursor-at-point)))
+ (let ((existing (mc/last-fake-cursor-before (point))))
+ (if (and existing
+ (eq (overlay-get existing 'point) (point)))
+ (mc/remove-fake-cursor existing)
+ (mc/create-fake-cursor-at-point)))))
(mc/maybe-multiple-cursors-mode)))
;;;###autoload
+(defalias 'mc/add-cursor-on-click 'mc/toggle-cursor-on-click)
+
+;;;###autoload
(defun mc/mark-sgml-tag-pair ()
"Mark the tag we're in and its pair for renaming."
(interactive)
- [nongnu] elpa/multiple-cursors 7ddda85 312/434: Added vertical align commands, (continued)
- [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
- [nongnu] elpa/multiple-cursors 40eb74e 357/434: Extend mc/add-cursor-on-click to toggle fake cursors,
ELPA Syncer <=
- [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, 2021/08/07
- [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