From cf216711e635e1f355cac9e274f813b2ff8bc757 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 30 Nov 2018 10:09:45 +0100 Subject: [PATCH] Try to rely less on the current graphics mode --- configuration.org | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/configuration.org b/configuration.org index 1679456..ff6c633 100644 --- a/configuration.org +++ b/configuration.org @@ -1013,8 +1013,9 @@ Also, maximise the frame. Before this can be used, make sure the [[https://zhm.github.io/symbola/][Symbola]] font is installed. #+BEGIN_SRC emacs-lisp -(set-face-attribute 'default t :font "Hack-12") -(set-frame-font "Hack-12" nil t) +(defun gpolonkai/set-font-size (frame) + (set-face-attribute 'default t :font "Hack-12") + (set-frame-font "Hack-12" t t)) (defun --set-emoji-font (frame) "Adjust the font setting of FRAME so Emacs can display Emoji properly." @@ -1028,6 +1029,9 @@ Before this can be used, make sure the [[https://zhm.github.io/symbola/][Symbola (set-fontset-font t 'symbol (font-spec :family "Symbola") frame 'prepend)))) + +(add-hook 'after-make-frame-functions 'gpolonkai/set-font-size) +(add-hook 'after-make-frame-functions '--set-emoji-font) #+END_SRC * Set up global minor modes provided by Emacs @@ -1467,9 +1471,8 @@ I don’t usually like to see them, but there are occasions when they can be use *** Nyan prompt in EShell #+BEGIN_SRC emacs-lisp -(when (display-graphic-p) - (use-package nyan-prompt - :ensure nil)) +(use-package nyan-prompt + :ensure nil) #+END_SRC *** Zone out with Nyancat @@ -1477,13 +1480,12 @@ I don’t usually like to see them, but there are occasions when they can be use Unfortunately, this works only in a graphical mode. #+BEGIN_SRC emacs-lisp -(when (display-graphic-p) - (use-package zone-nyan - :after - zone - :config - (setq-default zone-nyan-hide-progress t) - (setq zone-programs (vconcat zone-programs [zone-nyan])))) +(use-package zone-nyan + :after + zone + :config + (setq-default zone-nyan-hide-progress t) + (setq zone-programs (vconcat zone-programs [zone-nyan]))) #+END_SRC ** De-light some minor modes @@ -1536,10 +1538,9 @@ Highlight point. Sometimes it’s not easy to see. *** Display the status of the last command in the fringe of EShell #+BEGIN_SRC emacs-lisp -(when (display-graphic-p) - (use-package eshell-fringe-status - :hook - (eshell-mode . eshell-fringe-status-mode))) +(use-package eshell-fringe-status + :hook + (eshell-mode . eshell-fringe-status-mode)) #+END_SRC *** Extras for the EShell prompt @@ -2085,13 +2086,16 @@ requires connecting to a website and download a pretty large font file. ** NeoTree, if Dired is not an option #+BEGIN_SRC emacs-lisp +(defun gpolonkai/neo-set-theme () + (customize-set-variable 'neo-theme (if (display-graphic-p) 'icons 'arrow))) + (use-package neotree :after all-the-icons - :config - (setq neo-theme (if (display-graphic-p) 'icons 'arrow)) :bind - (([f5] . neotree-toggle))) + (([f5] . neotree-toggle)) + :hook + (neo-enter . gpolonkai/neo-set-theme)) #+END_SRC ** Waka-waka @@ -2808,8 +2812,7 @@ See previous versions of the current file. :init (--set-emoji-font nil) :config - (add-to-list 'company-backends 'company-emoji) - (add-hook 'after-make-frame-functions '--set-emoji-font)) + (add-to-list 'company-backends 'company-emoji)) #+END_SRC ** Anaconda backend for Company