Last active
October 11, 2017 08:30
-
-
Save kobapan/84a98f9013b9e77b7399 to your computer and use it in GitHub Desktop.
終了時のフレームサイズで起動する
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
(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