Created
November 29, 2017 16:27
-
-
Save vaaas/ac745ee4074e8bf46a3b8e48cd166cd6 to your computer and use it in GitHub Desktop.
ghetto writeroom in emacs
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
(defvar-local writing-mode nil) | |
(defvar-local cached-mode-line nil) | |
(define-minor-mode writing-mode | |
"Minor mode for writing" | |
:variable writing-mode | |
:init-value nil | |
:group 'editing-basics | |
(if (not writing-mode) | |
(progn | |
(toggle-frame-fullscreen) | |
(fringe-mode nil) | |
(set-window-margins nil 0 0) | |
(setq mode-line-format cached-mode-line cached-mode-line nil)) | |
(progn | |
(toggle-frame-fullscreen) | |
(fringe-mode 0) | |
(defconst x (/ (- (frame-width) 80) 2)) | |
(set-window-margins nil x x) | |
(setq cached-mode-line mode-line-format mode-line-format nil)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment