Skip to content

Instantly share code, notes, and snippets.

@kobapan
Last active October 11, 2017 08:30
Show Gist options
  • Save kobapan/84a98f9013b9e77b7399 to your computer and use it in GitHub Desktop.
Save kobapan/84a98f9013b9e77b7399 to your computer and use it in GitHub Desktop.
終了時のフレームサイズで起動する
(add-hook 'kill-emacs-hook 'frame-size-save); Emacs終了時
(add-hook 'window-setup-hook 'frame-size-resume); Emacs起動時
(defun frame-size-save ()
(set-buffer
(find-file-noselect (expand-file-name "~/.emacs.d/.framesize")))
(erase-buffer)
(insert (concat
"(set-frame-width (selected-frame) "
(int-to-string (frame-width))
") (set-frame-height (selected-frame) "
(int-to-string (frame-height))
")"))
(save-buffer)
(kill-buffer))
(defun frame-size-resume ()
(let* ((file "~/.emacs.d/.framesize"))
(if (file-exists-p file)
(load-file file))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment