[Top][All Lists]

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

Re: Looking for the "best" notation for key-binding

From: Peter Dyballa
Subject: Re: Looking for the "best" notation for key-binding
Date: Fri, 21 Sep 2012 11:24:35 +0200

Am 21.09.2012 um 01:11 schrieb Chap Harrison:

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

I think the vector notation is a good choice:

        (global-set-key [C-∫]           'backward-sexp) ; A-C-b
        (global-set-key [M-S-return]    'other-window)
        (global-set-key [f1 f5]         'apropos-variable)
        (global-set-key [f3]            'compare-windows)
        (global-set-key [A-f1]          'replace-string)

The commands you bind in your examples the keys are some macros (for f10 for 
example) or different syntax:

        (quote help-for-help) = 'quote help-for-help
        (quote [f1]) = [f1]

Entries in this syntax are usually created when using global-set-key 
interactively and saving the resulting bind commands.

Trying to bind the Lisp comment character ";" to anything can become tricky… In 
my Emacsen (23.4, 24.2.50) this works:

        (global-set-key [67108923] 'comment-indent)

The number value can be found by typing, for example in *scratch* buffer, C-q 
C-;. This produces a record in the *Messages* buffer you can use.



There's no sense in being precise when you don't even know what you're talking 
                                – John von Neumann

reply via email to

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