- (with-eval-after-load "org"
- (let ((default-font-size (- (face-attribute 'default :height) 20)))
- (set-face-attribute 'org-code nil :height default-font-size)
- (set-face-attribute 'org-block nil :height default-font-size)
- (set-face-attribute 'org-table nil :family "Ubutu Mono" :height default-font-size)
- (set-face-attribute 'org-formula nil :family "Ubutu Mono" :height default-font-size)
- (set-face-attribute 'org-block-begin-line nil :background nil :foreground nil :inherit 'shadow :slant 'italic :height default-font-size)
- (set-face-attribute 'org-block-end-line nil :background nil :foreground nil :inherit 'shadow :slant 'italic :height default-font-size)))
+ ;; (with-eval-after-load "org"
+ ;; (let ((default-font-size (- (face-attribute 'default :height) (if (display-graphic-p) 20 0))))
+ ;; (set-face-attribute 'org-code nil :height default-font-size)
+ ;; (set-face-attribute 'org-block nil :height default-font-size)
+ ;; (set-face-attribute 'org-block-begin-line nil :background nil :foreground nil :inherit 'shadow :slant 'italic :height default-font-size)
+ ;; (set-face-attribute 'org-block-end-line nil :background nil :foreground nil :inherit 'shadow :slant 'italic :height default-font-size)
+ ;; (when (find-font (font-spec :name "Ubuntu Mono"))
+ ;; (set-face-attribute 'org-table nil :family "Ubutu Mono" :height default-font-size)
+ ;; (set-face-attribute 'org-formula nil :family "Ubutu Mono" :height default-font-size))))
+
+ (add-hook 'org-mode-hook
+ (lambda ()
+ (let ((default-font-size (- (face-attribute 'default :height) (if (display-graphic-p) 20 0))))
+ (set-face-attribute 'org-code nil :height default-font-size)
+ (set-face-attribute 'org-block nil :height default-font-size)
+ (set-face-attribute 'org-block-begin-line nil :background nil :foreground nil :inherit 'shadow :slant 'italic :height default-font-size)
+ (set-face-attribute 'org-block-end-line nil :background nil :foreground nil :inherit 'shadow :slant 'italic :height default-font-size)
+ (when (find-font (font-spec :name "Ubuntu Mono"))
+ (set-face-attribute 'org-table nil :family "Ubutu Mono" :height default-font-size)
+ (set-face-attribute 'org-formula nil :family "Ubutu Mono" :height default-font-size)))))