From 722f595c7bef4801e7d0e5f476ecbb9eb63a16ab Mon Sep 17 00:00:00 2001 Message-Id: <722f595c7bef4801e7d0e5f476ecbb9eb63a16ab.1635260679.git.yantar92@gmail.com> From: Ihor Radchenko Date: Tue, 26 Oct 2021 19:19:57 +0800 Subject: [PATCH] org.el/org-mode: Do not inhibit `after-change-functions' when loading * lisp/org.el (org-mode): Let-bind `buffer-undo-list' instead of using `org-unmodified'. The latter suppresses org-element-cache handling of buffer changes. --- lisp/org.el | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 21b2c5470..e2a02c115 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4940,22 +4940,22 @@ (define-derived-mode org-mode outline-mode "Org" (= (point-min) (point-max))) (insert "# -*- mode: org -*-\n\n")) (unless org-inhibit-startup - (org-unmodified - (when org-startup-with-beamer-mode (org-beamer-mode)) - (when (or org-startup-align-all-tables org-startup-shrink-all-tables) - (org-table-map-tables - (cond ((and org-startup-align-all-tables - org-startup-shrink-all-tables) - (lambda () (org-table-align) (org-table-shrink))) - (org-startup-align-all-tables #'org-table-align) - (t #'org-table-shrink)) - t)) - (when org-startup-with-inline-images (org-display-inline-images)) - (when org-startup-with-latex-preview (org-latex-preview '(16))) - (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility)) - (when org-startup-truncated (setq truncate-lines t)) - (when org-startup-numerated (require 'org-num) (org-num-mode 1)) - (when org-startup-indented (require 'org-indent) (org-indent-mode 1)))) + (let ((buffer-undo-list t)) + (when org-startup-with-beamer-mode (org-beamer-mode)) + (when (or org-startup-align-all-tables org-startup-shrink-all-tables) + (org-table-map-tables + (cond ((and org-startup-align-all-tables + org-startup-shrink-all-tables) + (lambda () (org-table-align) (org-table-shrink))) + (org-startup-align-all-tables #'org-table-align) + (t #'org-table-shrink)) + t)) + (when org-startup-with-inline-images (org-display-inline-images)) + (when org-startup-with-latex-preview (org-latex-preview '(16))) + (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility)) + (when org-startup-truncated (setq truncate-lines t)) + (when org-startup-numerated (require 'org-num) (org-num-mode 1)) + (when org-startup-indented (require 'org-indent) (org-indent-mode 1)))) ;; Add a custom keymap for `visual-line-mode' so that activating ;; this minor mode does not override Org's keybindings. -- 2.32.0