help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MacOS X: Not all Alt keys are equal?


From: Lars-Johan Liman
Subject: MacOS X: Not all Alt keys are equal?
Date: Wed, 23 Mar 2011 13:36:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (darwin)

Hi!

I'm a veteran Emacs user (how many of you used Emacs on TOPS-20? ;-),
and mostly an X11 user under *nix, and I've been using various Emacsen
under MacOS X the past few years.

My problem is that I want to map the Alt keys to allow for input of
special characters. (A Swedish Mac keyboard maps, e.g., vertical bar
(pipe) to Alt-7, and backslash to Alt-Shift-7).

I just tried the emacsformacosx.org package, and it was very promising
until I noticed the following.

By setting

(custom-set-variables
 '(ns-alternate-modifier (quote none)))

in my .emacs file, I got the disired behaviour on the _left_ Alt
key. Alt-7 produces pipe, Alt-Shift-7 produces backslash. Fine!

Now, to make the _right_ Alt key behave the same way, I tried adding

 '(ns-right-alternate-modifier (quote none))

to the config, as in

(custom-set-variables
 '(ns-alternate-modifier (quote none))
 '(ns-right-alternate-modifier (quote none)))

One would now believe that it would work. It does not.

It's true that I get the "Alt" behaviour, but only to some extent. Now
rAlt-7 (rightAlt-7) gives me pipe (fine!), but rAlt-Shift-7 does not
give me the expected backslah, it gives me forwardslash, which is what
you get with just Shift-7 on a Swedish keyboard. The same goes for
rAlt-8 and rAlt-9 which give brackets "[" and "]" respectively, but the
corrseponding braces "{" and "}" exepcted from rAlt-Shift-8 and
rAlt-Shift-9 show up only as the dull parentheses "(" and ")". Footnote *)

Conclusion: the Alt-function for the right Alt key does not work in
conjunction with Shift, but the left one does.

Now I just found out that there is yet another value for the variable,
which is "left", which means that rAlt shall have the same function as
lAlt. When I set it to that, it _DOES_ work! But then, I cannot have a
different function on lAlt. Duh!

Why are not all Alt keys created equal? ;-) What did I miss?
How can I make my lAlt be "meta" and my rAlt be "none" with shift
function intact?

... or, is this a bug?

Platform:

Darwin 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; 
root:xnu-1504.9.26~3/RELEASE_I386 i386

Emacs:

Emacs-23.3-universal-10.6.6.dmg

                                Best regards,
                                  /Lars-Johan Liman

*) Paretheses are "shifted" one step to the left on a Swedish keyboard,
   compared to a US or UK one, so the numbers are actually correct.
#-------------------------------------------------------------------------
# Lars-Johan Liman, M.Sc.                ! E-mail: address@hidden
# Cafax AB                               ! HTTP  : //www.cafax.se/
# Computer Consultants, Sweden           ! Voice : +46 8 - 564 702 30
#-------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]