From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Cannot use "\C-!" in a string in Emacs 22? Date: Mon, 26 Sep 2005 15:44:36 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1127764880 14488 80.91.229.2 (26 Sep 2005 20:01:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Sep 2005 20:01:20 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 26 22:01:14 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EJz6t-0007lo-Ui for ged-emacs-devel@m.gmane.org; Mon, 26 Sep 2005 21:58:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EJz3k-0004Ld-Q6 for ged-emacs-devel@m.gmane.org; Mon, 26 Sep 2005 15:54:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EJz0w-00031i-8M for emacs-devel@gnu.org; Mon, 26 Sep 2005 15:51:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EJz0u-00030Z-A4 for emacs-devel@gnu.org; Mon, 26 Sep 2005 15:51:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EJz0G-0002M9-8C for emacs-devel@gnu.org; Mon, 26 Sep 2005 15:51:08 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EJyuE-0004WR-Bw for emacs-devel@gnu.org; Mon, 26 Sep 2005 15:44:54 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id AC3512CF546; Mon, 26 Sep 2005 15:44:48 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id C62FA4AC00D; Mon, 26 Sep 2005 15:44:36 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id B2A93F69C4; Mon, 26 Sep 2005 15:44:36 -0400 (EDT) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Mon, 26 Sep 2005 11:56:59 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.847, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43264 Archived-At: > I tried (define-key my-map "\C-!" 'my-cmd), which works in Emacs 20, but > gives this error in Emacs 22: "Invalid modifier in string". It worked under Emacs-20, but returned the same as "\C-a", i.e. probably not what you intended. In Emacs-21 this was fixed to return an error rather than silently turning it into somwething else. > Anyway, for the key binding, I settled on (define-key my-map [C-!] 'my-cmd), > after some experimentation - it seems to work for key bindings in both > versions. I'd expect it doesn't really work. It won't signal an error, but it won't cause my-cmd to be run when you hit control and !. You probably meant to use (define-key my-map [?\C-!] 'my-cmd) which should work. I'd recommend (define-key my-map [(control ?!)] 'my-cmd) which will also work under XEmacs. Stefan