[Emacs] Fixup fontsize hack

This commit is contained in:
Ivan Malison 2017-01-12 15:27:29 -08:00
parent df777edbc2
commit 70ab3c0d23
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -714,13 +714,14 @@ For composing functions with an apply so that they can be used with the ~:around
** Font Size ** Font Size
This was taken from [[http://emacs.stackexchange.com/questions/7583/transiently-adjust-text-size-in-mode-line-and-minibuffer][here]] but it has diverged significantly from the original. This was taken from [[http://emacs.stackexchange.com/questions/7583/transiently-adjust-text-size-in-mode-line-and-minibuffer][here]] but it has diverged significantly from the original.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defvar imalison:default-font-size-pt (face-attribute 'default :height)) (defvar imalison:default-font-size-pt nil)
(defmacro imalison:acceptable-default-font-size (value) (defun imalison:acceptable-default-font-size (value)
(and (< value 150) (> value 50))) (and (numberp value) (< 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)
(interactive)
(when (and (imalison:acceptable-default-font-size (when (and (imalison:acceptable-default-font-size
(face-attribute 'default :height)) (face-attribute 'default :height))
(not (imalison:acceptable-default-font-size (not (imalison:acceptable-default-font-size