perf(docs): disable gc for doom-docs-org-mode

This commit is contained in:
Henrik Lissner 2022-08-05 21:44:09 +02:00
parent a71e757c8d
commit 725de1ca35
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -374,48 +374,47 @@ This primes `org-mode' for reading."
Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when
`read-only-mode' is activated." `read-only-mode' is activated."
:after-hook (visual-line-mode -1) :after-hook (visual-line-mode -1)
(require 'org-id) (let ((gc-cons-threshold most-positive-fixnum)
(require 'ob) (gc-cons-percentage 1.0))
(setq-local org-id-link-to-org-use-id t (require 'org-id)
org-id-method 'uuid (require 'ob)
org-id-track-globally t (setq-local org-id-link-to-org-use-id t
org-id-locations-file (doom-path doom-cache-dir "doom-docs-org-ids") org-id-method 'uuid
org-id-locations doom-docs--id-locations org-id-track-globally t
org-id-files doom-docs--id-files org-id-locations-file (doom-path doom-cache-dir "doom-docs-org-ids")
org-num-max-level 3 org-id-locations doom-docs--id-locations
org-footnote-define-inline nil org-id-files doom-docs--id-files
org-footnote-auto-label t org-num-max-level 3
org-footnote-auto-adjust t org-footnote-define-inline nil
org-footnote-section nil org-footnote-auto-label t
wgrep-change-readonly-file t org-footnote-auto-adjust t
org-link-abbrev-alist-local (append org-link-abbrev-alist-local doom-docs-link-alist) org-footnote-section nil
org-babel-default-header-args wgrep-change-readonly-file t
(append '((:eval . "no") (:tangle . "no")) org-link-abbrev-alist-local (append org-link-abbrev-alist-local doom-docs-link-alist)
org-babel-default-header-args) org-babel-default-header-args
save-place-ignore-files-regexp ".") (append '((:eval . "no") (:tangle . "no"))
(when (require 'org-glossary nil t) org-babel-default-header-args)
(setq org-glossary-collection-root doom-docs-dir save-place-ignore-files-regexp ".")
org-glossary-global-terms (doom-glob org-glossary-collection-root "appendix.org")) (when (require 'org-glossary nil t)
(require 'ox) (setq org-glossary-collection-root doom-docs-dir
(org-glossary-mode +1)) org-glossary-global-terms (doom-glob org-glossary-collection-root "appendix.org"))
(unless org-inhibit-startup (require 'ox)
(doom/reload-docs) (org-glossary-mode +1))
(unless (local-variable-p 'org-startup-with-inline-images) (unless org-inhibit-startup
(setq org-display-remote-inline-images 'cache) (doom/reload-docs)
(org-display-inline-images)) (unless (local-variable-p 'org-startup-with-inline-images)
(unless (local-variable-p 'org-startup-indented) (setq org-display-remote-inline-images 'cache)
(org-indent-mode +1)) (org-display-inline-images))
(unless (local-variable-p 'org-startup-numerated) (unless (local-variable-p 'org-startup-indented)
(when (bound-and-true-p org-num-mode) (org-indent-mode +1))
(org-num-mode -1)) (unless (local-variable-p 'org-startup-numerated)
(org-num-mode +1)) (when (bound-and-true-p org-num-mode)
(unless (local-variable-p 'org-startup-folded) (org-num-mode -1))
(let ((org-startup-folded 'content)) (org-num-mode +1))
(org-set-startup-visibility)))) (unless (local-variable-p 'org-startup-folded)
(add-hook 'read-only-mode-hook #'doom-docs--toggle-read-only-h nil 'local) (let ((org-startup-folded 'content))
(org-with-limited-levels (org-set-startup-visibility))))
(end-of-line) (add-hook 'read-only-mode-hook #'doom-docs--toggle-read-only-h nil 'local)))
(null (re-search-forward org-outline-regexp-bol nil t))))
;;;###autoload ;;;###autoload
(defun doom-docs-read-only-h () (defun doom-docs-read-only-h ()