forked from colonelpanic/dotfiles
[Emacs] Fixup fontsize hack
This commit is contained in:
parent
df777edbc2
commit
70ab3c0d23
@ -714,17 +714,18 @@ 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
|
||||||
imalison:default-font-size-pt)))
|
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))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user