5

I'm using GNU Emacs 23.4.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2012-01-29 on bob.porkrind.org on a MacBook Air.

Can I set Command-H to hide Emacs? I currently use M-x customize-group ns and set Command Modifier to no value. I already have a standard key binding to iconify-frame, but that is different from hiding; I'd rather use the native OS X hide capability so I can unhide by clicking on the Emacs icon in the dock.

5

If emacs is built with Cocoa (e.g via brew install emacs --cocoa), by default s-h (Cmd+h) should be bound to ns-do-hide-emacs

If somehow it is not, you can do this manually with:

(global-set-key [(super h)] 'ns-do-hide-emacs)
  • If you have bound Command to Meta then the binding is: (global-set-key [(meta h)] 'ns-do-hide-emacs) – donaldh Feb 22 '16 at 14:29
0

I'm trying to solve the same problem. The best I've been able to come up with is the following, which will iconify (like CMD+M) the frame:

(global-set-key (kbd "M-h") 'iconify-frame)

Not ideal, but better than nothing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .