5

I am using Mac OS X Yosemite if this matters at all. Is there a way, while in the emacs GUI, to force every key combination to run the emacs command specified by this key binding instead of other application's command.

I can only think of one such conflict for now, but I'm sure more will come up as I learn more about emacs.

  • M-<SPC> should run just-one-space, but instead it opens albert's search functionality.
  • 1
    Go into System Preferences, and click on Keyboard, then click on Keyboard Shortcuts -- go through every keyboard shortcut assignment and if you don't like it, change it or disable it. If under the regular Keyboard tab you don't have treat function keys as regular keys, consider changing that so that function keys are treated as regular keys. I have to admit that I'm using an older version of OSX, but Apple is pretty good about keeping core basic functionality such as keyboard shortcuts user configuration abilities when they upgrade an OS. – lawlist May 8 '15 at 7:57
  • I was rather looking for an option inside Emacs itself, so that I can keep the key bindings that I have gotten used to when using other apps. – samlaf May 8 '15 at 8:05
  • 13
    @samlaf Unfortunately, there isn't an option inside emacs itself. If emacs never receives the key event at all, there's nothing it can do. – Malabarba May 8 '15 at 8:15
  • 1
    You could likely do this by binding M-<spc> (in osx) to run some applescript that checks if Emacs is open and in focus, and forwards the binding to emacs, else it would open Albert. Probably not anywhere near worth the pain through. – Jordon Biondo May 8 '15 at 14:18
-3

I was rather looking for an option inside Emacs itself, so that I can keep the key bindings that I have gotten used to when using other apps.

In Emacs, when invoking the key chord, try switching the order of the two keys M-<SPC> that make up the chord. In this case:

M followed by SPC

or

SPC followed by M

One will bypass the local search, spotlight, or other keyboard triggers and emacs can then pick it up.

  • the M here is short for "meta", and indicates that the user should hold down alt (or I suppose option on the mac) while striking space; holding down space and then striking meta would just result in one or more space characters being inserted into the emacs buffer, followed by the OS opening the search window as normal. – db48x Nov 10 '15 at 7:28
  • @db48x: SPC followed by M in emacs does not open a search window as you claim. Outside emacs it does. Exploiting this difference in behavior is a suggestion given to the OP who wants to keep key bindings same, such as CMD for meta. – Emacs User Nov 10 '15 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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