From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Case Newsgroups: gmane.emacs.help Subject: Re: Binding same command to two separte keys?? Date: Fri, 13 Apr 2007 16:17:32 -0400 Message-ID: <1176495452.3065.121.camel@CASE> References: <1176490954.3065.75.camel@CASE> <1176491561.32280.9.camel@oaktree.karlheg.lan> <461FD736.2080709@gatech.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1176495626 17992 80.91.229.12 (13 Apr 2007 20:20:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Apr 2007 20:20:26 +0000 (UTC) Cc: emacs To: Matthew Flaschen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 13 22:20:25 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HcSFn-0007fb-W9 for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Apr 2007 22:20:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HcSK6-0007Nd-L5 for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Apr 2007 16:24:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HcSJt-0007NS-5Y for help-gnu-emacs@gnu.org; Fri, 13 Apr 2007 16:24:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HcSJq-0007N9-PU for help-gnu-emacs@gnu.org; Fri, 13 Apr 2007 16:24:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HcSJq-0007N6-Gy for help-gnu-emacs@gnu.org; Fri, 13 Apr 2007 16:24:30 -0400 Original-Received: from smtp107.rog.mail.re2.yahoo.com ([68.142.225.205]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HcSFW-0006f6-Qd for help-gnu-emacs@gnu.org; Fri, 13 Apr 2007 16:20:02 -0400 Original-Received: (qmail 29799 invoked from network); 13 Apr 2007 20:20:02 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=Received:X-YMail-OSG:Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-Id:Mime-Version:X-Mailer:Content-Transfer-Encoding; b=Vl1ZXclZPufBWKXKxxSOmzwmDd08mkje2t2SsY1AAWcLthxmtHQQDDWMtXfjQuB5XoKCozAO1PVVND8YoE546GJ1vB/ZBSRMVwjy9zlwUFSVYHVo3q9TznsA+nnP32+ERBc3k6nAHIysx87kmzFzyic91YXAFVNB7D9tZasnJgw= ; Original-Received: from unknown (HELO ?192.168.1.3?) (billlinux@rogers.com@74.104.51.86 with plain) by smtp107.rog.mail.re2.yahoo.com with SMTP; 13 Apr 2007 20:20:02 -0000 X-YMail-OSG: PdYMBkUVM1ncpjsJhYQhyVRjXBJUEMCm4LV9b20OvBz5Qw55BVKrfqG33vvhNnBZdA-- In-Reply-To: <461FD736.2080709@gatech.edu> X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) X-detected-kernel: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42655 Archived-At: Ok guys, now I am really totally confused. I have been using emacs for 2 years. I have read the Wiki, printed out the tiny-tools site and read and re-read the info pages. Over the last 2 years I have written about 10 keybinding functions, that are in my .emacs, and that I use all the time. They have always been in the form of (global-set-key [(M-s)] 'shell-command). Now 'kbd' shows up, and '?\' to replace it. And, whats a #' for, that replaces the single '. I just want to get consistent. I plan to do a fair amount of work with emacs shortly. Up to now I haven't worried much because I used my emacs 21.4 only for trivial text editing. So ... in (global-set-key (kbd "M-s") #'shell-command) Does ?\ = kbd ? Does [ ] replace ( ) ? Are the " " necessary or not necessary ? Does the # have a special meaning or is it always used now? Where do I find the kbd documentation that I already haven't looked at? Do symbols like F3 still require < > ? What syntax would work for both standard emacs functions and my own user functions? Emacs 22 is going to show up when I upgrade to Fedora 7. Is keybinding going to be different again? On Fri, 2007-04-13 at 15:17 -0400, Matthew Flaschen wrote: > Karl Hegbloom wrote: > > On Fri, 2007-04-13 at 15:02 -0400, William Case wrote: > >> I have set (global-set-key [(M-s)] 'shell-command) in my .emacs. > >> I also want to keep the M-! shell-command binding > >> > >> Nothing happens when I use M-s, nor do I get an error message. > > > > I think that the syntax of the expression describing the key is > > incorrect. > > The correct syntax is: > > [?\M-s] It works. > Try looking at the documentation of the `kbd' macro (F1 f > > kbd). You can use it there, like: > > (global-set-key (kbd "M-s") #'shell-command) It also works. > There's no need for kbd here. It's unnecessary overhead. > I know there are several ways to do this -- but I need to know, for me, some way that is consistent. I am partial to ?\ unless it has lots of exceptions (i.e ?\C, ?\S, ?\s ??) -- if so, I'll use 'kbd' throughout. Sorry if I sound a little grouchy, but right now my emacs frustration knows no bounds and I am unable to make sense of anything that I read. It is like day one, two years ago, all over again. I thought I had this simple task -- binding functions to keys worked out. > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs -- Regards Bill