From: Peng Li Date: Sat, 3 Dec 2016 12:41:05 +0000 (+0800) Subject: emacs - tidy up the code X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=513acc2a297feb46122bc828eb7fc3da4013548b;hp=0225b343d36eccf6746ffd5f2f8d3267e29b758d;p=dotfiles.git emacs - tidy up the code --- diff --git a/emacs.d/config.org b/emacs.d/config.org index 273249b..2322cf8 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -574,15 +574,17 @@ Fix the issue in mode line when showing triangle set height in mode line #+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defconst sd/mode-line-font-heigh 100 + "Defaulet the fontsize on mode line.") + (with-eval-after-load "powerline" - (if window-system - (progn - (let* ((base-font-size (face-attribute 'default :height))) - ;; 100/140;0.8 - (set-variable 'powerline-height (/ base-font-size 10)) - (set-variable 'powerline-text-scale-factor (/ (float 100) base-font-size))) - (set-face-attribute 'mode-line nil :height 100) - (set-face-attribute 'mode-line-inactive nil :height 100)))) + (when (display-graphic-p) + (set-face-attribute 'mode-line-inactive nil :height sd/mode-line-font-heigh) + (set-face-attribute 'mode-line nil :height sd/mode-line-font-heigh) + (let* ((base-font-size (face-attribute 'default :height))) + ;; 100/140;0.8 + (set-variable 'powerline-height (/ base-font-size 10)) + (set-variable 'powerline-text-scale-factor (/ (float sd/mode-line-font-heigh) base-font-size))))) #+END_SRC * IDO & SMEX