[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Looking for the "best" notation for key-binding

From: Chap Harrison
Subject: Looking for the "best" notation for key-binding
Date: Thu, 20 Sep 2012 17:11:48 -0600
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0

Here are examples of key bindings culled from the Emacs FAQ and emacswiki.  Each one seems to use a slightly different notation to identify the keystroke.

(global-set-key     (quote [f1])   (quote help-for-help))

(global-unset-key   [?\e?{]        )
(global-set-key     [f10]          [?\C-x?\e?\e?\C-a?\C-k?\C-g])
(global-unset-key   "\e["          )
(global-set-key     "\C-h"         'delete-backward-char)
(keyboard-translate ?\C-h          ?\C-?)
(global-set-key     (kbd "C-V")    'somefunction)
(global-set-key     (kbd "<f3>")   'comment-dwim)

It's maddening.  I've so far been unsuccessful in getting this binding to work:

(global-set-key (kbd "C-;") 'comment-indent)

It seems to bind the command to the *unmodified* ';'.

Isn't there a single, simple, consistent way to create key bindings that will always work?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]