diff --git a/configuration.org b/configuration.org index 1bfbd382c29cbe29923a916330e2244400e3f93c..5a7ab69684c38696ddc2dfee23c67645e89b41f7 100644 --- a/configuration.org +++ b/configuration.org @@ -36,7 +36,7 @@ configuration loading. The threshold will be set lower at the end of the configuration to make each GC call faster for normal emacs use. #+begin_src emacs-lisp -(setq gc-cons-threshold (* 60 1024 1024)) +(setq gc-cons-threshold (* 100 1024 1024)) #+end_src * Personal information @@ -314,6 +314,8 @@ buffer. I also like to have Emacs show me matching parenthesis. Also do not show ) #+END_SRC +** Fonts + Select the font I will use depending on the system #+begin_src emacs-lisp @@ -329,12 +331,36 @@ Select the font I will use depending on the system (setq mh-font-variable "DejaVu Sans") ) ) -(set-face-attribute 'default nil :font mh-font-fixed :weight 'normal :height 150) -(set-face-attribute 'fixed-pitch nil :font mh-font-fixed :weight 'normal :height 150) -(set-face-attribute 'variable-pitch nil :font mh-font-variable :weight 'normal :height 150) +(set-face-attribute 'default nil :font mh-font-fixed :weight 'normal :height 160) +(set-face-attribute 'fixed-pitch nil :font mh-font-fixed :weight 'normal) +(set-face-attribute 'variable-pitch nil :font mh-font-variable :weight 'normal) (set-frame-font mh-font-fixed nil t) #+end_src +*** Dynamic size modification + +The default action (~text-scale-adjust~), do not affect faces whose font properties have an +explicity ~:height~ attribute except for /default/ and /header-line/ face. However, when using +~org-present~, I change some faces and do not use the /default/ one everywhere. So I change the way +font size is modified. This solution is adapted from +https://emacs-fu.blogspot.com/2008/12/zooming-inout.html + +#+begin_src emacs-lisp +(defun my/text-zoom (n) + "with positive N, increase the font size, otherwise decrease it" + (set-face-attribute 'default nil :height + (+ (face-attribute 'default :height) (* (if (> n 0) 1 -1) 10))) + (set-face-attribute 'fixed-pitch nil :height + (+ (face-attribute 'fixed-pitch :height) (* (if (> n 0) 1 -1) 10))) + (set-face-attribute 'variable-pitch nil :height + (+ (face-attribute 'variable-pitch :height) (* (if (> n 0) 1 -1) 10))) + ) + +(global-set-key (kbd "C-+") #'(lambda nil (interactive) (my/text-zoom 1))) +(global-set-key (kbd "C--") #'(lambda nil (interactive) (my/text-zoom -1))) +#+end_src + + ** Modeline Tweak how some modeline elements are displayed @@ -688,7 +714,7 @@ it with =visual-fill-column= to enhance the visual look of the presentation. (org-level-6) (org-level-7) (org-level-8))) - (set-face-attribute (car face) nil :font mh-font-fixed :weight 'medium )) + (set-face-attribute (car face) nil :font mh-font-fixed :weight 'medium :height 1.0)) ;; Remove the blank line at top of the frame (setq header-line-format nil)