🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

Tracking ns-toggle-fullscreen state

Published 2011-12-12 @ 15:38

Tagged emacs

I’ve been using gnu emacs via homebrew ever since they added the fullscreen patch. It just isn’t worth it to me to maintain my own checkout of emacs with my patches when the homebrew one is close enough. One thing I didn’t like about the fullscreen patch is that there is no internal fullscreen state so I can’t set things like font-size based on whether or not I’m fullscreen.

This snippet changes that. Make sure it is defined before your init scripts toggle into fullscreen mode and ns-is-fullscreen will always have the proper state.

1
2
3
4
5
(progn
  (setq ns-is-fullscreen nil)

  (defadvice ns-toggle-fullscreen (before record-state compile activate)
    (setq ns-is-fullscreen (not ns-is-fullscreen))))