<div dir="ltr"><div>Defining the bindings in the current global map probably won't work because local or mode maps might be overriding the bindings. The order of the rebinding won't matter, just the order of the maps. Still, I've never understood why the osx minor mode map seems to block bindings I make to the global map even if it doesn't bind anything to my desired key binding. I've always had to do (define-key osx-key-mode-map ...). There are other possible solutions. For instance you can try what is described here: <br><a href="http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/683575#683575">http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/683575#683575</a><br><br></div>Also, the following is generally useful (particularly for non elisp gurus):<br><a href="http://www.masteringemacs.org/article/mastering-key-bindings-emacs">http://www.masteringemacs.org/article/mastering-key-bindings-emacs</a><br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 26, 2015 at 8:41 AM, Steven E.Harris <span dir="ltr"><<a href="mailto:seh@panix.com" target="_blank">seh@panix.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Alan Schmitt <alan.schmitt <at> <a href="http://polytechnique.org" target="_blank">polytechnique.org</a>> writes:<br>
<br>
<br>
> I'm also using Aquamacs 2.4. I tried again, and when I do<br>
> C-x C-r I get the menu and not my function.<br>
><br>
> Is there a way to debug the startup sequence of Aquamacs so that<br>
> I find how the binding gets overridden?<br>
<br>
It's more than three years later, and I'm still struggling with this same<br>
problem. I've tried wrapping the `define-key' (or `global-set-key') call in<br>
`eval-after-load' to ensure that my rebinding runs *after* the one I find in<br>
aquamacs-menu.el, still to no avail:<br>
<br>
,----<br>
| ;; Revert the binding for `recentf-open-files' defined in<br>
| ;; /Applications/Aquamacs.app/Contents/Resources/lisp/<br>
|      aquamacs/macosx/aquamacs-menu.el:<br>
| (eval-after-load "aquamacs-menu"<br>
|   '(progn<br>
|      (message "Overriding C-x C-r key binding.")<br>
|      (define-key (current-global-map) [(control ?x) (control ?r)]<br>
|        'find-file-read-only)))<br>
`----<br>
<br>
The "Overriding ..." message gets printed to the *Messages* buffer, and the<br>
forms before and after this one run with lasting effect, but it seems that<br>
this call to `define-key' happens but the either some other binding replaces<br>
mine afterward, or the global key map in place while Preferences.el is<br>
loading is not the same map that comes into place later.<br>
<br>
Is there some way to figure out what's replacing this binding?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Steven E. Harris<br>
<br>
<br>
_____________________________________________________________<br>
MacOSX-Emacs mailing list<br>
<a href="mailto:MacOSX-Emacs@email.esm.psu.edu">MacOSX-Emacs@email.esm.psu.edu</a><br>
<a href="https://email.esm.psu.edu/mailman/listinfo/macosx-emacs" target="_blank">https://email.esm.psu.edu/mailman/listinfo/macosx-emacs</a><br>
List Archives: <a href="http://dir.gmane.org/gmane.emacs.macintosh.osx" target="_blank">http://dir.gmane.org/gmane.emacs.macintosh.osx</a><br>
</font></span></blockquote></div><br></div>