[OS X Emacs] FW: rebinding function keys

Peter North PNorth at sydneyoperahouse.com
Sun Jul 10 06:54:18 EDT 2011

From: Peter North
Sent: Sunday, 10 July 2011 8:40 PM
To: MaxOSX-emacs at email.esm.psu.edu
Subject: rebinding function keys

Hello everybody.

I've just installed aqua on my Macbook pro and I'm trying to rebind the function keys.

After several attempts I haven't got the code correct. I'm not a programmer, so if anyone could help me with the code it would be appreciated.

I'd like to use the function, function-shift, function-control and function-alt keys for my bindings. I'm a fiction writer, so using the escape key where it is is not a problem.

Using ^C-h c to identify the code a function key generates I get f1-. Leaving out the - doesn't seem to make any difference.

Below I've included the code from my attempts at an Aquamacs preferences.el file.

setq default major-mode 'text-mode

The following section works [borrowed from another startup file found on the web]

(setq initial-frame-alist '((background-colour . "black")
(setq initial-frame-list '((foreground-colour . "green")
(setq default ((cursor-colour . "blue")
(setq default-frame-alist '((background-colour . "black" (left . 0) (width . 141) (height . 44)))

Next line seems to place new buffers along bottom of first one [ie scratch]

(smart-frame-positioning-mode nil)

end working section. The following is where I'm coming unstuck

(global-set-key <"f1->" 'find-file

other variations I've tried are

(global-set-key (kbd <"f1>" 'save-file
(define-key osx-key-mode-map  'save-buffers-kill-emacs)
(osx-key-mode "<Control-f1>" 'split-window-vertically)

Anyway, you get the idea. All the variations I've tried have failed. I've seen different types of code in various other startup files but I can't figure out which one I should be using.

My thanks to anyone if they can help me out, and sorry if this isn't as well explained as it should be.

Peter North.

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