From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chap Harrison Newsgroups: gmane.emacs.help Subject: Looking for the "best" notation for key-binding Date: Thu, 20 Sep 2012 17:11:48 -0600 Message-ID: <505BA2B4.7090906@me.com> Reply-To: clh@pobox.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary_(ID_56mfFva26/tHj2ElwBPzdg)" X-Trace: ger.gmane.org 1348185069 2248 80.91.229.3 (20 Sep 2012 23:51:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Sep 2012 23:51:09 +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 01:51:14 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 1TEqWU-0008UJ-Iz for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 01:51:10 +0200 Original-Received: from localhost ([::1]:51166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEqWQ-0005Ey-4W for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Sep 2012 19:51:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEpuV-00066y-SR for help-gnu-emacs@gnu.org; Thu, 20 Sep 2012 19:11:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEpuU-0000s1-Nj for help-gnu-emacs@gnu.org; Thu, 20 Sep 2012 19:11:55 -0400 Original-Received: from st11p00mm-asmtpout004.mac.com ([17.172.81.3]:55839 helo=st11p00mm-asmtp004.mac.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEpuU-0000rw-JB for help-gnu-emacs@gnu.org; Thu, 20 Sep 2012 19:11:54 -0400 Original-Received: from [10.2.16.91] (wiland-mail.wilanddirect.com [64.58.24.34]) by st11p00mm-asmtp004.mac.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPSA id <0MAO00A6Q8FR6410@st11p00mm-asmtp004.mac.com> for help-gnu-emacs@gnu.org; Thu, 20 Sep 2012 23:11:52 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855,1.0.431,0.0.0000 definitions=2012-09-20_07:2012-09-20, 2012-09-20, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1209200314 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-Received-From: 17.172.81.3 X-Mailman-Approved-At: Thu, 20 Sep 2012 19:51:02 -0400 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:86858 Archived-At: This is a multi-part message in MIME format. --Boundary_(ID_56mfFva26/tHj2ElwBPzdg) Content-type: text/plain; CHARSET=US-ASCII; format=flowed Content-transfer-encoding: 7BIT 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 "") '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? Thanks, Chap --Boundary_(ID_56mfFva26/tHj2ElwBPzdg) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: 7BIT 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?

Thanks,
Chap

--Boundary_(ID_56mfFva26/tHj2ElwBPzdg)--