Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

It's official. I love to hate Emacs on Mac OS X.

No matter what I do, I get a thorn in side.

When I try to write \ using Alt + Shift + 7 I get errors because Alt == Meta in Emacs. If I bind the Meta to the Command key I circumvent that error. All is fine. Till I want to use Meta-Tab. Now I'm suddenly trying to Command-Tab away from Emacs into some other application.

I'm furious at the moment, could anyone help me solve this problem? I would prefer it if I could have Alt as meta, not install aquamacs.org and not use the fn key.

Oh, by the way, I use Swedish locale.

EDIT 1:

First solution: add (global-set-key [C-tab] [M-tab]) to ~/.emacs. This will tie the Meta-tabto Control-tab instead. Not what I entirely wanted, but should work.

share|improve this question

4 Answers 4

up vote 5 down vote accepted

See the options under M-x customize-group ns

There you can adjust the behavior of the modifier keys. I have set the right alt to "No modifier" - that's the same behavior as on PC keyboards with Alt-Gr.

Another setting I like is to unset both alt keys and use the function key instead for alt.

share|improve this answer

Some people I know always buy Macs with US keyboards for exactly this reason.

I cursed at Emacs too (in Swedish, as well) and the only solution I've found is to use the US Extended layout, but using my Swedish keyboard. I spent several years with a US keyboard as my main keyboard so I can switch more or less without thinking.

If you're not willing to go the layout-switching route, OS X Emacs in Swedish is just painful.


Edit: Just found a hint for Spanish that might be of help. The idea is to remap the character that gets sent to Emacs to the one you desire. I haven't tried it, but it sounds promising.

share|improve this answer
    
This ought to have been fixed by now, you'd think... –  Zolomon Apr 15 '11 at 11:33

It's not really elegant, but you could use the Escape key for meta and keep the alt key for special characters. E.g. ESC x instead of M-x.

But agree with molbdnilo, most non-US keyboards suck for programming. I once worked in Finland for a couple of weeks, and the first thing I did was switch the KB to US. Even blind typing was easier than figuring out how to type those characters you need so often in programming languages. (well, actually the first thing I did was to switch the language; fortunately I knew how to do that by muscle memory :-)

share|improve this answer
    
Yeah, it's almost as if the most common syntaxes were invented by Americans. ;-) –  molbdnilo Apr 15 '11 at 13:45

I have also had this problem for years! Just recently I tried out Emacs in OS X again. I finally fixed the problem by adding the following in my .emacs: (This is with Emacs 24.3)

(when (eq system-type 'darwin)
  (setq mac-right-option-modifier 'none))
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.