all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: clh@pobox.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: Looking for the "best" notation for key-binding
Date: Fri, 21 Sep 2012 11:24:35 +0200	[thread overview]
Message-ID: <B15D079B-5BE7-48D1-A3D3-2FB90F7912DD@Web.DE> (raw)
In-Reply-To: <505BA2B4.7090906@me.com>


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.

--
Greetings

  Pete

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




  parent reply	other threads:[~2012-09-21  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 23:11 Looking for the "best" notation for key-binding Chap Harrison
2012-09-21  0:30 ` John Wiegley
     [not found] ` <mailman.9409.1348187445.855.help-gnu-emacs@gnu.org>
2012-09-21  0:45   ` B. T. Raven
2012-09-21  9:24 ` Peter Dyballa [this message]
2012-09-21 15:27   ` Chap Harrison
2012-10-19  3:39     ` Kevin Rodgers
     [not found] ` <mailman.9433.1348219496.855.help-gnu-emacs@gnu.org>
2012-09-21 13:29   ` Stefan Monnier
2012-09-21 14:59     ` Peter Dyballa
2012-09-21 16:29       ` Stefan Monnier
2012-09-21 20:37         ` Peter Dyballa
2012-10-01 14:31 ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B15D079B-5BE7-48D1-A3D3-2FB90F7912DD@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=clh@pobox.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.