[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] org-element--cache gives "Unregistered buffer modifications" w
From: |
Ihor Radchenko |
Subject: |
Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] |
Date: |
Mon, 08 Nov 2021 13:59:00 +0800 |
John Mathena <jmmathena@gmail.com> writes:
> First time sending mail to the list; please let me know if I commit any
> breaches of etiquette or convention (e.g. on attaching backtraces as a file
> vs sending in message body).
Your email is perfectly fine. Thanks for reporting and welcome to the
Org mailing list!
> I'll add a data point to the people that have been having trouble with
> org-element--cache recently; I get the warning shown below semi-frequently
> while I'm editing org files, seemingly at random, although I'll continue
> looking into what circumstances provoke it. At present, I can reproduce the
> error consistently using ox-hugo. I do:
>
> $ emacs -Q -l ~/.emacs.d/straight/repos/straight.el/bootstrap.el
>
> Then `M-x eval buffer` on the following buffer:
>
> (straight-use-package 'org)
> (straight-use-package 'ox-hugo)
> (with-eval-after-load 'ox
> (require 'backtrace) ;;org-hugo-export-wim-to-md calls
> org-element--cache-sync, which uses backtrace-get-frames, which isn't
> autoloaded
> (require 'ox-hugo))
>
> I then navigate to the following org-mode buffer, do `C-u M-x org-reload`,
> and do `C-c C-e H A` to try and export it using ox-hugo.
I was able to reproduce the issue. This is a bug on ox-hugo side.
`org-hugo--get-pre-processed-buffer' inserts text with
inhibit-modification-hooks bound to non-nil, which breaks
org-element-cache. The cache is enabled by default in latest Org, which
is why the issue revealed itself.
The fix on ox-hugo side can be made similarly to the new implementation
of `org-export--generate-copy-script' - ox-hugo needs to manually reset
the cache after silent changes in temporary Org buffer.
Could you kindly forward this message to ox-hugo devs?
If you are seeing some other packages (not ox-hugo) in the warning
backtraces, feel free to report them as well.
Best,
Ihor