Question

Emacs will recognize standard OSX shortcuts like Command + Q, but when I try to do something like open Safari (don't judge me :-P) using my custom shortcut Command + Control + S, the mini buffer says " is undefined."

Is there a way for me to set an Emacs shortcut to be one of the global services/shortcuts that I've defined in OSX?

(OSX 10.9.1, Emacs 24.3)

No correct solution

OTHER TIPS

This solution does not use a system wide keyboard shortcut, but instead uses an applescript:

(defun safari-activate ()
(interactive)
  (let ((script (concat
      "tell application \"Safari\"\n"
      "activate\n"
      "end tell")))
    (start-process "safari-activate" nil "osascript" "-e" script)))

And here is a slightly different method, but along the same lines:

(defun safari-activate-two ()
(interactive)
  (do-applescript "tell application \"Safari\" to activate"))

Services Key combination worked when running emacs without customization.

/Applications/Emacs.app/Contents/MacOS/Emacs.sh --no-init-file

After much trial and error discovered that my woes were caused by customization of mac-option-modifier, as per mac-switch-meta. If I switch back or leave it at the default value then I can access the services but the standard shortcuts no longer work! :-(

What's more I was unable to run the service by manipulating the menu as discussed in discussion No Menu Bars

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top