[Emacs] Reduce output from setting font size with hack

This commit is contained in:
Ivan Malison 2017-01-11 12:50:57 -08:00
parent 5692dd3f01
commit b0386150a4
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -710,10 +710,15 @@ This was taken from [[http://emacs.stackexchange.com/questions/7583/transiently-
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defvar imalison:default-font-size-pt (face-attribute 'default :height)) (defvar imalison:default-font-size-pt (face-attribute 'default :height))
(defmacro imalison:acceptable-default-font-size (value)
(and (< value 150) (> value 50)))
;; XXX: hack to get proper default value when default is set to something crazy ;; XXX: hack to get proper default value when default is set to something crazy
(defun imalison:set-default-font-size (&rest args) (defun imalison:set-default-font-size (&rest args)
(when (or (> imalison:default-font-size-pt 150) (when (and (imalison:acceptable-default-font-size
(< imalison:default-font-size-pt 50)) (face-attribute 'default :height))
(not (imalison:acceptable-default-font-size
imalison:default-font-size-pt)))
(message "default font size was set using hack") (message "default font size was set using hack")
(setq imalison:default-font-size-pt (face-attribute 'default :height)))) (setq imalison:default-font-size-pt (face-attribute 'default :height))))