From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: dave@adboyd.com (J. David Boyd) Newsgroups: gmane.emacs.help Subject: Re: "translated from" keystrokes Date: 16 Sep 2004 15:31:22 -0400 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <81mzzq2eph.fsf@adboyd.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1095363120 22734 80.91.229.6 (16 Sep 2004 19:32:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2004 19:32:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 16 21:31:48 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C81yu-00052e-00 for ; Thu, 16 Sep 2004 21:31:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C824a-0007t4-Ik for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Sep 2004 15:37:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C824S-0007sz-R6 for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 15:37:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C824Q-0007sn-2v for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 15:37:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C824P-0007sk-W2 for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 15:37:30 -0400 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C81yg-0001Eh-Fk for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 15:31:34 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1C81yf-0007Zi-00 for ; Thu, 16 Sep 2004 21:31:33 +0200 Original-Received: from wbar5.tampa1-4-11-125-246.dsl-verizon.net ([4.11.125.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Sep 2004 21:31:33 +0200 Original-Received: from dave by wbar5.tampa1-4-11-125-246.dsl-verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Sep 2004 21:31:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 33 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: wbar5.tampa1-4-11-125-246.dsl-verizon.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20721 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20721 Walker Pendleton writes: > On 16 Sep 2004, J. David Boyd wrote: > > When I C-h k C-S-w, I get this message: > > > > C-w (translated from C-S-w) runs the command kill-region > > > > I looked through the emacs docs, and it says that key translations > > are explained in the elisp manual, and I've read through that, but > > probably not enough, as I still don't know how to break this > > translation, so I can assign a function to C-S-w. > > > > Now, I can put the following text into my scratch buffer > > (global-set-key [control shift w] 'emacs-uptime) and evaluate it > > with C-x C-e, and the mode line says emacs-uptime. > > Try using "kbd" in your call to global-set-key. I find it's syntax > much easier to figure out than trying to give emacs the `canonical > name' of a particular key sequence. > > ,---- > | (global-set-key (kbd "C-S-w") 'emacs-uptime) > `---- > > > Still, C-h k C-S-w reports kill-region. Actually, C-h k shows that > > it is reporting on C-w, so the key translation must be happening at > > a very low level. > > The translation only happens if there's no C-S-w binding. Ah, great tip, and it worked perfectly. Thank you so much! Dave