What does "s-[keyname]" refer to in Emacs, and how do I tell Emacs to ignore it?

Viewed 8395

Background information:

I'm on a Mac, and I've just upgraded to Emacs 23.1 via http://emacsformacosx.com/. There are a few issues, notably the lack of full screen ability.

I've attempted to get around this last issue by installing Megazoomer, which adds a global input manager bound to Cmd-return. This causes the currently forward application to maximise. However, Emacs reports that <s-return> is undefined. I've never seen an s-[key] mentioned before, and Google isn't forthcoming with an answer.

So, two parts:

  1. What does s-[key] mean? This is purely for my satisfaction; and
  2. Can I tell Emacs to ignore this key combination and let the key combination carry through to the system (so that hopefully I can have full screen Emacs back again)?

EDIT: so 1) is resolved, and as to 2) I've got: (global-set-key (kbd "<s-return>") 'ignore), which at least stops the error. However, Emacs still swallows the key combination, which isn't ideal.

4 Answers

For the question about what the s-[key] means, on ubuntu box it means the Windows® shaped key. What it means on the OSX systems, I do not know.

As for maximizing windows, could you try this? (It should work, iif OSX runs an X server somewhere underneath it all)

(if (equal (window-system) 'x)
  (progn
   (defun toggle-fullscreen ()
     "Toggles fullscreen"
     (interactive)
     (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
              '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
     (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
              '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))) 

   (global-set-key (kbd "C-c C-y") 'x-clipboard-yank)
   (global-set-key (kbd "M-RET") 'toggle-fullscreen)))

This little snippet is what I use to toggle fullscreen on my *nix computers. And yanking from X's clipboard is a neat ability to have.

As for how to set keybindings, use global-set-key for mode independent keybindings. (Add it to your .emacs file if you want it to be permanent.)

Related