Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: OS X System Key Combinations

6 views
Skip to first unread message

tsh...@bearingthenews.com

unread,
May 20, 2013, 7:51:53 PM5/20/13
to help-gn...@gnu.org
Hi,

I was a little surprised that this didn't get a response. I can't believe that its the only time its come up. Is this an FAQ of some type?

Thanks for any help.

Tom S.

On May 17, 2013, at 4:14 AM, tsh...@bearingthenews.com wrote:

> Hi.
>
> I'm using Emacs 24.3.1 under OS X. I have a number of keyboard combinations which trigger system Services ("Send a Quick Note via the Mail.app", "Insert Date Stamp", etc…). Unlike the Cocoa apps, when I press these key combinations in Emacs I get a "<insert key combination here> is undefined" message. How can I get Emacs to pass these key combinations through to the operating system to trigger my scripts?
>
> Thanks for any advice,
>
> Tom S.
>
>
>


Peter Dyballa

unread,
May 21, 2013, 5:07:07 AM5/21/13
to tsh...@bearingthenews.com, help-gn...@gnu.org

Am 21.05.2013 um 01:51 schrieb tsh...@bearingthenews.com:

> I was a little surprised that this didn't get a response. I can't believe that its the only time its come up. Is this an FAQ of some type?

No, it's just an understanding type. Without using some Mac OS X libraries or Frameworks you do not have access to the Mac OS X services. You might try to write Elisp functions that use osascript to access the Mac OS X services… Why isn't your X server or your terminal emulator, in which GNU Emacs runs, providing the access you want?

What is so bad of using the NS variant of GNU Emacs or the AppKit Emacs?

--
Mit friedvollen Grüßen

Pete

Got Mole problems?
Call Avogadro 6.02 x 10^23


tsh...@bearingthenews.com

unread,
May 21, 2013, 5:18:09 PM5/21/13
to help-gn...@gnu.org
Hi Peter.

Well, I would agree that its an understanding type. Most questions usually are. :)

I'm using GNU Emacs version 24.3 It was obtained here:

http://emacsformacosx.com

As far as I know the X server on my system is not running. At least not of the type I've used for almost 20 years under Linux. It doesn't say it explicitly on the website but it certainly looks like it is, indeed, the "AppKit Emacs".

I take it from your response that this should, indeed, be passing the key combinations through to the system using this version of Emacs and that there is something wrong with my installation. Is that correct?

Thanks for the response and for any further help.

Tom S.

Peter Dyballa

unread,
May 21, 2013, 5:41:15 PM5/21/13
to tsh...@bearingthenews.com, help-gn...@gnu.org

Am 21.05.2013 um 23:18 schrieb tsh...@bearingthenews.com:

> http://emacsformacosx.com
>
> As far as I know the X server on my system is not running. At least not of the type I've used for almost 20 years under Linux. It doesn't say it explicitly on the website but it certainly looks like it is, indeed, the "AppKit Emacs".

No, it looks like the NS variant from the unpatched GNU Emacs 24.3.50 sources. It will report on M-x emacs-version RET something like:

GNU Emacs 24.3.50 (i386-apple-darwin10.8.0, NS apple-appkit-1038.36) of 2013-05-20 on …
**

The "AppKit Emacs", with a history as Carbon Emacs, will report something like this:

GNU Emacs 23.4.1 (x86_64-apple-darwin10.8.0, Carbon Version 1.6.0 AppKit 1038.36) of 2012-09-11 on …
******

>
> I take it from your response that this should, indeed, be passing the key combinations through to the system using this version of Emacs and that there is something wrong with my installation. Is that correct?

It should. But both Emacsen change the meaning of the alt, cmd, and maybe more keys by default. With C-h k you can find out what alt-a and cmd-a are and you can also look via Emacs -> Services from the  menu bar at the services your Emacs sees. The modifier keys I mentioned have, presumingly, names like

ns-alternate-modifier
This variable describes the behavior of the alternate or option
key.
ns-command-modifier
This variable describes the behavior of the command key.
ns-control-modifier
This variable describes the behavior of the control key.
ns-function-modifier
This variable describes the behavior of the function key (on
laptops).
ns-option-modifier
ns-right-alternate-modifier
This variable describes the behavior of the right alternate or
option key.
ns-right-command-modifier
This variable describes the behavior of the right command key.
ns-right-control-modifier
This variable describes the behavior of the right control key.
ns-right-option-modifier

Have you recorded your key combinations in System Preferences in a way that the Emacs applications do have knowledge of them?

--
Mit friedvollen Grüßen

Pete

The world would be a better place if Larry Wall had been born in Iceland, or any other country where the native language actually has syntax.
– Peter da Silva


tsh...@bearingthenews.com

unread,
May 21, 2013, 5:59:47 PM5/21/13
to help-gn...@gnu.org
Hi, Pete.

The command key is the Emacs super key here. The option key is the Emacs meta key. The control key is, of course, Emacs control.

In the Emacs system preferences, for instance, I have a service which inserts a date stamp. This service is bound to command-option-control-d. The service is defined and available for all applications (not just Emacs). It, along with all of the other combinations defined there, works fine with my other applications. But Emacs reports:

<C-M-s-268632068> is undefined

Which, of course, it is in Emacs.

Thanks again for the response.

Tom

Peter Dyballa

unread,
May 21, 2013, 6:30:42 PM5/21/13
to tsh...@bearingthenews.com, help-gn...@gnu.org

Am 21.05.2013 um 23:59 schrieb tsh...@bearingthenews.com:

> But Emacs reports:
>
> <C-M-s-268632068> is undefined

And this means: GNU Emacs is swallowing the key combination, it does not reach the operating system. You can either try to find a key combination that bypasses GNU Emacs or create functions that perform the service calls and bind them to the key combinations.

The NS variant performs the latter. Check out what M-m or M-h do!

The "Carbon AppKit" Emacs does not see M-h. C-h k M-h hides it at once and when you open it, you see the prompt in mini-buffer.

--
Greetings

Pete

Experience is what you get when you don't get what you want.


tsh...@bearingthenews.com

unread,
May 21, 2013, 7:36:56 PM5/21/13
to help-gn...@gnu.org
Thanks, Pete. I'll try to create the functions.

Cheers,
Tom S.
0 new messages