Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using GNU Emacs 23.4.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2012-01-29 on 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.

share|improve this question

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)
share|improve this answer
If you have bound Command to Meta then the binding is: (global-set-key [(meta h)] 'ns-do-hide-emacs) – donaldh Feb 22 at 14:29

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.