From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Alt as meta, except for certain keys, how? Date: Tue, 12 Aug 2003 11:14:17 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F392069.1010103@yahoo.com> References: <3F329CBE.8050706@yahoo.com> <3F33F14F.2060903@yahoo.com> <3F37FC9E.5000203@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1060708617 22596 80.91.224.253 (12 Aug 2003 17:16:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Aug 2003 17:16:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 12 19:16:55 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19mclT-0000xl-00 for ; Tue, 12 Aug 2003 19:16:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19mckp-0008N6-Cc for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Aug 2003 13:16:15 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 89 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: news.uni-berlin.de 1060708453 34082507 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:115839 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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:11757 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11757 Jussi Piitulainen wrote: > Kevin Rodgers writes: >>So you need to use the vector notation for keys containing >>meta-modified non-ASCII characters: >> >>(define-key key-translation-map [?\M- ...] ...) > > M-space? Anyway, that did not seem to work when I tried it. The key > remained unbound. Sorry, I was trying to show a general form via ellipses. A concrete example would be (define-key key-translation-map [?\M-7] "|") >>>Is there a way to turn every valid key code into an >>>Escape-Meta-Alt-Control-Shift-something? Or can I use a numeric key >>>code with function-key-map? >> >>I don't understand your question. > > I'm sorry. A concrete instance of the first question is this. I'll > write "letter" for the non-ASCII letters. The following works: > > (define-key key-translation-map [-134217482] "o") > > I would like to find out a more transparent syntax for that number; > text-char-description does not do it. Things like [?\M-letter] and > [?\M- ?letter] and [(meta ?letter)] do not seem to work. I don't know why those wouldn't work (except that the extra space and question mark between ?M- and letter in the first form are wrong), unless there are keyboard/buffer/file coding issues. You might want to use the octal encoding instead: [?\M-\241] ; meta inverted exclamation point > For the second question I know the answer now: the following works. > > (global-unset-key [-134217500]) > (define-key function-key-map [-134217500] "a") > > I got these numbers by pressing the key I want to bind: Alt-letter, > where Alt is Meta and letter is outside ASCII. However, ?\M-letter > evaluates to -134215434 rather than -134217482. If I omit to set > mac-keyboard-text-encoding to Latin-1, ?\M-letter evaluates to > -134217574, which is again something else (and the key in question > cannot be used to produce the letter any more). I don't understand Emacs' encoding scheme at all, nor do I want to. > "\M-letter" evaluates to a string that contains just the letter. The only meta characters that can be included in a string are the meta- modified ASCII characters: | In a string, the 2**7 bit attached to an ASCII character indicates a | meta character; thus, the meta characters that can fit in a string have | codes in the range from 128 to 255, and are the meta versions of the | ordinary ASCII characters. That's why you have to use the vector notation. > I think I'll use the numbers for these few keys. The "Character Type" node of the Emacs Lisp manual strongly discourages that: | Since characters are really integers, the printed representation of a | character is a decimal number. This is also a possible read syntax for | a character, but writing characters that way in Lisp programs is a very | bad idea. You should _always_ use the special read syntax formats that | Emacs Lisp provides for characters. These syntax formats start with a | question mark. -- Kevin Rodgers