1
votes

Good evening,

I have a problem using Emacs in Terminal.app the last 9 hours but wasn't able to solve it on my own. The workarounds I have found on Stackoverflow etc. didn't persuade me.

I didn't want to use the Option 'Wahltaste als Metataste verwenden' (alt/option as meta), because I have to type for example {}[] with my alt-key. Keybinding of these Charakters in Emacs is no solution for me, because outside of Emacs in nano I want to use []{}..., too.

I also didn't want to use iTerm2.app, I think it should be possible in Terminal too. Because sometimes I use Emacs over SSH, it is not possible to choose an GUI-based Emacs either. A possibilty I would accept is to use the left alt/option key for meta and the right one for typing []{}... Or the Fn-Key for meta... But I wasn't able to do it the last 9 hours...

I already ported 'emulate-mac-keybord-mode.el' from Aquamacs, but I didn't get it work as expected.

Does anybody have an idea?

Thanks in advance,

Zappel

1
You are aware of Tramp, aren't you?lunaryorn

1 Answers

1
votes

If you insist on a TTY Emacs within Terminal.app, you may probably have some success with kernel level remappings of modifier keys, using KeyRemap4MacBook. I do not know, because I never used it for such things, and since the key codes, Terminal.app sends to the TTY process when a modifier is pressed, are ultimately hard-coded in Terminal.app, this is neither easy nor particularly pretty.

iTerm2 probably provides means to customize modifiers individually, and is generally a superior terminal emulator (with the notable exception of color management), but frankly, do yourself a favor, and use a GUI Emacs.

A GUI Emacs provides a much nicer expierence on OS X. You are not only able to map each modifier key individually with mac-option-modifier and friends, you also more modifiers available, namely Super and Hyper.

For instance, the following setting uses the Command keys as Meta, the function key has Hyper, and keeps the Option keys for OS X, so that you can still use the alternate layout level:

(setq mac-option-modifier   'none
      mac-command-modifier  'meta
      mac-function-modifier 'hyper)

To edit files on remote systems, you'd just use Tramp then.