From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Looking for the "best" notation for key-binding Date: Fri, 21 Sep 2012 09:29:21 -0400 Message-ID: References: <505BA2B4.7090906@me.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1348234222 18150 80.91.229.3 (21 Sep 2012 13:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2012 13:30:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 21 15:30:27 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TF3JJ-0006pa-8x for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 15:30:25 +0200 Original-Received: from localhost ([::1]:44885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF3JE-00064n-Ps for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 09:30:20 -0400 Original-Path: usenet.stanford.edu!newsfeed.news.ucla.edu!news.snarked.org!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe16.iad.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Cancel-Lock: sha1:RRLDTTVBv1TilpLPXSJJS6qSQ+g= Original-Lines: 37 Original-X-Complaints-To: abuse@UsenetServer.com Original-NNTP-Posting-Date: Fri, 21 Sep 2012 13:29:23 UTC X-Received-Bytes: 2052 Original-Xref: usenet.stanford.edu gnu.emacs.help:194536 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86873 Archived-At: > I think the vector notation is a good choice: > (global-set-key [C-∫] 'backward-sexp) ; A-C-b This likely won't work. You need (global-set-key [?\C-∫] 'backward-sexp) ; A-C-b instead. Yes, it's an annoyance. You have to understand the distinction between keys that emit characters and other keys (that emit symbols). > (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) These look just fine, yes. > 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) Now that's very intuitive. A better choice (maybe still not totally obvious to come across, but at least a bit more obvious to understand when you read it): (global-set-key [?\C-\;] '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. If you type C-x C-e twice in a row, with point right after the magical number, you'll see alternative ways to write this number, one of them being the one I used above. Stefan