[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 1686630 369/434: try to implement blackli
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 1686630 369/434: try to implement blacklist |
Date: |
Sat, 7 Aug 2021 09:21:01 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 1686630fd69279023bb2768f8174347ccaa91c8d
Author: bb2020 <bb2020@users.noreply.github.com>
Commit: bb2020 <bb2020@users.noreply.github.com>
try to implement blacklist
---
multiple-cursors-core.el | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 09b1b01..dd733f2 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -310,6 +310,19 @@ cursor with updated info."
(mc/pop-state-from-overlay mc--stored-state-for-undo)
(setq mc--stored-state-for-undo nil)))
+(defcustom mc/black-list-prefer nil
+ "Disables whitelist mechanism and executes commands that are defined
+in mc/black-list only once. If you are a novice multiple-cursors or
+Emacs user, it is benefitical to stick to whitelists."
+ :type '(boolean)
+ :group 'multiple-cursors)
+
+(defcustom mc/black-list nil
+ "Commands to execute once while using multiple-cursors. Requires
+mc/black-list-prefer to be non-nil."
+ :type '(repeat function)
+ :group 'multiple-cursors)
+
(defun mc/prompt-for-inclusion-in-whitelist (original-command)
"Asks the user, then adds the command either to the once-list or the
all-list."
(let ((all-p (y-or-n-p (format "Do %S for all cursors?" original-command))))
@@ -396,13 +409,19 @@ the original cursor, to inform about the lack of support."
(message "%S is not supported with multiple cursors%s"
original-command
(get original-command 'mc--unsupported))
- (when (and original-command
- (not (memq original-command
mc--default-cmds-to-run-once))
- (not (memq original-command mc/cmds-to-run-once))
- (or (memq original-command
mc--default-cmds-to-run-for-all)
- (memq original-command mc/cmds-to-run-for-all)
- (mc/prompt-for-inclusion-in-whitelist
original-command)))
- (mc/execute-command-for-all-fake-cursors
original-command))))))))))
+ (if mc/black-list-prefer
+ (when (and original-command
+ (not (memq original-command
mc--default-cmds-to-run-once))
+ (or (memq original-command
mc--default-cmds-to-run-for-all)
+ (not (memq original-command
mc/black-list))))
+ (mc/execute-command-for-all-fake-cursors
original-command))
+ (when (and original-command
+ (not (memq original-command
mc--default-cmds-to-run-once))
+ (not (memq original-command mc/cmds-to-run-once))
+ (or (memq original-command
mc--default-cmds-to-run-for-all)
+ (memq original-command mc/cmds-to-run-for-all)
+ (mc/prompt-for-inclusion-in-whitelist
original-command)))
+ (mc/execute-command-for-all-fake-cursors
original-command)))))))))))
(defun mc/remove-fake-cursors ()
"Remove all fake cursors.
- [nongnu] elpa/multiple-cursors 19f842d 318/434: Undo after leaving mc mode will restore cursors as they was, (continued)
- [nongnu] elpa/multiple-cursors 19f842d 318/434: Undo after leaving mc mode will restore cursors as they was, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 40b1bad 319/434: Merge pull request #169 from lexa/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 82586a0 321/434: Consolidate contributor entries for Aleksey, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7d84398 327/434: Add missing require to mc-hide-unmatched-lines-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors cec48cc 328/434: Merge pull request #188 from iqbalansari/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 66b1127 336/434: Merge pull request #192 from uk-ar/add_search_word, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c90bb62 339/434: Changed mc/furthest-cursor-after(before)-point to check if mark is active., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors cd967e7 343/434: Small optimization, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8703b19 350/434: Add mark-next-like-this-symbol function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 415e29f 352/434: Add @jtamagnan to contributors list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1686630 369/434: try to implement blacklist,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors d26cecd 381/434: added always-run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8e59a8a 390/434: Merge pull request #262 from AndreaOrru/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fa91dfb 397/434: Don't display message while loading mc/list-file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6f183a1 405/434: Merge pull request #304 from angadgill92/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 18f992b 403/434: Merge pull request #290 from raxod502/feat/silent-load, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 75dd6bf 413/434: Merge pull request #327 from notetiene/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9c49874 415/434: Merge pull request #333 from drrlvn/patch-1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6a7c3c0 418/434: Fix whitespace, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b39e963 425/434: Faster line-number-at-pos calculation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors cb7a145 210/434: Release 1.2.0, ELPA Syncer, 2021/08/07