Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Emacs undecorated (title-less) frame in OSX
(defun toggle-frame-maximized-undecorated ()
(interactive)
(let* ((frame (selected-frame))
(on? (and (frame-parameter frame 'undecorated)
(eq (frame-parameter frame 'fullscreen) 'maximized)))
(geom (frame-monitor-attribute 'geometry))
(x (nth 0 geom))
(y (nth 1 geom))
(display-height (nth 3 geom))
(display-width (nth 2 geom))
(cut (if on?
(if ns-auto-hide-menu-bar 26 50)
(if ns-auto-hide-menu-bar 4 26))))
(set-frame-position frame x y)
(set-frame-parameter frame 'fullscreen-restore 'maximized)
(set-frame-parameter nil 'fullscreen 'maximized)
(set-frame-parameter frame 'undecorated (not on?))
(set-frame-height frame (- display-height cut) nil t)
(set-frame-width frame (- display-width 20) nil t)
(set-frame-position frame x y)))
@jdelStrother

This comment has been minimized.

Copy link

@jdelStrother jdelStrother commented Aug 18, 2020

Where are the first and second functions defined?

@agzam

This comment has been minimized.

Copy link
Owner Author

@agzam agzam commented Aug 18, 2020

first and second are aliases for car and cadr,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.