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: Thu, 07 Aug 2003 12:38:54 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F329CBE.8050706@yahoo.com> References: 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: main.gmane.org 1060282783 25363 80.91.224.253 (7 Aug 2003 18:59:43 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 7 Aug 2003 18:59:43 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 07 21:00:06 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 19kpza-0002gX-00 for ; Thu, 07 Aug 2003 21:00:06 +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 19kpm4-0006Oa-45 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Aug 2003 14:46:08 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: news.uni-berlin.de 1060281527 30170328 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:115736 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:11655 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11655 Jussi Piitulainen wrote: > I want to use Alt as a Meta key, with the exception that certain keys > should be interpreted as ordinary unmodified characters: Alt-7 should > produce vertical bar |, Shift-Alt-7 alias Alt-/ should produce > backslash \, and there are a few others, all in ASCII. > > I have managed to (global-set-key "\M-7" "|"). That works for writing > but is not a real solution. At least in an incremental search Alt-7 > has already been interpreted as two keys: the escape terminates the > search and 7 is inserted in the buffer. Try setting search-exit-option to nil. > I could not work out how to use keyboard-translate to turn Alt-7 into > vertical bar. If this is possible, could someone please show me the > concrete command? Or any other way to achieve my goal? (keyboard-translate ?\M-7 ?|) doesn't work, because keyboard-translate-table is a char-table, which only handles unmodified characters. So perhaps you can use (abuse?) function-key-map: (define-key function-key-map "\M-7" [?|]) That only takes effect if you also remove its default binding: (global-unset-key "\M-7") > Emacs is 21.3.50.6 from 2002-11-27, a binary distribution for Mac OS > X, the keyboards are Apple's - Finnish layout - Alt is sometimes > called Option. I know I lose a couple of command bindings; I can > produce all accented letters with dead keys. -- Kevin Rodgers