Don't persist frame size
This commit is contained in:
parent
f083a17289
commit
6811a0ee23
@ -842,32 +842,12 @@ UI-related keybindings:
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Frame parameters
|
* 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:
|
Functions to change the frame size:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun jdormit/set-frame-size (width height)
|
(defun jdormit/set-frame-size (width height)
|
||||||
(interactive "nWidth: \nnHeight: ")
|
(interactive "nWidth: \nnHeight: ")
|
||||||
(if (display-graphic-p)
|
(if (display-graphic-p)
|
||||||
(progn
|
(set-frame-size (selected-frame) width height)
|
||||||
(persist-variable 'frame-width width)
|
|
||||||
(persist-variable 'frame-height height)
|
|
||||||
(set-frame-size (selected-frame) width height))
|
|
||||||
(message "Not running graphically")))
|
(message "Not running graphically")))
|
||||||
|
|
||||||
(defun jdormit/set-frame-width (width)
|
(defun jdormit/set-frame-width (width)
|
||||||
|
Loading…
Reference in New Issue
Block a user