From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Voegele Newsgroups: gmane.emacs.help Subject: Re: Cannot remap umlaut keys Date: Fri, 07 Nov 2003 20:57:52 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87islw6jen.fsf@ID-28718.user.uni-berlin.de> References: <878ymsf6o8.fsf@ID-28718.user.uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1068235445 9952 80.91.224.253 (7 Nov 2003 20:04:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2003 20:04:05 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 07 21:04:03 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 1AICpu-0001wm-01 for ; Fri, 07 Nov 2003 21:04:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AIDjm-0007Ht-Of for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2003 16:01:46 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!pd9519ca3.dip.t-dialin.NET!not-for-mail Original-Newsgroups: gnu.emacs.help,de.comp.editoren Original-Lines: 47 Original-NNTP-Posting-Host: pd9519ca3.dip.t-dialin.net (217.81.156.163) Original-X-Trace: news.uni-berlin.de 1068235095 47929322 217.81.156.163 (16 [28718]) X-Orig-Path: kepler.voegele.dyndns.org!news X-Request-PGP: http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0x12C21DCA User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:c6atD563cT4ZCVQylzyKOfwY3C4= Original-Xref: shelby.stanford.edu gnu.emacs.help:117986 de.comp.editoren:10997 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:13923 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13923 Stefan Monnier writes: >> I used to remap the umlaut keys in CC Mode but the following key >> bindings no longer work when Emacs 21.3.1 is run under X. The >> bindings work if Emacs is started on the Linux console though. > >> (add-hook 'c-mode-common-hook >> '(lambda () >> (local-set-key [?\366] "{") ; ö -> { >> (local-set-key [?\344] "}") ; ä -> } >> (local-set-key [?\326] "[") ; Ö -> [ >> (local-set-key [?\304] "]") ; Ä -> ] >> (local-set-key [?\337] "\\"))) ; ß -> \ > > ?\366 is not the same as ö. How about > > (local-set-key [ö] "{") [ö] or [?ö]? I forgot to mention that I tried to use [?ö] before I posted my article. [?ö] (or [ö]) neither works under X *nor* on the console. state 0x0, keycode 47 (keysym 0xf6, odiaeresis), same_screen YES, XLookupString gives 1 bytes: "ö" I'm pretty sure that [?\366] worked in earlier versions of Emacs. I think that I started to use the above piece of code when Emacs 19 was current. > This might not always work, tho. If it doesn't, then maybe your > locale is not set properly. The locale is set to de_DE.iso88591 which, according to "locale -a" is supported by the C library. I also tried to use de_DE. > The problem is that the .emacs file should be in the same > coding-system as your keyboard (and the keyboard's coding system > under X is determined by your locale). My .emacs is encoded in ASCII. I encoded it in Latin-1 when I experimented with [?ö]. I also tried UTF-8. I just realized that (local-set-key [?ö] "{") works under X if the expression is executed from within the buffer that contains the C file. If the expression is evaluated in the c-mode-common-hook it doesn't work. On the other hand, it is no problem to bind { to keys like f1, return or a, for example.