[OS X Emacs] FW: rebinding function keys

Peter North PNorth at sydneyoperahouse.com
Wed Jul 20 20:34:48 EDT 2011

Thanks again, David. I'm sorting it out.

Peter North

-----Original Message-----
From: macosx-emacs-bounces at email.esm.psu.edu [mailto:macosx-emacs-bounces at email.esm.psu.edu] On Behalf Of David Reitter
Sent: Wednesday, 13 July 2011 06:35
To: Emacs on Mac OS X Mailing List
Subject: Re: [OS X Emacs] FW: rebinding function keys

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.

- 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!

Please consider the environment before printing this email.

Please consider the environment before printing this email.
=====This message is intended for the addressee(s) named and may contain confidential information.
If you are not the intended recipient, please delete it and notify the sender.
Views expressed in this email are those of the individual sender and are not necessarily the views of the Sydney Opera House Trust=====

More information about the MacOSX-Emacs mailing list