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,6 +374,8 @@ This primes `org-mode' for reading."
Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when
`read-only-mode' is activated."
:after-hook (visual-line-mode -1)
(let ((gc-cons-threshold most-positive-fixnum)
(gc-cons-percentage 1.0))
(require 'org-id)
(require 'ob)
(setq-local org-id-link-to-org-use-id t
@ -412,10 +414,7 @@ Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when
(unless (local-variable-p 'org-startup-folded)
(let ((org-startup-folded 'content))
(org-set-startup-visibility))))
(add-hook 'read-only-mode-hook #'doom-docs--toggle-read-only-h nil 'local)
(org-with-limited-levels
(end-of-line)
(null (re-search-forward org-outline-regexp-bol nil t))))
(add-hook 'read-only-mode-hook #'doom-docs--toggle-read-only-h nil 'local)))
;;;###autoload
(defun doom-docs-read-only-h ()