Skip to content

Commit

Permalink
fix(citar): avoid using all-the-icons until it is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed May 25, 2023
1 parent a02e5cc commit 960d978
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions modules/me-biblio.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,23 @@
(org-cite-activate-processor 'citar)
(citar-symbol-separator " ")
:config
(defun +citar--set-symbols ()
(setq citar-symbols
`((file ,(all-the-icons-octicon "file-pdf" :face 'error) . " ")
(note ,(all-the-icons-octicon "file-text" :face 'warning) . " ")
(link ,(all-the-icons-octicon "link-external" :face 'org-link) . " "))))

;; Properly setup citar-symbols
(if (display-graphic-p)
(+citar--set-symbols)
(add-hook
'server-after-make-frame-hook
(defun +citar--set-symbols-once-h ()
(when (display-graphic-p)
(+citar--set-symbols)
(remove-hook 'server-after-make-frame-hook
#'+citar--set-symbols-once-h))))))
(with-eval-after-load 'all-the-icons
(defun +citar--set-symbols ()
(setq citar-symbols
`((file ,(all-the-icons-octicon "file-pdf" :face 'error) . " ")
(note ,(all-the-icons-octicon "file-text" :face 'warning) . " ")
(link ,(all-the-icons-octicon "link-external" :face 'org-link) . " "))))

;; Properly setup citar-symbols
(if (display-graphic-p)
(+citar--set-symbols)
(add-hook
'server-after-make-frame-hook
(defun +citar--set-symbols-once-h ()
(when (display-graphic-p)
(+citar--set-symbols)
(remove-hook 'server-after-make-frame-hook
#'+citar--set-symbols-once-h)))))))

(use-package citar-org-roam
:straight t
Expand Down

0 comments on commit 960d978

Please sign in to comment.