Created
March 11, 2017 15:13
-
-
Save vegardsjo/6c4c90d864b88247aed6c5626758a151 to your computer and use it in GitHub Desktop.
Set font height and zoom functionality for Emacs
This file contains hidden or 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
| (defun good-font-height () | |
| (- (/ (display-pixel-height) 5) 50)) | |
| (defun set-font-height (height) | |
| (interactive (list (read-number "Font height: " (good-font-height)))) | |
| (set-face-attribute 'default nil :height height)) | |
| (defun zoom (inc) | |
| (interactive "nIncrement: ") | |
| (let ((new-font-height (+ (* 10 inc) (face-attribute 'default :height)))) | |
| (set-font-height new-font-height) | |
| (message "Font height: %s" new-font-height))) | |
| (set-font-height (good-font-height)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment