mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 21:03:05 +00:00
added mc/always-run-for-all
This commit is contained in:
parent
1686630fd6
commit
fd847ae6e7
@ -310,19 +310,11 @@ cursor with updated info."
|
|||||||
(mc/pop-state-from-overlay mc--stored-state-for-undo)
|
(mc/pop-state-from-overlay mc--stored-state-for-undo)
|
||||||
(setq mc--stored-state-for-undo nil)))
|
(setq mc--stored-state-for-undo nil)))
|
||||||
|
|
||||||
(defcustom mc/black-list-prefer nil
|
(defcustom mc/always-run-for-all nil
|
||||||
"Disables whitelist mechanism and executes commands that are defined
|
"Disables whitelisting and always executes commands for every fake cursor."
|
||||||
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)
|
:type '(boolean)
|
||||||
:group 'multiple-cursors)
|
: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)
|
(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."
|
"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))))
|
(let ((all-p (y-or-n-p (format "Do %S for all cursors?" original-command))))
|
||||||
@ -409,19 +401,14 @@ the original cursor, to inform about the lack of support."
|
|||||||
(message "%S is not supported with multiple cursors%s"
|
(message "%S is not supported with multiple cursors%s"
|
||||||
original-command
|
original-command
|
||||||
(get original-command 'mc--unsupported))
|
(get original-command 'mc--unsupported))
|
||||||
(if mc/black-list-prefer
|
(when (and original-command
|
||||||
(when (and original-command
|
(not (memq original-command mc--default-cmds-to-run-once))
|
||||||
(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)
|
(or (memq original-command mc--default-cmds-to-run-for-all)
|
||||||
(not (memq original-command mc/black-list))))
|
(memq original-command mc/cmds-to-run-for-all)
|
||||||
(mc/execute-command-for-all-fake-cursors original-command))
|
(or mc/always-run-for-all
|
||||||
(when (and original-command
|
(mc/prompt-for-inclusion-in-whitelist original-command))))
|
||||||
(not (memq original-command mc--default-cmds-to-run-once))
|
(mc/execute-command-for-all-fake-cursors original-command))))))))))
|
||||||
(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 ()
|
(defun mc/remove-fake-cursors ()
|
||||||
"Remove all fake cursors.
|
"Remove all fake cursors.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user