[OS X Emacs] How to rebind the

M A markoilcan at gmail.com
Mon Jan 26 13:45:59 EST 2015


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:
http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/683575#683575

Also, the following is generally useful (particularly for non elisp gurus):
http://www.masteringemacs.org/article/mastering-key-bindings-emacs



On Mon, Jan 26, 2015 at 8:41 AM, Steven E.Harris <seh at panix.com> wrote:

> Alan Schmitt <alan.schmitt <at> polytechnique.org> writes:
>
>
> > I'm also using Aquamacs 2.4. I tried again, and when I do
> > C-x C-r I get the menu and not my function.
> >
> > Is there a way to debug the startup sequence of Aquamacs so that
> > I find how the binding gets overridden?
>
> It's more than three years later, and I'm still struggling with this same
> problem. I've tried wrapping the `define-key' (or `global-set-key') call in
> `eval-after-load' to ensure that my rebinding runs *after* the one I find
> in
> aquamacs-menu.el, still to no avail:
>
> ,----
> | ;; Revert the binding for `recentf-open-files' defined in
> | ;; /Applications/Aquamacs.app/Contents/Resources/lisp/
> |      aquamacs/macosx/aquamacs-menu.el:
> | (eval-after-load "aquamacs-menu"
> |   '(progn
> |      (message "Overriding C-x C-r key binding.")
> |      (define-key (current-global-map) [(control ?x) (control ?r)]
> |        'find-file-read-only)))
> `----
>
> The "Overriding ..." message gets printed to the *Messages* buffer, and the
> forms before and after this one run with lasting effect, but it seems that
> this call to `define-key' happens but the either some other binding
> replaces
> mine afterward, or the global key map in place while Preferences.el is
> loading is not the same map that comes into place later.
>
> Is there some way to figure out what's replacing this binding?
>
> --
> Steven E. Harris
>
>
> _____________________________________________________________
> MacOSX-Emacs mailing list
> MacOSX-Emacs at email.esm.psu.edu
> https://email.esm.psu.edu/mailman/listinfo/macosx-emacs
> List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20150126/7f755633/attachment.html>


More information about the MacOSX-Emacs mailing list