|
@@ -4820,6 +4820,8 @@ This is for getting out of special buffers like capture.")
|
|
|
|
|
|
(defvar org-element-cache-persistent); Defined in org-element.el
|
|
|
(defvar org-element-use-cache); Defined in org-element.el
|
|
|
+(defvar org-mode-loading nil
|
|
|
+ "Non-nil during Org mode initialisation.")
|
|
|
;;;###autoload
|
|
|
(define-derived-mode org-mode outline-mode "Org"
|
|
|
"Outline-based notes management and organizer, alias
|
|
@@ -4839,6 +4841,7 @@ can be exported as a structured ASCII or HTML file.
|
|
|
The following commands are available:
|
|
|
|
|
|
\\{org-mode-map}"
|
|
|
+ (setq-local org-mode-loading t)
|
|
|
(org-load-modules-maybe)
|
|
|
(org-install-agenda-files-menu)
|
|
|
(when org-link-descriptive (add-to-invisibility-spec '(org-link)))
|
|
@@ -4874,6 +4877,11 @@ The following commands are available:
|
|
|
(add-hook 'before-change-functions 'org-before-change-function nil 'local)
|
|
|
;; Check for running clock before killing a buffer
|
|
|
(add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local)
|
|
|
+ ;; Initialize cache.
|
|
|
+ (org-element-cache-reset)
|
|
|
+ (when (and org-element-cache-persistent
|
|
|
+ org-element-use-cache)
|
|
|
+ (org-persist-read 'org-element--cache (current-buffer)))
|
|
|
;; Initialize macros templates.
|
|
|
(org-macro-initialize-templates)
|
|
|
;; Initialize radio targets.
|
|
@@ -4885,11 +4893,6 @@ The following commands are available:
|
|
|
(org-setup-filling)
|
|
|
;; Comments.
|
|
|
(org-setup-comments-handling)
|
|
|
- ;; Initialize cache.
|
|
|
- (org-element-cache-reset)
|
|
|
- (when (and org-element-cache-persistent
|
|
|
- org-element-use-cache)
|
|
|
- (org-persist-read 'org-element--cache (current-buffer)))
|
|
|
;; Beginning/end of defun
|
|
|
(setq-local beginning-of-defun-function 'org-backward-element)
|
|
|
(setq-local end-of-defun-function
|
|
@@ -4978,7 +4981,8 @@ The following commands are available:
|
|
|
;; Set face extension as requested.
|
|
|
(org--set-faces-extend '(org-block-begin-line org-block-end-line)
|
|
|
org-fontify-whole-block-delimiter-line)
|
|
|
- (org--set-faces-extend org-level-faces org-fontify-whole-heading-line))
|
|
|
+ (org--set-faces-extend org-level-faces org-fontify-whole-heading-line)
|
|
|
+ (setq-local org-mode-loading nil))
|
|
|
|
|
|
;; Update `customize-package-emacs-version-alist'
|
|
|
(add-to-list 'customize-package-emacs-version-alist
|