[OS X Emacs] FW: rebinding function keys

David Reitter david.reitter at gmail.com
Tue Jul 12 16:34:40 EDT 2011


On Jul 12, 2011, at 2:18 PM, Peter North wrote:
> However the function key bindings (global-set-key [f1] 'savefile) doesn't. 

`savefile' is not the name of a function, I believe.

To find out names of functions, type C-h k, followed by the key (or mouse/menu action) that normally invokes the command.  You'll see a Help window explaining the command.

Second, If the function key is already bound somewhere else (check with C-h k), you will have to override this key in that specific key map.

> Nor can I find the aquamacs /.emacs file [typing C-x C-f ~/.emacs returns a message "no file found"] or where the C-h b bindings code is stored. 


The ~/.emacs file is your own file.  There's also Preferences.el in Aquamacs, which is preferred.  See the manual.
These files do not exist (or are nearly empty) unless you create them!

What you see in C-h b is a list of all active bindings.  If you intend to look at the source code, there is currently no sophisticated way to identify the location of a key's definition.  That's why it is, at times, hard to find out where to go.

If you have a look a the Aquamacs FAQ (Help menu!), there's some code (using `define-key') that shows how to define and override key bindings via the 'osx-key-mode-map' keymap.  That is more reliable than global-set-key.

Hope that helps.

Best
- David


--
http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and support the Aquamacs Project!


More information about the MacOSX-Emacs mailing list