Colin Baxter 😺 <m43...@yandex.com> writes: > > Hello, Whenever I archive a DONE item via 'C-c C-x C-a' I get the > > warning: > > > Warning (emacs): org-element--cache: Unregistered buffer > > modifications detected. Resetting. > > > The archiving is successful, but I keep getting the warning and > > therefore wonder if there is some org-persist or cache setting > > that needs to be adjusted. > > Thinking a little more about this, I have not yet had a chance of > archiving an item in a new emacs session. It may be that the warning > is temporary to the first session and will disappear if and when I > archive a DONE item in a new session.
This message always indicates some problem. However, I cannot reproduce what you observe on my side. Did you try with emacs -Q? Also, you might not be running the latest Org. I have extended this warning in recent commits. My crystal ball tells me that the attached patch might help. Can you try it? Best, Ihor
>From da1e23bd1d8aaa673d034b288a6088868fe8abb7 Mon Sep 17 00:00:00 2001 Message-Id: <da1e23bd1d8aaa673d034b288a6088868fe8abb7.1635247299.git.yanta...@gmail.com> From: Ihor Radchenko <yanta...@gmail.com> 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 69ff7a8d4..a20be7aac 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4672,22 +4672,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-cycle-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-cycle-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