Last active
August 28, 2020 02:10
-
-
Save agzam/7733edf9629c7b10e7c8a8711198a3f2 to your computer and use it in GitHub Desktop.
Emacs undecorated (title-less) frame in OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
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
Where are the
first
andsecond
functions defined?