質問

I have an odd problem in Aquamacs-- when I am editing in nXML mode the key sequence C-return calls a completely different function than it should under nXML mode. It calls something called cua-set-rectangle-mark, instead of nxml-complete. I have no idea what the CUA mode is, but I tried to just properly remap it with something like this:

(add-hook 'nxml-mode-hook
          '(lambda ()
             (define-key nxml-mode-map (kbd "C-RET") 'nxml-complete)))

It seems, however, that this CUA mapping overrides even nxml-mode-map within the mode, because this had no effect at all. Am I missing something? Is this a peculiarity of Aquamacs vs. vanilla emacs? My emacs configurations on other machines all work fine with nXML mode, this is only an issue in Aquamacs.

役に立ちましたか?

解決

Aquamacs enables "cua-mode" by default (which is what is setting the "cua-set-rectangle-mark" keybinding). Put the following code in your Emacs init file to globally disable this:

(cua-mode 0)

Alternatively, if you want to keep cua-mode and cua-mode's rectangle functionality but not the keybinding, you can change the keybinding by customizing the global variable "cua-rectangle-mark-key" (which is set by default to "control return").

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top