Skip to content

Commit

Permalink
Add: Pretty-fonts uses do-after-display-system-init
Browse files Browse the repository at this point in the history
  • Loading branch information
ekaschalk committed Nov 12, 2018
1 parent 0def2d2 commit d6431b3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 54 deletions.
21 changes: 6 additions & 15 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,17 @@ Check `dotspacemacs/get-variable-string-list' for all vars you can configure."
(when (configuration-layer/package-used-p 'redo-spacemacs)
(redo-spacemacs-bindings))

(when server?
;; The set-fontset has to be done later in the process than the
;; layer loading or Emacs will break. So right now dumping this here.
;; This just enables pretty-fonts to effect the initial frame.
;; All future frames are handled via `after-make-frame-functions'.
(when (configuration-layer/package-used-p 'pretty-fonts)
(display/init-pretty-fonts/kwds 'noframe)
(display/init-pretty-fonts/fontsets 'noframe))

;; While toggling with `toggle-frame-fullscreen' works, I could not get
;; it to work as a hook attached to the frame-make or window-setup.
;; Depending on your OS, you may need a different/not-at-all need this.
(when mac?
(add-to-list 'default-frame-alist '(fullscreen . fullboth)))))
;; While toggling with `toggle-frame-fullscreen' works, I could not get
;; it to work as a hook attached to the frame-make or window-setup.
;; Depending on your OS, you may need a different/not-at-all need this.
(when (and mac? server?)
(add-to-list 'default-frame-alist '(fullscreen . fullboth))))

;;;;; Core

(defun dotspacemacs/user-config ()
"Configuration that cannot be delegated to layers."
(dotspacemacs/user-config/post-layer-load-config)

;; Experiments, other-users can drop in config here
;; Drop-in more config here without needing layer stuff
)
4 changes: 3 additions & 1 deletion layers/config/layers.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
python-test-runner 'pytest
python-spacemacs-indent-guess nil)

;; Experimental


;; Experimental/in-flux
(mu4e :variables
mu4e-installation-path "/usr/local/share/emacs/site-lisp"
mu4e-use-maildirs-extension t
Expand Down
2 changes: 2 additions & 0 deletions layers/config/local/redo-spacemacs/redo-spacemacs.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
;;; redo-spacemacs.el --- Redoing spacemacs leader bindings safely -*- lexical-binding: t; -*-

(require 'dash)
(require 'dash-functional)

Expand Down
63 changes: 27 additions & 36 deletions layers/display/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -224,42 +224,33 @@

(defun display/init-pretty-fonts ()
(use-package pretty-fonts
:config (progn
(defun display/init-pretty-fonts/kwds (frame)
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")
(pretty-fonts-set-kwds
'((pretty-fonts-fira-font prog-mode-hook org-mode-hook))))

(defun display/init-pretty-fonts/fontsets (frame)
(pretty-fonts-set-fontsets
'(
;; All-the-icons fontsets
("fontawesome"
;;      
#xf07c #xf0c9 #xf0c4 #xf0cb #xf017 #xf101)

("all-the-icons"
;;  
#xe907 #xe928)

("github-octicons"
;;      
#xf091 #xf059 #xf076 #xf075 #xe192 #xf016
;; 
#xf071)

("material icons"
;;    
#xe871 #xe918 #xe3e7 #xe5da
;;    
#xe3d0 #xe3d1 #xe3d2 #xe3d4))))

(if server?
(spacemacs/add-to-hook 'after-make-frame-functions
'(display/init-pretty-fonts/kwds
display/init-pretty-fonts/fontsets))
(display/init-pretty-fonts/kwds 'noframe)
(display/init-pretty-fonts/fontsets 'noframe)))))
:config
;; This is required to avoid segfault when using emacs as daemon
(spacemacs|do-after-display-system-init
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")
(pretty-fonts-set-kwds '((pretty-fonts-fira-font
prog-mode-hook
org-mode-hook)))

(pretty-fonts-set-fontsets
'(;; All-the-icons fontsets
("fontawesome"
;;      
#xf07c #xf0c9 #xf0c4 #xf0cb #xf017 #xf101)

("all-the-icons"
;;  
#xe907 #xe928)

("github-octicons"
;;       
#xf091 #xf059 #xf076 #xf075 #xe192 #xf016 #xf071)

("material icons"
;;    
#xe871 #xe918 #xe3e7 #xe5da
;;    
#xe3d0 #xe3d1 #xe3d2 #xe3d4))))))

;;;; Pretty-magit

Expand Down
5 changes: 3 additions & 2 deletions layers/personal/local/personal/personal.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
(provide 'personal)


;; Emacs-anywhere defaults to org-mode rather than markdown-mode
(add-hook 'ea-popup-hook (lambda (&rest args) (org-mode)))
;; Emacs-anywhere defaults to org-mode with maximized window
(add-hook 'ea-popup-hook
(lambda (&rest args) (org-mode) (spacemacs/toggle-maximize-buffer)))

;; Hy-mode development
;; (load-file "~/dev/hy-mode/hy-mode.el")
Expand Down

0 comments on commit d6431b3

Please sign in to comment.