ergoemacs / ergoemacs-mode

ergoemacs-mode
ergoemacs.github.io/
GNU General Public License v3.0
293 stars 35 forks source link

Key chords listed as Apple Command on the Ergoemacs Keymap don't work in Emacs.app #460

Closed ceridwen closed 3 years ago

ceridwen commented 7 years ago

I'm running https://emacsformacosx.com/ on Mac OS X 10.12.5. This installs Emacs to /usr/local/Cellar/emacs/25.2/Emacs.app (or a corresponding location for other Emacs versions) and lets you run Emacs through the GUI. I have ergoemacs installed through melpa and enabled in my .emacs as such:

(setq ergoemacs-theme nil) ;; Uses Standard Ergoemacs keyboard theme
(setq ergoemacs-keyboard-layout "us") ;; Assumes QWERTY keyboard layout
(ergoemacs-mode 1)

My issue is that the keys listed as using the Apple-Command/Alt keys work using Alt, the key two spaces away from the spacebar, not Apple-Command. Some default Apple key chords still work, Command-X and Command-C for instance because they're Mac OS X defaults that Emacs.app interprets, but this leaves me without easy access to the cut-line command, which I can access as Alt-G but not Command-G like I ought to be able to.

mattfidler commented 7 years ago

Depending on the mac system, you have to modify the appropriate variable either:

(setq mac-command-modifier 'meta)

or

(setq ns-command-modifier 'meta)

Unfortunately, I'm not on a mac, so I don't remember what emacsforosx does. I don't remember what the options are either.

ceridwen commented 7 years ago

For my version of Mac OS X and Emacs.app, (setq mac-command-modifier 'meta) worked. Is there any chance this could be added to the FAQ or the install instructions?

wlandry commented 4 years ago

Looking through the source for Emacs from , I see that mac-command-modifier is an alias for ns-command-modifier. Also, looking at , it recommends setting the ns-* variables.

So what I ended up doing is swapping command and alt for emacs with the lines

(setq ns-command-modifier 'meta)
(setq ns-alternate-modifier 'super)

The current docs recommend

(setq ergoemacs-use-mac-command-as-meta nil)

That variable does not exist in the current version of ergoemacs. I will make a patch to fix this.