Passing through certain M-<key> command to OS in Emacs

7

1

Is there a way to pass a certain M-key combination to the OS? I'm using OSX and I'd like to have the "Move focus to next window in application" key which I use to work also in Emacs, currently it just says that M- is undefined (the key combo works in other apps, I use CMD as meta).

auramo

Posted 2010-09-28T19:26:33.527

Reputation: 963

Answers

1

I found a way to switch between the frames with the same command as I have configured OSX to use (CMD-§).

I just added this to init.el:

(global-set-key (kbd "M-§") 'other-frame)

So I don't need to "pass this" to OS, because this will have the exact same effect.

auramo

Posted 2010-09-28T19:26:33.527

Reputation: 963

The problem with this solution is when I have multiple spaces: OSX behaviour is that Cmd+` (or cmd+§) cycles through open windows in the same space. If I have Emacs frames open on different spaces, other-frame command cycles through all of them, switching spaces as needed. – Maciej Pasternacki – 2012-04-14T10:02:07.443

What if you don't want to go to another emacs frame, but just want to move to the next app. – justingordon – 2012-08-10T08:40:28.350

0

Are you talking about using CMD-~? If so, emacs has similar functionality with the following keystrokes:

C-x <LEFT>
Select the previous buffer in the list of existing buffers. 
C-x <RIGHT>
Select the next buffer in the list of existing buffers.

See how to change buffers in the documentation. FWIW, C-h a will let you search the help system for any keywords you'd like.

jrhorn424

Posted 2010-09-28T19:26:33.527

Reputation: 240

My question is a bit unclear: I meant frames not buffers. Anyway, I found an alternative way (see my own answer :) – auramo – 2010-09-30T07:19:31.213