From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: litter@graffiti.net (paul) Newsgroups: gmane.emacs.help Subject: Re: How to translate M-kp-multiply to M-* before key is mapped to function? Date: 4 Jul 2004 14:51:25 -0700 Organization: http://groups.google.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <40E58E31.60508@yahoo.com> NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1088978012 12641 80.91.224.253 (4 Jul 2004 21:53:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 4 Jul 2004 21:53:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 04 23:53:26 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 1BhEvN-0004Rk-00 for ; Sun, 04 Jul 2004 23:53:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhExJ-0004xW-J4 for geh-help-gnu-emacs@m.gmane.org; Sun, 04 Jul 2004 17:55:25 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews2.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 111 Original-NNTP-Posting-Host: 62.166.109.6 Original-X-Trace: posting.google.com 1088977885 13208 127.0.0.1 (4 Jul 2004 21:51:25 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 4 Jul 2004 21:51:25 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:124126 Original-To: help-gnu-emacs@gnu.org 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:19457 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19457 My problem is, is that kp-multiply is bound to * somewhere down the line, but C-kp-multiply, M-kp-multiply and C-M-kp-multiply are not. I would like C-kp-multiply to act like C-*, M-multiply to act like M-*, and C-M-kp-multiply to act like C-M-* (without having to rely on information to what functions C-*, M-* and C-M-* are bound). How to tell keyboard-translate to do just this? I tried any sequence of char, strings, ints etc. to get keyboard-translate to do what I want, but the closest I get are errors which show that my literals are wrong or are interpreted as 'C-k' (with 'p-multiply' as the trail of the literal) etc. Kevin Rodgers wrote in message news:<40E58E31.60508@yahoo.com>... > paul wrote: > > I've nearly pulled out my hair for the following problem; > > I want to translate M-kp-multiply to M-* *BEFORE* the key > > gets bound to its default function (in my case pop-tag-mark). > > You must be running emacs without a window system (or under a window > system, but with the -nw command line option). In an xterm on my > platform (i386-pc-solaris2.7, X toolkit), `C-h k M-kp-multiply' shows > > | ESC * runs the command pop-tag-mark > > and then `C-h l' shows > > | C-h k ESC * C-h l > > The odd thing is that function-key-map contains this entry > > (kp-multiply . [42]) > > but no escape sequence that maps to [kp-multiply] in the way that `ESC [ > 1 1 ~' is bound to [f1] or `ESC O p' is bound to [kp-1]. > > > I do *not* want to use global-set-key but am looking for > > a general way to remap non-ascii input events. > > What non-ASCII input event do you think your terminal is sending to > Emacs? > > > Using (define-key function-key-map ...) or (define-key key-translation-map ...) > > is too late; I can remap the key, but the function pop-tag-mark is not > > called. > > Since setting function-key-map and key-translation-map do not change the > results reported by `C-h k' and `C-h l', I don't think they have > anything to do with it: I think it means that the xterm is actually > sending `*' to Emacs, not an escape sequence. > > > Trying an approach with keyboard-translate drives me nuts because > > it does not seem to support non-ascii events. > > What do you want to do? It seems like you want to bind M-kp-multiply to > a different command, but for some reason you don't want to use > global-set-key like this: > > (global-set-key "\M-*" 'whatever) > > -- > Kevin Rodgers > paul wrote: > > I've nearly pulled out my hair for the following problem; > > I want to translate M-kp-multiply to M-* *BEFORE* the key > > gets bound to its default function (in my case pop-tag-mark). > > You must be running emacs without a window system (or under a window > system, but with the -nw command line option). In an xterm on my > platform (i386-pc-solaris2.7, X toolkit), `C-h k M-kp-multiply' shows > > | ESC * runs the command pop-tag-mark > > and then `C-h l' shows > > | C-h k ESC * C-h l > > The odd thing is that function-key-map contains this entry > > (kp-multiply . [42]) > > but no escape sequence that maps to [kp-multiply] in the way that `ESC [ > 1 1 ~' is bound to [f1] or `ESC O p' is bound to [kp-1]. > > > I do *not* want to use global-set-key but am looking for > > a general way to remap non-ascii input events. > > What non-ASCII input event do you think your terminal is sending to > Emacs? > > > Using (define-key function-key-map ...) or (define-key key-translation-map ...) > > is too late; I can remap the key, but the function pop-tag-mark is not > > called. > > Since setting function-key-map and key-translation-map do not change the > results reported by `C-h k' and `C-h l', I don't think they have > anything to do with it: I think it means that the xterm is actually > sending `*' to Emacs, not an escape sequence. > > > Trying an approach with keyboard-translate drives me nuts because > > it does not seem to support non-ascii events. > > What do you want to do? It seems like you want to bind M-kp-multiply to > a different command, but for some reason you don't want to use > global-set-key like this: > > (global-set-key "\M-*" 'whatever)