global-set-key question

global-set-key question

Post by Roy Feag » Tue, 04 Apr 1995 04:00:00



Hi -
     A newbie question that I can't answer with my manual:
        What can I put in my .emacs file to set the home key to
beginning-of-line instead of beginning-of-buffer?  I've tried things like
(global-set-key "\home" 'beginning-of-line)
but this isn't the correct way to designate the [HOME] key.  Does anyone
know the correct way?  (Also need to figure this out for [END],
[CTRL]-[HOME], and [CTRL]-[END].)
Thanks for any tips -
-Roy Feague

 
 
 

global-set-key question

Post by John Dopp » Wed, 05 Apr 1995 04:00:00


RF>  What can I put in my .emacs file to set the home key to
RF> beginning-of-line instead of beginning-of-buffer?  I've tried things like
RF> (global-set-key "\home" 'beginning-of-line)
RF> but this isn't the correct way to designate the [HOME] key.

Actually, [home] should do the trick:
  (global-set-key [home] 'beginning-of-line)

RF> (Also need to figure this out for [END], [CTRL]-[HOME], and
RF> [CTRL]-[END].)

Your best bet is to use Emacs to determine what each key is.  If you
type C-h c <keystroke>, then Emacs will identify its name for that
keystroke and its current binding.  For example, C-h c <Home> gives
  home runs the command beginning-of-buffer

Then you can use [home] in a global-set-key or define-key expression.
For the other keystrokes you mention, I get [end], [C-home], and
[C-end], although you should use C-h c <keystroke> on your machine
just to make sure.

hth...

--

--
Non-sequiturs make me eat lampshades.