Add support for modes that remap commands.

- for instance subword-mode
This commit is contained in:
Magnar Sveen 2012-07-17 09:19:08 +02:00
parent b99d54a3d9
commit 1db643c4d6

View File

@ -125,14 +125,16 @@ inform about the lack of support.
Commands that are neither supported nor explicitly unsupported Commands that are neither supported nor explicitly unsupported
is executed normally for point, but skipped for the fake is executed normally for point, but skipped for the fake
cursors." cursors."
(if (memq this-original-command mc--unsupported-cmds) (let ((original-command (or (command-remapping this-original-command)
this-original-command)))
(if (memq original-command mc--unsupported-cmds)
(message "%S is not supported with multiple cursors%s" (message "%S is not supported with multiple cursors%s"
this-original-command original-command
(get this-original-command 'mc--unsupported-msg)) (get original-command 'mc--unsupported-msg))
(if (not (memq this-original-command mc--cmds)) (if (not (memq original-command mc--cmds))
(when (not (memq this-original-command mc--cmds-run-once)) (when (not (memq original-command mc--cmds-run-once))
(message "Skipping %S" this-original-command)) (message "Skipping %S" original-command))
(mc/execute-command-for-all-fake-cursors this-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.
@ -210,9 +212,9 @@ from being executed if in multiple-cursors-mode."
right-word forward-word right-word forward-word
left-char backward-char left-char backward-char
left-word backward-word left-word backward-word
subword-upcase upcase-word upcase-word
subword-downcase downcase-word downcase-word
subword-capitalize capitalize-word capitalize-word
forward-list forward-list
backward-list backward-list
hippie-expand hippie-expand-lines hippie-expand hippie-expand-lines
@ -221,6 +223,15 @@ from being executed if in multiple-cursors-mode."
kill-region-or-backward-word kill-region-or-backward-word
kill-line kill-line
kill-whole-line kill-whole-line
subword-forward
subword-backward
subword-mark
subword-kill
subword-backward-kill
subword-transpose
subword-capitalize
subword-upcase
subword-downcase
backward-kill-word backward-kill-word
backward-delete-char-untabify backward-delete-char-untabify
delete-forward-char c-electric-delete-forward delete-forward-char c-electric-delete-forward