fix(docs): org-glossary init
- Set org-glossary-global-terms buffer-locally, - Move org-glossary init into a hook. - Remove unneeded (require 'ox) (see tecosaur/org-glossary#6), Ref: tecosaur/org-glossary#6
This commit is contained in:
parent
8ec9e7ea0d
commit
0f43c3eed5
1 changed files with 7 additions and 5 deletions
|
@ -425,11 +425,6 @@ Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when
|
||||||
(append '((:eval . "no") (:tangle . "no"))
|
(append '((:eval . "no") (:tangle . "no"))
|
||||||
org-babel-default-header-args)
|
org-babel-default-header-args)
|
||||||
save-place-ignore-files-regexp ".")
|
save-place-ignore-files-regexp ".")
|
||||||
(when (require 'org-glossary nil t)
|
|
||||||
(setq org-glossary-collection-root doom-docs-dir
|
|
||||||
org-glossary-global-terms (doom-glob org-glossary-collection-root "appendix.org"))
|
|
||||||
(require 'ox)
|
|
||||||
(org-glossary-mode +1))
|
|
||||||
(unless org-inhibit-startup
|
(unless org-inhibit-startup
|
||||||
(doom/reload-docs)
|
(doom/reload-docs)
|
||||||
(unless (local-variable-p 'org-startup-with-inline-images)
|
(unless (local-variable-p 'org-startup-with-inline-images)
|
||||||
|
@ -446,6 +441,13 @@ Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when
|
||||||
(org-set-startup-visibility))))
|
(org-set-startup-visibility))))
|
||||||
(add-hook 'read-only-mode-hook #'doom-docs--toggle-read-only-h nil 'local)))
|
(add-hook 'read-only-mode-hook #'doom-docs--toggle-read-only-h nil 'local)))
|
||||||
|
|
||||||
|
(defun doom-docs-init-glossary-h ()
|
||||||
|
"Activates `org-glossary-mode', if it's available."
|
||||||
|
(when (require 'org-glossary nil t)
|
||||||
|
(setq-local org-glossary-global-terms (doom-glob doom-docs-dir "appendix.org"))
|
||||||
|
(org-glossary-mode +1)))
|
||||||
|
(add-hook 'doom-docs-org-mode-hook #'doom-docs-init-glossary-h)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-docs-read-only-h ()
|
(defun doom-docs-read-only-h ()
|
||||||
"Activate `read-only-mode' if the current file exists and is non-empty."
|
"Activate `read-only-mode' if the current file exists and is non-empty."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue