[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors dce6c00 174/434: Add mc/cursor-specific-v
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors dce6c00 174/434: Add mc/cursor-specific-vars to handle vars that need to be tracked per cursor. |
Date: |
Sat, 7 Aug 2021 09:20:20 -0400 (EDT) |
branch: elpa/multiple-cursors
commit dce6c00fab0c27ac520440f3a9eb391b624a5437
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Add mc/cursor-specific-vars to handle vars that need to be tracked per
cursor.
- also add autopair-vars to this list.
Fixes #32
---
multiple-cursors-core.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 4a66ca6..0a430ff 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -118,6 +118,17 @@ highlights the entire width of the window."
(overlay-put overlay 'type 'additional-region)
overlay))
+(defvar mc/cursor-specific-vars '(autopair-action
+ autopair-wrap-action
+ er/history)
+ "A list of vars that need to be tracked on a per-cursor basis.")
+
+(defun mc/store-cursor-specific-var (var)
+ (when (boundp var) (overlay-put o var (eval var))))
+
+(defun mc/restore-cursor-specific-var (var)
+ (when (boundp var) (set var (overlay-get o var))))
+
(defun mc/store-current-state-in-overlay (o)
"Store relevant info about point and mark in the given overlay."
(overlay-put o 'point (set-marker (make-marker) (point)))
@@ -128,7 +139,7 @@ highlights the entire width of the window."
(overlay-put o 'mark-active mark-active)
(overlay-put o 'yank-undo-function yank-undo-function)
(overlay-put o 'kill-ring-yank-pointer kill-ring-yank-pointer)
- (when (boundp 'er/history) (overlay-put o 'er/history er/history))
+ (mapc 'mc/store-cursor-specific-var mc/cursor-specific-vars)
o)
(defun mc/restore-state-from-overlay (o)
@@ -141,7 +152,7 @@ highlights the entire width of the window."
(setq mark-active (overlay-get o 'mark-active))
(setq yank-undo-function (overlay-get o 'yank-undo-function))
(setq kill-ring-yank-pointer (overlay-get o 'kill-ring-yank-pointer))
- (when (boundp 'er/history) (setq er/history (overlay-get o 'er/history))))
+ (mapc 'mc/restore-cursor-specific-var mc/cursor-specific-vars))
(defun mc/remove-fake-cursor (o)
"Delete overlay with state, including dependent overlays and markers."
@@ -186,6 +197,7 @@ Saves the current state in the overlay to be restored
later."
(run-hooks 'pre-command-hook)
(unless (eq this-command 'ignore)
(call-interactively cmd))
+ (run-hooks 'post-command-hook)
(when deactivate-mark (deactivate-mark)))
(defvar mc--executing-command-for-fake-cursor nil)
- [nongnu] elpa/multiple-cursors 6e61e3d 114/434: Fix travis badge, (continued)
- [nongnu] elpa/multiple-cursors 6e61e3d 114/434: Fix travis badge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 719fe40 119/434: Integrate with rect.el instead of consolidating/splitting on kill-ring, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5fcc69c 139/434: Skip keyboard macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3f20fc1 154/434: When no region is active mc/mark-next-like-this and mc/mark-previous-like-this should create a cursor one like up (or down)., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 038c9a7 161/434: Added stop as a possible value for mc/cycle-looping-behaviour., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e4adefc 158/434: Fix issues with mc/cycle-(backward|forward) where the cycling was dependent on not having an active mark., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1cdd730 221/434: Automatically select word/symbol, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 72ba43a 225/434: add .nosearch to directory with bundled libraries, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6a5969e 202/434: Adding support for using mc/edit-lines without transient mark mode., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 980a880 223/434: Merge pull request #63 from tkf/select-thing-at-point, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dce6c00 174/434: Add mc/cursor-specific-vars to handle vars that need to be tracked per cursor.,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 0a081a7 184/434: Move mc/maybe-multiple-cursors-mode to core., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9a376a6 201/434: Add note about yank-rectangle, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e7605bb 194/434: Merge pull request #42 from purcell/cleanup, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d24ddc5 217/434: Default ECUKES_EMACS to $EMACS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 94af074 240/434: Add some readability enhancing step definitions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 66ceb0b 246/434: Revert cursor specific pre- & post-command-hooks, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 725369c 253/434: Merge pull request #97 from knu/fix-mc-mark-pop-doc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors bbbe90d 349/434: Minor changes mark-next-like-this-word and readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dd07bc5 351/434: Merge pull request #228 from jtamagnan/mark-next-like-this-word, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8297f1f 363/434: Merge pull request #241 from YoungFrog/fix-#230, ELPA Syncer, 2021/08/07