* MacOS X: Not all Alt keys are equal?
@ 2011-03-23 12:36 Lars-Johan Liman
2011-03-25 2:52 ` Kevin Rodgers
0 siblings, 1 reply; 9+ messages in thread
From: Lars-Johan Liman @ 2011-03-23 12:36 UTC (permalink / raw)
To: help-gnu-emacs
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: emacshelp@cafax.se
# Cafax AB ! HTTP : //www.cafax.se/
# Computer Consultants, Sweden ! Voice : +46 8 - 564 702 30
#-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: MacOS X: Not all Alt keys are equal?
2011-03-23 12:36 MacOS X: Not all Alt keys are equal? Lars-Johan Liman
@ 2011-03-25 2:52 ` Kevin Rodgers
2011-03-25 10:18 ` Peter Dyballa
2011-03-25 13:09 ` Perry Smith
0 siblings, 2 replies; 9+ messages in thread
From: Kevin Rodgers @ 2011-03-25 2:52 UTC (permalink / raw)
To: help-gnu-emacs
On 3/23/11 6:36 AM, Lars-Johan Liman wrote:
> I'm a veteran Emacs user (how many of you used Emacs on TOPS-20? ;-),
+1 (CMU '84)
> and mostly an X11 user under *nix,
+1
> and I've been using various Emacsen under MacOS X the past few years.
Myself, just GNU Emacs 23.x
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: MacOS X: Not all Alt keys are equal?
2011-03-25 2:52 ` Kevin Rodgers
@ 2011-03-25 10:18 ` Peter Dyballa
2011-03-25 13:09 ` Perry Smith
1 sibling, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2011-03-25 10:18 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
Am 25.03.2011 um 03:52 schrieb Kevin Rodgers:
> Myself, just GNU Emacs 23.x
I'm not that experienced with a that long past, but I'd give GNU Emacs
24.0.50 a try on Mac OS X!
--
Mit friedvollen Grüßen
Pete
_o o o o
_<< \\_/\_, \\_ \\_/\_,
(*)/(*) (*) (*) (*) `- (*)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: MacOS X: Not all Alt keys are equal?
2011-03-25 2:52 ` Kevin Rodgers
2011-03-25 10:18 ` Peter Dyballa
@ 2011-03-25 13:09 ` Perry Smith
1 sibling, 0 replies; 9+ messages in thread
From: Perry Smith @ 2011-03-25 13:09 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
On Mar 24, 2011, at 9:52 PM, Kevin Rodgers wrote:
> On 3/23/11 6:36 AM, Lars-Johan Liman wrote:
>> I'm a veteran Emacs user (how many of you used Emacs on TOPS-20? ;-),
>
> +1 (CMU '84)
I'm envious. My Advanced Compilers Class instructor was from industry. I had out grown all the professors resident in the college I was at (S. M. U.). He was from CMU. Brilliant person and by far my favorite instructor and class. Made me wish I had gone to a more prestigious school.
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <mailman.2.1300886420.19469.help-gnu-emacs@gnu.org>]
* Re: MacOS X: Not all Alt keys are equal?
[not found] <mailman.2.1300886420.19469.help-gnu-emacs@gnu.org>
@ 2011-03-24 12:04 ` Peter Breitfeld
2011-03-25 13:56 ` Lars-Johan Liman
0 siblings, 1 reply; 9+ messages in thread
From: Peter Breitfeld @ 2011-03-24 12:04 UTC (permalink / raw)
To: help-gnu-emacs
Lars-Johan Liman wrote:
> 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: emacshelp@cafax.se
> # Cafax AB ! HTTP : //www.cafax.se/
> # Computer Consultants, Sweden ! Voice : +46 8 - 564 702 30
> #-------------------------------------------------------------------------
>
Lars,
Inspecting customize-group ns I found the following settings:
Variable Status
------------------------------------------------------
ns-control-modifier: control (STANDARD)
ns-command-modifier: meta (CHANGED in my .emacs)
ns-alternate-modifier: 'meta (CHANGED, but not in my .emacs,
I didn't find where it was set)
Help on this variable says: defined in C Source Code. It's value is nil
ns-right-alternate-modifier:
Use the value of ns-alternate-modifier (STANDARD)
Help says: It's value is left
I use the same Emacs-version as you do with a german keyboard. On my
iMac left and right alt-keys behave identical.
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: MacOS X: Not all Alt keys are equal?
2011-03-24 12:04 ` Peter Breitfeld
@ 2011-03-25 13:56 ` Lars-Johan Liman
2011-03-25 15:03 ` Peter Dyballa
0 siblings, 1 reply; 9+ messages in thread
From: Lars-Johan Liman @ 2011-03-25 13:56 UTC (permalink / raw)
To: help-gnu-emacs
Peter,
phbrf@t-online.de:
> Lars,
> Inspecting customize-group ns I found the following settings:
> Variable Status
> ------------------------------------------------------
> ns-control-modifier: control (STANDARD)
> ns-command-modifier: meta (CHANGED in my .emacs)
> ns-alternate-modifier: 'meta (CHANGED, but not in my .emacs,
> I didn't find where it was set)
> Help on this variable says: defined in C Source Code. It's value is nil
> ns-right-alternate-modifier:
> Use the value of ns-alternate-modifier (STANDARD)
> Help says: It's value is left
> I use the same Emacs-version as you do with a german keyboard. On my
> iMac left and right alt-keys behave identical.
Hmm. I wouldn't have thought that would work the way I want it to.
For me to understand better: which key combination do you use to
generate a backslash inside your Emacs, given the above settings?
Cheers,
/Liman
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: MacOS X: Not all Alt keys are equal?
2011-03-25 13:56 ` Lars-Johan Liman
@ 2011-03-25 15:03 ` Peter Dyballa
2011-03-25 15:15 ` Lars-Johan Liman
0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2011-03-25 15:03 UTC (permalink / raw)
To: Lars-Johan Liman; +Cc: help-gnu-emacs
Am 25.03.2011 um 14:56 schrieb Lars-Johan Liman:
> For me to understand better: which key combination do you use to
> generate a backslash inside your Emacs, given the above settings?
In the context mentioned I think pressing the right alt key would not
help producing the \. It's default or STANDARD value is that of the
corresponding left key.
I have set my only alt key to "(quote) none" (original value was meta)
and let the cmd key be super, and also the remaining others be what
they are. This gives me the opportunity to use the alt key as
introductory key to switch the keyboard layout from the visible to the
"alternate" layout, i.e. that, which produces \, {, }, «, », etc.
--
Greetings
Pete
Upgraded, adj.:
Didn't work the first time.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: MacOS X: Not all Alt keys are equal?
2011-03-25 15:03 ` Peter Dyballa
@ 2011-03-25 15:15 ` Lars-Johan Liman
2011-03-25 15:46 ` Peter Dyballa
0 siblings, 1 reply; 9+ messages in thread
From: Lars-Johan Liman @ 2011-03-25 15:15 UTC (permalink / raw)
To: help-gnu-emacs
Peter,
Peter_Dyballa@Web.DE:
> In the context mentioned I think pressing the right alt key would not
> help producing the \.
That's what I thought.
> It's default or STANDARD value is that of the corresponding left key.
That's what I thought too. But as I said, I want the left one to be
"meta", and the right one to be "none" (= switch layout to alternate).
> I have set my only alt key to "(quote) none" (original value was meta)
> and let the cmd key be super, and also the remaining others be what
> they are. This gives me the opportunity to use the alt key as
> introductory key to switch the keyboard layout from the visible to the
> "alternate" layout, i.e. that, which produces \, {, }, «, », etc.
Hmm. Well the problem manifests itself when you have two Alt keys, and
want to make them do different things.
</me sends a longing thought to xmodmap ... ;-)>
Cheers,
/Liman
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: MacOS X: Not all Alt keys are equal?
2011-03-25 15:15 ` Lars-Johan Liman
@ 2011-03-25 15:46 ` Peter Dyballa
0 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2011-03-25 15:46 UTC (permalink / raw)
To: Lars-Johan Liman; +Cc: help-gnu-emacs
Am 25.03.2011 um 16:15 schrieb Lars-Johan Liman:
> Hmm. Well the problem manifests itself when you have two Alt keys, and
> want to make them do different things.
My old PowerBook has two cmd keys. The keyboard controller treats them
as one. So neither in X11 nor in Quartz/Aqua is a difference and so
setting an ns-left-command-modifier is pointless.
You can try Peter Maurer's Key Codes application (http://www.petermaurer.de/nasi.php?section=keycodes
) to see whether the two keys are really independent.
>
> </me sends a longing thought to xmodmap ... ;-)>
It'll fail when both keys are one... Did you try any X11 variant of
GNU Emacs? There exist quite useful X11 installations for Mac OS X.
A quite useful Emacs variant is the "AppKit" Emacs, based on GNU Emacs
23.3 and patch files: /ftp:anonymous@ftp.math.s.chiba-u.ac.jp:/
emacs. Cmd is Meta, except for some sane combinations that are caught
by the OS, and alt is just alt. Super and Hyper modifier can be set.
--
Greetings
Pete
Without vi there is only GNU Emacs
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-03-25 15:46 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-23 12:36 MacOS X: Not all Alt keys are equal? Lars-Johan Liman
2011-03-25 2:52 ` Kevin Rodgers
2011-03-25 10:18 ` Peter Dyballa
2011-03-25 13:09 ` Perry Smith
[not found] <mailman.2.1300886420.19469.help-gnu-emacs@gnu.org>
2011-03-24 12:04 ` Peter Breitfeld
2011-03-25 13:56 ` Lars-Johan Liman
2011-03-25 15:03 ` Peter Dyballa
2011-03-25 15:15 ` Lars-Johan Liman
2011-03-25 15:46 ` Peter Dyballa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).