mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(feat): disable unnecessary org-mode startup for temp buffers (#1057)
Set `org-inhibit-startup` to `t` to reduce the amount of time taken to set up org-mode buffers. For example, this disables latex image generation, and table alignment. Also introduces `org-roam-doctor-inhibit-startup`, which speeds up `org-roam-doctor` runs.
This commit is contained in:
@ -21,6 +21,8 @@ In this release we support fuzzy links of the form `[[Title]]`, `[[*Headline]]`
|
|||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
|
- [#1057](https://github.com/org-roam/org-roam/pull/1057) Improve performance of database builds by preventing generation of LaTeX and image previews.
|
||||||
|
|
||||||
## 1.2.1 (27-07-2020)
|
## 1.2.1 (27-07-2020)
|
||||||
|
|
||||||
This release consisted of a big deal of refactoring and bug fixes. Notably, we fixed several catastrophic failures on db builds with bad setups (#854), and modularized tag and title extractions.
|
This release consisted of a big deal of refactoring and bug fixes. Notably, we fixed several catastrophic failures on db builds with bad setups (#854), and modularized tag and title extractions.
|
||||||
|
@ -34,4 +34,4 @@ Contributors
|
|||||||
- Rafael Accácio Nogueira <raccacio@poli.ufrj.br>
|
- Rafael Accácio Nogueira <raccacio@poli.ufrj.br>
|
||||||
- Roland Coeurjoly <rolandcoeurjoly@gmail.com>
|
- Roland Coeurjoly <rolandcoeurjoly@gmail.com>
|
||||||
- Sayan <dit7ya@users.noreply.github.com>
|
- Sayan <dit7ya@users.noreply.github.com>
|
||||||
- Tim Quelch <tim@quelch.name>
|
- Tim Quelch <tim@tquelch.com>
|
||||||
|
@ -59,6 +59,15 @@
|
|||||||
(defvar org-roam-verbose)
|
(defvar org-roam-verbose)
|
||||||
(defvar org-roam-mode)
|
(defvar org-roam-mode)
|
||||||
|
|
||||||
|
(defcustom org-roam-doctor-inhibit-startup t
|
||||||
|
"Inhibit `org-mode' startup when processing files with `org-doctor'.
|
||||||
|
When non-nil, images and LaTeX preview will not be generated,
|
||||||
|
tables will not be aligned, and headlines will not respect
|
||||||
|
startup visability. This significantly improves performance when
|
||||||
|
processing multiple files"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'org-roam)
|
||||||
|
|
||||||
(cl-defstruct (org-roam-doctor-checker (:copier nil))
|
(cl-defstruct (org-roam-doctor-checker (:copier nil))
|
||||||
(name 'missing-checker-name)
|
(name 'missing-checker-name)
|
||||||
(description "")
|
(description "")
|
||||||
@ -294,7 +303,8 @@ If CHECKALL, run the check for all Org-roam files."
|
|||||||
(defun org-roam-doctor-start (files checkers)
|
(defun org-roam-doctor-start (files checkers)
|
||||||
"Lint FILES using CHECKERS."
|
"Lint FILES using CHECKERS."
|
||||||
(save-window-excursion
|
(save-window-excursion
|
||||||
(let ((existing-buffers (org-roam--get-roam-buffers)))
|
(let ((existing-buffers (org-roam--get-roam-buffers))
|
||||||
|
(org-inhibit-startup org-roam-doctor-inhibit-startup))
|
||||||
(dolist (f files)
|
(dolist (f files)
|
||||||
(let ((buf (find-file-noselect f)))
|
(let ((buf (find-file-noselect f)))
|
||||||
(org-roam-doctor--check buf checkers)
|
(org-roam-doctor--check buf checkers)
|
||||||
|
@ -55,7 +55,8 @@ If FILE, set `org-roam-temp-file-name' to file and insert its contents."
|
|||||||
`(let ((,current-org-roam-directory org-roam-directory))
|
`(let ((,current-org-roam-directory org-roam-directory))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(let ((org-roam-directory ,current-org-roam-directory)
|
(let ((org-roam-directory ,current-org-roam-directory)
|
||||||
(org-mode-hook nil))
|
(org-mode-hook nil)
|
||||||
|
(org-inhibit-startup t))
|
||||||
(org-mode)
|
(org-mode)
|
||||||
(when ,file
|
(when ,file
|
||||||
(insert-file-contents ,file)
|
(insert-file-contents ,file)
|
||||||
|
Reference in New Issue
Block a user