Don't persist frame size

This commit is contained in:
Jeremy Dormitzer 2019-02-07 16:54:16 -05:00
parent f083a17289
commit 6811a0ee23

View File

@ -842,32 +842,12 @@ UI-related keybindings:
#+END_SRC
* Frame parameters
Remember the previous frame size if previously set:
#+BEGIN_SRC emacs-lisp
(when-let ((frame-width (get-persisted-var 'frame-width)))
(set-frame-width (selected-frame) frame-width))
(when-let ((frame-height (get-persisted-var 'frame-height)))
(set-frame-height (selected-frame) frame-height))
#+END_SRC
Default to reasonable value if not:
#+BEGIN_SRC emacs-lisp
(let ((frame-width (get-persisted-var 'frame-width))
(frame-height (get-persisted-var 'frame-height)))
(unless frame-width (set-frame-width (selected-frame) 150))
(unless frame-height (set-frame-height (selected-frame) 60)))
#+END_SRC
Functions to change the frame size:
#+BEGIN_SRC emacs-lisp
(defun jdormit/set-frame-size (width height)
(interactive "nWidth: \nnHeight: ")
(if (display-graphic-p)
(progn
(persist-variable 'frame-width width)
(persist-variable 'frame-height height)
(set-frame-size (selected-frame) width height))
(set-frame-size (selected-frame) width height)
(message "Not running graphically")))
(defun jdormit/set-frame-width (width)