From 1db643c4d64952e0303415fbd43e95bc80abdacf Mon Sep 17 00:00:00 2001 From: Magnar Sveen Date: Tue, 17 Jul 2012 09:19:08 +0200 Subject: [PATCH] Add support for modes that remap commands. - for instance subword-mode --- multiple-cursors-core.el | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el index 8171055..611313b 100644 --- a/multiple-cursors-core.el +++ b/multiple-cursors-core.el @@ -125,14 +125,16 @@ inform about the lack of support. Commands that are neither supported nor explicitly unsupported is executed normally for point, but skipped for the fake cursors." - (if (memq this-original-command mc--unsupported-cmds) - (message "%S is not supported with multiple cursors%s" - this-original-command - (get this-original-command 'mc--unsupported-msg)) - (if (not (memq this-original-command mc--cmds)) - (when (not (memq this-original-command mc--cmds-run-once)) - (message "Skipping %S" this-original-command)) - (mc/execute-command-for-all-fake-cursors this-original-command)))) + (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" + original-command + (get original-command 'mc--unsupported-msg)) + (if (not (memq original-command mc--cmds)) + (when (not (memq original-command mc--cmds-run-once)) + (message "Skipping %S" original-command)) + (mc/execute-command-for-all-fake-cursors original-command))))) (defun mc/remove-fake-cursors () "Remove all fake cursors. @@ -210,9 +212,9 @@ from being executed if in multiple-cursors-mode." right-word forward-word left-char backward-char left-word backward-word - subword-upcase upcase-word - subword-downcase downcase-word - subword-capitalize capitalize-word + upcase-word + downcase-word + capitalize-word forward-list backward-list hippie-expand hippie-expand-lines @@ -221,6 +223,15 @@ from being executed if in multiple-cursors-mode." kill-region-or-backward-word kill-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-delete-char-untabify delete-forward-char c-electric-delete-forward