问题
ECB (Emacs Code Browser) has context menu to add file, delete file etc. The context menu is opened when clicking right mouse button.
The problem is Aquamacs intercepts that mouse button event. When we click right mouse button in Aquamacs, it opens its own context menu. (In the Emacs downloaded from emacsformacosx.com, the context menu is opened correctly.)
How to open ECB context menu in Aquamacs? Is there a way to disable Aquamacs default context menu? Or is there a way to tell ECB to use other way to open its context menu?
回答1:
Answers from the mailing list of Aquamacs:
1.
Pretty much all key bindings in Aquamacs are bound in osx-key-mode-map (see Aquamacs FAQ). The mouse button bindings aren't any different.
Press C-h k, then the right mouse button (over an Aquamacs window). This should bring up a help screen that explains that this key is called `down-mouse-3', and that it is bound to a function described as this:
(osx-key-mode-down-mouse-3 EVENT &optional PREFIX)
Activate context menu, when
osx-key-mode-mouse-3-behavior' is set to
aquamacs-popup-context-menu' or nil
Looking up the documentation for this customization variable doesn't bring up anything useful, but we can undo the key binding (see Aquamacs FAQ, probably) using define-key:
(define-key osx-key-mode-map [down-mouse-3] nil)
2.
There is a second approach in place to return mouse-3 to its vanilla Emacs behavior: In the Aquamacs help/manual, section 4.3 "Customizing Aquamacs behavior", under "Want some GNU Emacs 23 behavior back?" there is a list of Aquamacs-specific settings that can be customized, including "OS X Key Mode Mouse-3 Behavior". Try customizing that setting as described in the help -- that may allow ECB to behave as in vanilla Emacs.
来源:https://stackoverflow.com/questions/7541693/ecb-context-menu-in-aquamacs