* [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
@ 2021-11-07 20:22 John Mathena
2021-11-08 5:59 ` Ihor Radchenko
2022-01-06 11:17 ` [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] Karl Voit
0 siblings, 2 replies; 15+ messages in thread
From: John Mathena @ 2021-11-07 20:22 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 47785 bytes --]
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).
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.
#+hugo_base_dir: ~
* Posts
** Emacs
:PROPERTIES:
:EXPORT_FILE_NAME: emacs
:END:
It's great!
Upon trying this, I get the following warning (Org setup and machine specs
at the bottom).
Best,
John
Warning (emacs): org-element--cache: Unregistered buffer modifications
detected. Resetting.
If this warning appears regularly, please report it to Org mode mailing
list (M-x org-submit-bug-report).
The buffer is: *Ox-hugo Pre-processed bugfix.org *
Current command: org-export-dispatch
Backtrace:
" backtrace-to-string(nil)
(format \"Unregistered buffer modifications detected. Resett...\"
(buffer-name (current-buffer)) this-command (backtrace-to-string
(backtrace-get-frames 'backtrace)))
(let* ((format-string (format \"Unregistered buffer modifications
detected. Resett...\" (buffer-name (current-buffer)) this-command
(backtrace-to-string (backtrace-get-frames 'backtrace)))) (format-string
(if (or (not org-element--cache-diagnostics-ring) (not (eq 'backtrace
org-element--cache-self-verify))) format-string (prog1 (concat (format
\"Warning(%s): \" (buffer-name ...)) format-string \"\\nBacktrace:\\n \"
(mapconcat #'identity (ring-elements org-element--cache-diagnostics-ring)
\"\\n \")) (setq org-element--cache-diagnostics-ring nil))))) (if (and
(boundp 'org-batch-test) org-batch-test) (error \"%s\" (concat
\"org-element--cache: \" format-string)) (warn \"%s\" (concat
\"org-element--cache: \" format-string))))
(progn (let* ((format-string (format \"Unregistered buffer modifications
detected. Resett...\" (buffer-name (current-buffer)) this-command
(backtrace-to-string (backtrace-get-frames 'backtrace)))) (format-string
(if (or (not org-element--cache-diagnostics-ring) (not (eq ...
org-element--cache-self-verify))) format-string (prog1 (concat (format
\"Warning(%s): \" ...) format-string \"\\nBacktrace:\\n \" (mapconcat ...
... \"\\n \")) (setq org-element--cache-diagnostics-ring nil))))) (if (and
(boundp 'org-batch-test) org-batch-test) (error \"%s\" (concat
\"org-element--cache: \" format-string)) (warn \"%s\" (concat
\"org-element--cache: \" format-string)))) (org-element-cache-reset))
(if (/= org-element--cache-change-tic (buffer-chars-modified-tick))
(progn (let* ((format-string (format \"Unregistered buffer modifications
detected. Resett...\" (buffer-name (current-buffer)) this-command
(backtrace-to-string (backtrace-get-frames ...)))) (format-string (if (or
(not org-element--cache-diagnostics-ring) (not ...)) format-string (prog1
(concat ... format-string \"\\nBacktrace:\\n \" ...) (setq
org-element--cache-diagnostics-ring nil))))) (if (and (boundp
'org-batch-test) org-batch-test) (error \"%s\" (concat
\"org-element--cache: \" format-string)) (warn \"%s\" (concat
\"org-element--cache: \" format-string)))) (org-element-cache-reset)) (let
((inhibit-quit t) request next) (setq
org-element--cache-interrupt-C-g-count 0) (if org-element--cache-sync-timer
(progn (cancel-timer org-element--cache-sync-timer))) (let ((time-limit
(time-add nil org-element-cache-sync-duration))) (catch
'org-element--cache-interrupt (if org-element--cache-sync-requests (progn
(if (or org-element--cache-diagnostics ...) (progn ...)))) (while
org-element--cache-sync-requests (setq request (car
org-element--cache-sync-requests) next (nth 1
org-element--cache-sync-requests)) (org-element--cache-process-request
request (if next (progn ...)) threshold (if threshold nil time-limit)
future-change) (setq request (car org-element--cache-sync-requests) next
(nth 1 org-element--cache-sync-requests)) (if next (progn (let* ... ...)
(if ... ...) (let* ... ...))) (setq org-element--cache-sync-requests (cdr
org-element--cache-sync-requests))))) (if org-element--cache-sync-requests
(org-element--cache-set-timer buffer) (setq
org-element--cache-sync-keys-value (1+
org-element--cache-sync-keys-value)))))
(save-current-buffer (set-buffer (or (buffer-base-buffer buffer) buffer))
(if (/= org-element--cache-change-tic (buffer-chars-modified-tick)) (progn
(let* ((format-string (format \"Unregistered buffer modifications detected.
Resett...\" (buffer-name ...) this-command (backtrace-to-string ...)))
(format-string (if (or ... ...) format-string (prog1 ... ...)))) (if (and
(boundp 'org-batch-test) org-batch-test) (error \"%s\" (concat
\"org-element--cache: \" format-string)) (warn \"%s\" (concat
\"org-element--cache: \" format-string)))) (org-element-cache-reset)) (let
((inhibit-quit t) request next) (setq
org-element--cache-interrupt-C-g-count 0) (if org-element--cache-sync-timer
(progn (cancel-timer org-element--cache-sync-timer))) (let ((time-limit
(time-add nil org-element-cache-sync-duration))) (catch
'org-element--cache-interrupt (if org-element--cache-sync-requests (progn
(if ... ...))) (while org-element--cache-sync-requests (setq request (car
org-element--cache-sync-requests) next (nth 1
org-element--cache-sync-requests)) (org-element--cache-process-request
request (if next ...) threshold (if threshold nil time-limit)
future-change) (setq request (car org-element--cache-sync-requests) next
(nth 1 org-element--cache-sync-requests)) (if next (progn ... ... ...))
(setq org-element--cache-sync-requests (cdr
org-element--cache-sync-requests))))) (if org-element--cache-sync-requests
(org-element--cache-set-timer buffer) (setq
org-element--cache-sync-keys-value (1+
org-element--cache-sync-keys-value))))))
(progn (save-current-buffer (set-buffer (or (buffer-base-buffer buffer)
buffer)) (if (/= org-element--cache-change-tic
(buffer-chars-modified-tick)) (progn (let* ((format-string (format
\"Unregistered buffer modifications detected. Resett...\" ... this-command
...)) (format-string (if ... format-string ...))) (if (and (boundp ...)
org-batch-test) (error \"%s\" (concat \"org-element--cache: \"
format-string)) (warn \"%s\" (concat \"org-element--cache: \"
format-string)))) (org-element-cache-reset)) (let ((inhibit-quit t) request
next) (setq org-element--cache-interrupt-C-g-count 0) (if
org-element--cache-sync-timer (progn (cancel-timer
org-element--cache-sync-timer))) (let ((time-limit (time-add nil
org-element-cache-sync-duration))) (catch 'org-element--cache-interrupt (if
org-element--cache-sync-requests (progn ...)) (while
org-element--cache-sync-requests (setq request ... next ...)
(org-element--cache-process-request request ... threshold ...
future-change) (setq request ... next ...) (if next ...) (setq
org-element--cache-sync-requests ...)))) (if
org-element--cache-sync-requests (org-element--cache-set-timer buffer)
(setq org-element--cache-sync-keys-value (1+
org-element--cache-sync-keys-value)))))))
(if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer (or
(buffer-base-buffer buffer) buffer)) (if (/= org-element--cache-change-tic
(buffer-chars-modified-tick)) (progn (let* ((format-string ...)
(format-string ...)) (if (and ... org-batch-test) (error \"%s\" ...) (warn
\"%s\" ...))) (org-element-cache-reset)) (let ((inhibit-quit t) request
next) (setq org-element--cache-interrupt-C-g-count 0) (if
org-element--cache-sync-timer (progn (cancel-timer
org-element--cache-sync-timer))) (let ((time-limit ...)) (catch
'org-element--cache-interrupt (if org-element--cache-sync-requests ...)
(while org-element--cache-sync-requests ... ... ... ... ...))) (if
org-element--cache-sync-requests (org-element--cache-set-timer buffer)
(setq org-element--cache-sync-keys-value (1+
org-element--cache-sync-keys-value))))))))
org-element--cache-sync(#<buffer *Ox-hugo Pre-processed bugfix.org *>
#<marker at 141 in *Ox-hugo Pre-processed bugfix.org *>)
(if cached-only nil (org-element--cache-sync (current-buffer) pom))
(if (not org-element--cache) (org-element-cache-reset) (if cached-only
nil (org-element--cache-sync (current-buffer) pom)))
(progn (if (not org-element--cache) (org-element-cache-reset) (if
cached-only nil (org-element--cache-sync (current-buffer) pom))))
(if (org-element--cache-active-p) (progn (if (not org-element--cache)
(org-element-cache-reset) (if cached-only nil (org-element--cache-sync
(current-buffer) pom)))))
(let (element) (if (org-element--cache-active-p) (progn (if (not
org-element--cache) (org-element-cache-reset) (if cached-only nil
(org-element--cache-sync (current-buffer) pom))))) (setq element (if
cached-only (and (org-element--cache-active-p) (or (not
org-element--cache-sync-requests) (org-element--cache-key-less-p pom (aref
(car org-element--cache-sync-requests) 0))) (org-element--cache-find pom))
(condition-case err (org-element--parse-to pom) (error (let*
((format-string ...) (format-string ...)) (if (and ... org-batch-test)
(error \"%s\" ...) (warn \"%s\" ...))) (org-element-cache-reset)
(org-element--parse-to pom))))) (if (and (org-element--cache-active-p)
element (org-element--cache-verify-element element)) (progn (setq element
(org-element--parse-to pom)))) (if (eq 'org-data (org-element-type
element)) nil (if (and cached-only (not (and element (or (= pom ...) (and
... ... ...) (and ... ... ...) (and ... ... ...) (and ... ... ...))))) nil
(if (not (eq (org-element-type element) 'section)) element
(org-element-at-point (1+ pom) cached-only)))))
org-element-at-point(#<marker at 141 in *Ox-hugo Pre-processed bugfix.org
*>)
(save-restriction (if narrow nil (widen)) (org-element-at-point to-pos)
(let* ((start (and from-pos (progn (goto-char from-pos)
(org-element-property :begin (progn ... ...))))) (prev after-element) (node
(if (memq granularity '(headline headline+inlinetask))
(org-element--headline-cache-root) (org-element--cache-root))) data (stack
(list nil)) (leftp t) result (last-match t) continue-flag (func (if (or
(byte-code-function-p func) (and (symbolp func) (subrp ...)) (and (symbolp
func) (fboundp ...) (native-comp-available-p) (fboundp ...)
(subr-native-elisp-p ...)) (version< emacs-version \"29\")) func (let
((warning-minimum-log-level :error) (inhibit-message t)) (condition-case
nil (if ... ... ...) (error func))))) (next-element-re (let* ((pcase-0
#'...)) (cond ((eq granularity ...) (funcall pcase-0)) ((eq ...
restrict-elements) (funcall pcase-0)) ((eq granularity ...) (cons ... ...))
(t nil)))) (next-re (if (and next-re (string= next-re (or ...
next-element-re))) nil next-re)) (fail-re (if (and fail-re (string= fail-re
(or ... next-element-re))) nil fail-re)) (restrict-elements (or
restrict-elements (cond ((eq granularity ...) '...) ((eq granularity ...)
'...) ((eq granularity ...) org-element-greater-elements) (t nil)))) (time
(float-time)) (predicate-time 0) (count-predicate-calls-match 0)
(count-predicate-calls-fail 0)) (goto-char (or start (point-min))) (let
((save-match-data-internal (match-data))) (unwind-protect (progn (if (or
(not next-element-re) (re-search-forward ... nil ...)) (if (or ... ...) nil
(if ... ... ...) (if ... ...)) (setq continue-flag t node nil)))
(set-match-data save-match-data-internal 'evaporate))) (if (and start (>=
start to-pos)) nil (if (or org-element-cache-map--recurse (eq
org-element--cache-change-tic (alist-get granularity
org-element--cache-gapless)) (and (eq granularity 'element) (or next-re
fail-re))) nil (let ((org-element-cache-map--recurse t))
(org-element-cache-map #'ignore :granularity granularity) (setq node (if
(memq granularity ...) (org-element--headline-cache-root)
(org-element--cache-root)))) (let* ((p (if ... ... ...)) (v
org-element--cache-change-tic)) (progn (if p (setcdr p v) (setq
org-element--cache-gapless ...)) v))) (while node (setq data (progn (progn
(aref node 2)))) (if (and leftp (progn (progn ...)) (or (not prev) (not
...)) (or (not start) (not ...))) (progn (setq stack (cons node stack))
(setq node (progn ...))) (if (or (and start ...) (and prev ...)) nil (if
(or ... ...) (let ... ... ...) (if ... ...) (if node ...))) (if
continue-flag (setq continue-flag nil) (setq node (if ... ... ...)))))) (if
(and org-element--cache-map-statistics (or (not
org-element--cache-map-statistics-threshold) (> (- (float-time) time)
org-element--cache-map-statistics-threshold))) (progn (message \"Mapped
over elements in %S. %d/%d predicate matche...\" (current-buffer)
count-predicate-calls-match (+ count-predicate-calls-match
count-predicate-calls-fail) (- (float-time) time) predicate-time (if (= 0
(+ count-predicate-calls-match count-predicate-calls-fail)) 0 (/
predicate-time (+ count-predicate-calls-match count-predicate-calls-fail)))
granularity restrict-elements next-re fail-re from-pos to-pos limit-count
after-element))) (nreverse result)))
(save-excursion (save-restriction (if narrow nil (widen))
(org-element-at-point to-pos) (let* ((start (and from-pos (progn (goto-char
from-pos) (org-element-property :begin ...)))) (prev after-element) (node
(if (memq granularity '...) (org-element--headline-cache-root)
(org-element--cache-root))) data (stack (list nil)) (leftp t) result
(last-match t) continue-flag (func (if (or (byte-code-function-p func) (and
... ...) (and ... ... ... ... ...) (version< emacs-version \"29\")) func
(let (... ...) (condition-case nil ... ...)))) (next-element-re (let*
((pcase-0 ...)) (cond (... ...) (... ...) (... ...) (t nil)))) (next-re (if
(and next-re (string= next-re ...)) nil next-re)) (fail-re (if (and fail-re
(string= fail-re ...)) nil fail-re)) (restrict-elements (or
restrict-elements (cond (... ...) (... ...) (...
org-element-greater-elements) (t nil)))) (time (float-time))
(predicate-time 0) (count-predicate-calls-match 0)
(count-predicate-calls-fail 0)) (goto-char (or start (point-min))) (let
((save-match-data-internal (match-data))) (unwind-protect (progn (if (or
... ...) (if ... nil ... ...) (setq continue-flag t node nil)))
(set-match-data save-match-data-internal 'evaporate))) (if (and start (>=
start to-pos)) nil (if (or org-element-cache-map--recurse (eq
org-element--cache-change-tic (alist-get granularity
org-element--cache-gapless)) (and (eq granularity ...) (or next-re
fail-re))) nil (let ((org-element-cache-map--recurse t))
(org-element-cache-map #'ignore :granularity granularity) (setq node (if
... ... ...))) (let* ((p ...) (v org-element--cache-change-tic)) (progn (if
p ... ...) v))) (while node (setq data (progn (progn ...))) (if (and leftp
(progn ...) (or ... ...) (or ... ...)) (progn (setq stack ...) (setq node
...)) (if (or ... ...) nil (if ... ... ... ...)) (if continue-flag (setq
continue-flag nil) (setq node ...))))) (if (and
org-element--cache-map-statistics (or (not
org-element--cache-map-statistics-threshold) (> (- ... time)
org-element--cache-map-statistics-threshold))) (progn (message \"Mapped
over elements in %S. %d/%d predicate matche...\" (current-buffer)
count-predicate-calls-match (+ count-predicate-calls-match
count-predicate-calls-fail) (- (float-time) time) predicate-time (if (= 0
...) 0 (/ predicate-time ...)) granularity restrict-elements next-re
fail-re from-pos to-pos limit-count after-element))) (nreverse result))))
(let ((gc-cons-threshold 1073741824)) (save-excursion (save-restriction
(if narrow nil (widen)) (org-element-at-point to-pos) (let* ((start (and
from-pos (progn ... ...))) (prev after-element) (node (if (memq granularity
...) (org-element--headline-cache-root) (org-element--cache-root))) data
(stack (list nil)) (leftp t) result (last-match t) continue-flag (func (if
(or ... ... ... ...) func (let ... ...))) (next-element-re (let* (...)
(cond ... ... ... ...))) (next-re (if (and next-re ...) nil next-re))
(fail-re (if (and fail-re ...) nil fail-re)) (restrict-elements (or
restrict-elements (cond ... ... ... ...))) (time (float-time))
(predicate-time 0) (count-predicate-calls-match 0)
(count-predicate-calls-fail 0)) (goto-char (or start (point-min))) (let
((save-match-data-internal (match-data))) (unwind-protect (progn (if ...
... ...)) (set-match-data save-match-data-internal 'evaporate))) (if (and
start (>= start to-pos)) nil (if (or org-element-cache-map--recurse (eq
org-element--cache-change-tic ...) (and ... ...)) nil (let (...)
(org-element-cache-map ... :granularity granularity) (setq node ...)) (let*
(... ...) (progn ... v))) (while node (setq data (progn ...)) (if (and
leftp ... ... ...) (progn ... ...) (if ... nil ...) (if continue-flag ...
...)))) (if (and org-element--cache-map-statistics (or (not
org-element--cache-map-statistics-threshold) (> ...
org-element--cache-map-statistics-threshold))) (progn (message \"Mapped
over elements in %S. %d/%d predicate matche...\" (current-buffer)
count-predicate-calls-match (+ count-predicate-calls-match
count-predicate-calls-fail) (- ... time) predicate-time (if ... 0 ...)
granularity restrict-elements next-re fail-re from-pos to-pos limit-count
after-element))) (nreverse result)))))
(progn (if (org-element--cache-active-p) nil (error \"Cache must be
active.\")) (if (memq granularity '(headline headline+inlinetask
greater-element element)) nil (error \"Unsupported granularity: %S\"
granularity)) (if (markerp to-pos) nil (let ((mk (make-marker)))
(set-marker mk to-pos) (setq to-pos mk))) (let ((gc-cons-threshold
1073741824)) (save-excursion (save-restriction (if narrow nil (widen))
(org-element-at-point to-pos) (let* ((start (and from-pos ...)) (prev
after-element) (node (if ... ... ...)) data (stack (list nil)) (leftp t)
result (last-match t) continue-flag (func (if ... func ...))
(next-element-re (let* ... ...)) (next-re (if ... nil next-re)) (fail-re
(if ... nil fail-re)) (restrict-elements (or restrict-elements ...)) (time
(float-time)) (predicate-time 0) (count-predicate-calls-match 0)
(count-predicate-calls-fail 0)) (goto-char (or start (point-min))) (let
((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...))) (if (and start (>= start
to-pos)) nil (if (or org-element-cache-map--recurse ... ...) nil (let ...
... ...) (let* ... ...)) (while node (setq data ...) (if ... ... ... ...)))
(if (and org-element--cache-map-statistics (or ... ...)) (progn (message
\"Mapped over elements in %S. %d/%d predicate matche...\" ...
count-predicate-calls-match ... ... predicate-time ... granularity
restrict-elements next-re fail-re from-pos to-pos limit-count
after-element))) (nreverse result))))))
(progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq
(car --cl-keys--) '(:granularity :restrict-elements :next-re :fail-re
:from-pos :to-pos :after-element :limit-count :narrow :allow-other-keys))
(setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ...
--cl-rest--))) (setq --cl-keys-- nil)) (t (error \"Keyword argument %s not
one of (:granularity :rest...\" (car --cl-keys--)))))) (progn (if
(org-element--cache-active-p) nil (error \"Cache must be active.\")) (if
(memq granularity '(headline headline+inlinetask greater-element element))
nil (error \"Unsupported granularity: %S\" granularity)) (if (markerp
to-pos) nil (let ((mk (make-marker))) (set-marker mk to-pos) (setq to-pos
mk))) (let ((gc-cons-threshold 1073741824)) (save-excursion
(save-restriction (if narrow nil (widen)) (org-element-at-point to-pos)
(let* ((start ...) (prev after-element) (node ...) data (stack ...) (leftp
t) result (last-match t) continue-flag (func ...) (next-element-re ...)
(next-re ...) (fail-re ...) (restrict-elements ...) (time ...)
(predicate-time 0) (count-predicate-calls-match 0)
(count-predicate-calls-fail 0)) (goto-char (or start ...)) (let (...)
(unwind-protect ... ...)) (if (and start ...) nil (if ... nil ... ...)
(while node ... ...)) (if (and org-element--cache-map-statistics ...)
(progn ...)) (nreverse result)))))))
(let* ((granularity (car (cdr (or (plist-member --cl-rest--
':granularity) '(nil headline+inlinetask))))) (restrict-elements (car (cdr
(plist-member --cl-rest-- ':restrict-elements)))) (next-re (car (cdr
(plist-member --cl-rest-- ':next-re)))) (fail-re (car (cdr (plist-member
--cl-rest-- ':fail-re)))) (from-pos (car (cdr (plist-member --cl-rest--
':from-pos)))) (to-pos (car (cdr (or (plist-member --cl-rest-- ':to-pos)
(list nil (point-max-marker)))))) (after-element (car (cdr (plist-member
--cl-rest-- ':after-element)))) (limit-count (car (cdr (plist-member
--cl-rest-- ':limit-count)))) (narrow (car (cdr (plist-member --cl-rest--
':narrow))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys--
(cond ((memq (car --cl-keys--) '...) (setq --cl-keys-- (cdr ...))) ((car
(cdr ...)) (setq --cl-keys-- nil)) (t (error \"Keyword argument %s not one
of (:granularity :rest...\" (car --cl-keys--)))))) (progn (if
(org-element--cache-active-p) nil (error \"Cache must be active.\")) (if
(memq granularity '(headline headline+inlinetask greater-element element))
nil (error \"Unsupported granularity: %S\" granularity)) (if (markerp
to-pos) nil (let ((mk (make-marker))) (set-marker mk to-pos) (setq to-pos
mk))) (let ((gc-cons-threshold 1073741824)) (save-excursion
(save-restriction (if narrow nil (widen)) (org-element-at-point to-pos)
(let* (... ... ... data ... ... result ... continue-flag ... ... ... ...
... ... ... ... ...) (goto-char ...) (let ... ...) (if ... nil ... ...) (if
... ...) (nreverse result))))))))
org-element-cache-map((closure ((fast-re . \"^\\\\*+ \") (ts-date-pair)
(ts-date-type) (ts-date) (priority) (entry) (marker) (todo) (txt) (i)
(category) (level) (rtn1) (rtn) (llast . 0) (tags-alist (0)) (tags-list)
(tags) (lspos) (props face default done-face org-agenda-done undone-face
default mouse-face highlight org-not-done-regexp \"\\\\(TODO\\\\)\"
org-todo-regexp \"\\\\(DONE\\\\|TODO\\\\)\" org-complex-heading-regexp
\"^\\\\(\\\\*+\\\\)\\\\(?: +\\\\(DONE\\\\|TODO\\\\)\\\\)?\\\\(?:
+\\\\(\\\\[#.\\\\]\\\\)\\\\)?...\" help-echo \"mouse-2 or RET jump to Org
file \\\"~/bugfix.org\\\"\") (re . \"^\\\\*+
*\\\\(\\\\<\\\\(DONE\\\\|TODO\\\\)\\\\>\\\\)? *\\\\(.*?\\\\)\\\\([
\\11]:\\\\(?:...\") (start-level) (todo-only) (matcher lambda (todo
tags-list level) (progn (setq org-cached-props nil) (or (and (org-string<>
... \"\"))))) (action . #f(compiled-function () #<bytecode
0x157433e69025>)) org-agenda-archives-mode org-end-time-was-given
org-time-was-given org-blocked-by-checkboxes org-state
org-agenda-headline-snapshot-before-repeat org-agenda-buffer-name
org-agenda-start-on-weekday org-agenda-buffer-tmp-name
buffer-face-mode-face org-struct-menu org-last-state org-clock-start-time
texmathp-why remember-data-file org-agenda-tags-todo-honor-ignore-options
iswitchb-temp-buflist calc-embedded-open-mode calc-embedded-open-formula
calc-embedded-close-formula align-mode-rules-list
org-export-registered-backends crm-separator
org-indent-indentation-per-level org-agenda-buffer-name ...) (el)
(goto-char (org-element-property :begin el)) (setq todo
(org-element-property :todo-keyword el) level (org-element-property :level
el) category (org-entry-get-with-inheritance \"CATEGORY\" nil el) tags-list
(org-get-tags el) org-scanner-tags tags-list) (if (eq action 'agenda)
(progn (setq ts-date-pair (org-agenda-entry-get-agenda-timestamp (point))
ts-date (car ts-date-pair) ts-date-type (cdr ts-date-pair)))) (catch :skip
(if (and (and (or (not todo-only) (member todo org-todo-keywords-1)) (if
(functionp matcher) (let ... ...) matcher)) (progn (if (eq action ...) nil
(org-agenda-skip el)) t) (or (not todo-only) (and (member todo
org-todo-keywords-1) (or ... ...)))) (progn (cond ((eq action ...) (and
org-highlight-sparse-tree-matches ... ... ...) (org-show-context ...)) ((eq
action ...) (let* ... ... ...) (goto-char ...) (setq marker ...)
(org-add-props txt props ... marker ... marker ... category ... todo ...
ts-date ... priority ... ...) (setq rtn ...)) ((functionp action) (setq
org-map-continue-from nil) (save-excursion ... ...)) (t (user-error
\"Invalid action\"))) (if org-tags-match-list-sublevels nil (goto-char (1-
...)))))) (if org-map-continue-from (progn (goto-char
org-map-continue-from))) nil) :next-re \"^\\\\*+ \" :fail-re \"^\\\\*+ \"
:narrow t)
(let ((fast-re (concat \"^\" (if start-level (concat \"\\\\*\\\\{\"
(number-to-string start-level) \"\\\\} \") org-outline-regexp))))
(org-element-cache-map #'(lambda (el) (goto-char (org-element-property
:begin el)) (setq todo (org-element-property :todo-keyword el) level
(org-element-property :level el) category (org-entry-get-with-inheritance
\"CATEGORY\" nil el) tags-list (org-get-tags el) org-scanner-tags
tags-list) (if (eq action 'agenda) (progn (setq ts-date-pair
(org-agenda-entry-get-agenda-timestamp ...) ts-date (car ts-date-pair)
ts-date-type (cdr ts-date-pair)))) (catch :skip (if (and (and ... ...)
(progn ... t) (or ... ...)) (progn (cond ... ... ... ...) (if
org-tags-match-list-sublevels nil ...)))) (if org-map-continue-from (progn
(goto-char org-map-continue-from))) nil) :next-re fast-re :fail-re fast-re
:narrow t))
(if (org-element--cache-active-p) (let ((fast-re (concat \"^\" (if
start-level (concat \"\\\\*\\\\{\" (number-to-string start-level) \"\\\\}
\") org-outline-regexp)))) (org-element-cache-map #'(lambda (el) (goto-char
(org-element-property :begin el)) (setq todo (org-element-property
:todo-keyword el) level (org-element-property :level el) category
(org-entry-get-with-inheritance \"CATEGORY\" nil el) tags-list
(org-get-tags el) org-scanner-tags tags-list) (if (eq action 'agenda)
(progn (setq ts-date-pair ... ts-date ... ts-date-type ...))) (catch :skip
(if (and ... ... ...) (progn ... ...))) (if org-map-continue-from (progn
(goto-char org-map-continue-from))) nil) :next-re fast-re :fail-re fast-re
:narrow t)) (while (let (case-fold-search) (re-search-forward re nil t))
(setq org-map-continue-from nil) (catch :skip (if (and (fboundp
'org-inlinetask-end-p) (org-inlinetask-end-p)) (progn (throw :skip t)))
(setq todo (and (match-end 1) (match-string-no-properties 1))) (setq tags
(and (match-end 4) (org-trim (match-string-no-properties 4)))) (goto-char
(setq lspos (match-beginning 0))) (setq level (org-reduced-level
(org-outline-level)) category (org-get-category)) (if (eq action 'agenda)
(progn (setq ts-date-pair (org-agenda-entry-get-agenda-timestamp (point))
ts-date (car ts-date-pair) ts-date-type (cdr ts-date-pair)))) (setq i llast
llast level) (while (>= i level) (if (setq entry (assoc i tags-alist))
(progn (setq tags-alist (delete entry tags-alist)))) (setq i (1- i))) (if
tags (progn (setq tags (org-split-string tags \":\") tags-alist (cons (cons
level tags) tags-alist)))) (setq tags-list (if org-use-tag-inheritance
(apply 'append (mapcar 'cdr (reverse tags-alist))) tags) org-scanner-tags
tags-list) (if org-use-tag-inheritance (progn (setcdr (car tags-alist)
(mapcar #'... (cdr ...))))) (if (and tags org-use-tag-inheritance (or (not
(eq t org-use-tag-inheritance)) org-tags-exclude-from-inheritance)) (progn
(setcdr (car tags-alist) (org-remove-uninherited-tags (cdr ...))))) (if
(and (and (or (not todo-only) (member todo org-todo-keywords-1)) (if
(functionp matcher) (let ... ...) matcher)) (progn (if (eq action ...) nil
(org-agenda-skip)) t) (or (not todo-only) (and (member todo
org-todo-keywords-1) (or ... ...)))) (progn (cond ((eq action ...) (and
org-highlight-sparse-tree-matches ... ... ...) (org-show-context ...)) ((eq
action ...) (setq txt ... priority ...) (goto-char lspos) (setq marker ...)
(org-add-props txt props ... marker ... marker ... category ... todo ...
ts-date ... priority ... ...) (setq rtn ...)) ((functionp action) (setq
org-map-continue-from nil) (save-excursion ... ...)) (t (user-error
\"Invalid action\"))) (if org-tags-match-list-sublevels nil
(org-end-of-subtree t) (backward-char 1))))) (if org-map-continue-from
(goto-char org-map-continue-from) (and (= (point) lspos) (end-of-line 1)))))
(save-excursion (goto-char (point-min)) (if (eq action 'sparse-tree)
(progn (org-overview) (org-remove-occur-highlights))) (if
(org-element--cache-active-p) (let ((fast-re (concat \"^\" (if start-level
(concat \"\\\\*\\\\{\" ... \"\\\\} \") org-outline-regexp))))
(org-element-cache-map #'(lambda (el) (goto-char (org-element-property
:begin el)) (setq todo (org-element-property :todo-keyword el) level
(org-element-property :level el) category (org-entry-get-with-inheritance
\"CATEGORY\" nil el) tags-list (org-get-tags el) org-scanner-tags
tags-list) (if (eq action ...) (progn ...)) (catch :skip (if ... ...)) (if
org-map-continue-from (progn ...)) nil) :next-re fast-re :fail-re fast-re
:narrow t)) (while (let (case-fold-search) (re-search-forward re nil t))
(setq org-map-continue-from nil) (catch :skip (if (and (fboundp
'org-inlinetask-end-p) (org-inlinetask-end-p)) (progn (throw :skip t)))
(setq todo (and (match-end 1) (match-string-no-properties 1))) (setq tags
(and (match-end 4) (org-trim (match-string-no-properties 4)))) (goto-char
(setq lspos (match-beginning 0))) (setq level (org-reduced-level
(org-outline-level)) category (org-get-category)) (if (eq action 'agenda)
(progn (setq ts-date-pair (org-agenda-entry-get-agenda-timestamp ...)
ts-date (car ts-date-pair) ts-date-type (cdr ts-date-pair)))) (setq i llast
llast level) (while (>= i level) (if (setq entry (assoc i tags-alist))
(progn (setq tags-alist ...))) (setq i (1- i))) (if tags (progn (setq tags
(org-split-string tags \":\") tags-alist (cons ... tags-alist)))) (setq
tags-list (if org-use-tag-inheritance (apply 'append (mapcar ... ...))
tags) org-scanner-tags tags-list) (if org-use-tag-inheritance (progn
(setcdr (car tags-alist) (mapcar ... ...)))) (if (and tags
org-use-tag-inheritance (or (not ...) org-tags-exclude-from-inheritance))
(progn (setcdr (car tags-alist) (org-remove-uninherited-tags ...)))) (if
(and (and (or ... ...) (if ... ... matcher)) (progn (if ... nil ...) t) (or
(not todo-only) (and ... ...))) (progn (cond (... ... ...) (... ... ... ...
... ...) (... ... ...) (t ...)) (if org-tags-match-list-sublevels nil
(org-end-of-subtree t) (backward-char 1))))) (if org-map-continue-from
(goto-char org-map-continue-from) (and (= (point) lspos) (end-of-line
1))))))
(let* ((re (concat \"^\" (if start-level (concat \"\\\\*\\\\{\"
(number-to-string start-level) \"\\\\} \") org-outline-regexp) \" *\\\\(\"
(regexp-opt org-todo-keywords-1 'words) \"\\\\)?\" \" *\\\\(.*?\\\\)\\\\([
\\11]:\\\\(?:\" org-tag-re \":\\\\)+\\\\)?[ \\11]*$\")) (props (list 'face
'default 'done-face 'org-agenda-done 'undone-face 'default 'mouse-face
'highlight 'org-not-done-regexp org-not-done-regexp 'org-todo-regexp
org-todo-regexp 'org-complex-heading-regexp org-complex-heading-regexp
'help-echo (format \"mouse-2 or RET jump to Org file %S\"
(abbreviate-file-name (or (buffer-file-name ...) (buffer-name ...))))))
(org-map-continue-from nil) lspos tags tags-list (tags-alist (list (cons 0
org-file-tags))) (llast 0) rtn rtn1 level category i txt todo marker entry
priority ts-date ts-date-type ts-date-pair) (if (or (member action '(agenda
sparse-tree)) (functionp action)) nil (setq action (list 'lambda nil
action))) (save-excursion (goto-char (point-min)) (if (eq action
'sparse-tree) (progn (org-overview) (org-remove-occur-highlights))) (if
(org-element--cache-active-p) (let ((fast-re (concat \"^\" (if start-level
... org-outline-regexp)))) (org-element-cache-map #'(lambda (el) (goto-char
...) (setq todo ... level ... category ... tags-list ... org-scanner-tags
tags-list) (if ... ...) (catch :skip ...) (if org-map-continue-from ...)
nil) :next-re fast-re :fail-re fast-re :narrow t)) (while (let
(case-fold-search) (re-search-forward re nil t)) (setq
org-map-continue-from nil) (catch :skip (if (and (fboundp ...)
(org-inlinetask-end-p)) (progn (throw :skip t))) (setq todo (and (match-end
1) (match-string-no-properties 1))) (setq tags (and (match-end 4) (org-trim
...))) (goto-char (setq lspos (match-beginning 0))) (setq level
(org-reduced-level (org-outline-level)) category (org-get-category)) (if
(eq action 'agenda) (progn (setq ts-date-pair ... ts-date ... ts-date-type
...))) (setq i llast llast level) (while (>= i level) (if (setq entry ...)
(progn ...)) (setq i (1- i))) (if tags (progn (setq tags ... tags-alist
...))) (setq tags-list (if org-use-tag-inheritance (apply ... ...) tags)
org-scanner-tags tags-list) (if org-use-tag-inheritance (progn (setcdr ...
...))) (if (and tags org-use-tag-inheritance (or ...
org-tags-exclude-from-inheritance)) (progn (setcdr ... ...))) (if (and (and
... ...) (progn ... t) (or ... ...)) (progn (cond ... ... ... ...) (if
org-tags-match-list-sublevels nil ... ...)))) (if org-map-continue-from
(goto-char org-map-continue-from) (and (= (point) lspos) (end-of-line
1)))))) (if (and (eq action 'sparse-tree) (not
org-sparse-tree-open-archived-trees)) (progn (org-hide-archived-subtrees
(point-min) (point-max)))) (nreverse rtn))
org-scan-tags(#f(compiled-function () #<bytecode 0x157433e69025>) (lambda
(todo tags-list level) (progn (setq org-cached-props nil) (or (and
(org-string<> (or (org-cached-entry-get nil \"EXPORT_FILE_NAME\") \"\")
\"\"))))) nil nil)
(setq res (org-scan-tags func matcher org--matcher-tags-todo-only
start-level))
(progn (org-agenda-prepare-buffers (and buffer-file-name (list
buffer-file-name))) (setq res (org-scan-tags func matcher
org--matcher-tags-todo-only start-level)))
(if (not scope) (progn (org-agenda-prepare-buffers (and buffer-file-name
(list buffer-file-name))) (setq res (org-scan-tags func matcher
org--matcher-tags-todo-only start-level))) (cond ((and scope (listp scope)
(symbolp (car scope))) (setq scope (eval scope))) ((eq scope 'agenda) (setq
scope (org-agenda-files t))) ((eq scope 'agenda-with-archives) (setq scope
(org-agenda-files t)) (setq scope (org-add-archive-files scope))) ((eq
scope 'file) (setq scope (and buffer-file-name (list buffer-file-name))))
((eq scope 'file-with-archives) (setq scope (org-add-archive-files (list
(buffer-file-name)))))) (org-agenda-prepare-buffers scope) (let
((--dolist-tail-- scope)) (while --dolist-tail-- (let ((file (car
--dolist-tail--))) (save-current-buffer (set-buffer
(org-find-base-buffer-visiting file)) (save-excursion (save-restriction
(widen) (goto-char ...) (setq res ...)))) (setq --dolist-tail-- (cdr
--dolist-tail--))))))
(save-restriction (cond ((eq scope 'tree) (org-back-to-heading t)
(org-narrow-to-subtree) (setq scope nil)) ((and (or (eq scope 'region) (eq
scope 'region-start-level)) (org-region-active-p)) (if start-level (progn
(save-excursion (goto-char (region-beginning)) (if (org-at-heading-p) nil
(outline-next-heading)) (setq start-level (org-current-level)))))
(narrow-to-region (region-beginning) (save-excursion (goto-char
(region-end)) (if (and (bolp) (org-at-heading-p)) nil
(outline-next-heading)) (point))) (setq scope nil))) (if (not scope) (progn
(org-agenda-prepare-buffers (and buffer-file-name (list buffer-file-name)))
(setq res (org-scan-tags func matcher org--matcher-tags-todo-only
start-level))) (cond ((and scope (listp scope) (symbolp (car scope))) (setq
scope (eval scope))) ((eq scope 'agenda) (setq scope (org-agenda-files t)))
((eq scope 'agenda-with-archives) (setq scope (org-agenda-files t)) (setq
scope (org-add-archive-files scope))) ((eq scope 'file) (setq scope (and
buffer-file-name (list buffer-file-name)))) ((eq scope 'file-with-archives)
(setq scope (org-add-archive-files (list (buffer-file-name))))))
(org-agenda-prepare-buffers scope) (let ((--dolist-tail-- scope)) (while
--dolist-tail-- (let ((file (car --dolist-tail--))) (save-current-buffer
(set-buffer (org-find-base-buffer-visiting file)) (save-excursion
(save-restriction ... ... ...))) (setq --dolist-tail-- (cdr
--dolist-tail--)))))))
(save-excursion (save-restriction (cond ((eq scope 'tree)
(org-back-to-heading t) (org-narrow-to-subtree) (setq scope nil)) ((and (or
(eq scope 'region) (eq scope 'region-start-level)) (org-region-active-p))
(if start-level (progn (save-excursion (goto-char ...) (if ... nil ...)
(setq start-level ...)))) (narrow-to-region (region-beginning)
(save-excursion (goto-char (region-end)) (if (and ... ...) nil
(outline-next-heading)) (point))) (setq scope nil))) (if (not scope) (progn
(org-agenda-prepare-buffers (and buffer-file-name (list buffer-file-name)))
(setq res (org-scan-tags func matcher org--matcher-tags-todo-only
start-level))) (cond ((and scope (listp scope) (symbolp (car scope))) (setq
scope (eval scope))) ((eq scope 'agenda) (setq scope (org-agenda-files t)))
((eq scope 'agenda-with-archives) (setq scope (org-agenda-files t)) (setq
scope (org-add-archive-files scope))) ((eq scope 'file) (setq scope (and
buffer-file-name (list buffer-file-name)))) ((eq scope 'file-with-archives)
(setq scope (org-add-archive-files (list ...)))))
(org-agenda-prepare-buffers scope) (let ((--dolist-tail-- scope)) (while
--dolist-tail-- (let ((file ...)) (save-current-buffer (set-buffer ...)
(save-excursion ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))))))
(let* ((org-agenda-archives-mode nil) (org-agenda-skip-archived-trees
(memq 'archive skip)) (org-agenda-skip-comment-trees (memq 'comment skip))
(org-agenda-skip-function (car (org-delete-all '(comment archive) skip)))
(org-tags-match-list-sublevels t) (start-level (eq scope
'region-start-level)) matcher res org-todo-keywords-for-agenda
org-done-keywords-for-agenda org-todo-keyword-alist-for-agenda
org-tag-alist-for-agenda org--matcher-tags-todo-only) (cond ((eq match t)
(setq matcher t)) ((eq match nil) (setq matcher t)) (t (setq matcher (if
match (cdr (org-make-tags-matcher match)) t)))) (save-excursion
(save-restriction (cond ((eq scope 'tree) (org-back-to-heading t)
(org-narrow-to-subtree) (setq scope nil)) ((and (or (eq scope ...) (eq
scope ...)) (org-region-active-p)) (if start-level (progn (save-excursion
... ... ...))) (narrow-to-region (region-beginning) (save-excursion
(goto-char ...) (if ... nil ...) (point))) (setq scope nil))) (if (not
scope) (progn (org-agenda-prepare-buffers (and buffer-file-name (list
buffer-file-name))) (setq res (org-scan-tags func matcher
org--matcher-tags-todo-only start-level))) (cond ((and scope (listp scope)
(symbolp ...)) (setq scope (eval scope))) ((eq scope 'agenda) (setq scope
(org-agenda-files t))) ((eq scope 'agenda-with-archives) (setq scope
(org-agenda-files t)) (setq scope (org-add-archive-files scope))) ((eq
scope 'file) (setq scope (and buffer-file-name ...))) ((eq scope
'file-with-archives) (setq scope (org-add-archive-files ...))))
(org-agenda-prepare-buffers scope) (let ((--dolist-tail-- scope)) (while
--dolist-tail-- (let (...) (save-current-buffer ... ...) (setq
--dolist-tail-- ...))))))) res)
(if (and (or (eq scope 'region) (eq scope 'region-start-level)) (not
(org-region-active-p))) nil (let* ((org-agenda-archives-mode nil)
(org-agenda-skip-archived-trees (memq 'archive skip))
(org-agenda-skip-comment-trees (memq 'comment skip))
(org-agenda-skip-function (car (org-delete-all '(comment archive) skip)))
(org-tags-match-list-sublevels t) (start-level (eq scope
'region-start-level)) matcher res org-todo-keywords-for-agenda
org-done-keywords-for-agenda org-todo-keyword-alist-for-agenda
org-tag-alist-for-agenda org--matcher-tags-todo-only) (cond ((eq match t)
(setq matcher t)) ((eq match nil) (setq matcher t)) (t (setq matcher (if
match (cdr (org-make-tags-matcher match)) t)))) (save-excursion
(save-restriction (cond ((eq scope 'tree) (org-back-to-heading t)
(org-narrow-to-subtree) (setq scope nil)) ((and (or ... ...)
(org-region-active-p)) (if start-level (progn ...)) (narrow-to-region
(region-beginning) (save-excursion ... ... ...)) (setq scope nil))) (if
(not scope) (progn (org-agenda-prepare-buffers (and buffer-file-name ...))
(setq res (org-scan-tags func matcher org--matcher-tags-todo-only
start-level))) (cond ((and scope ... ...) (setq scope ...)) ((eq scope ...)
(setq scope ...)) ((eq scope ...) (setq scope ...) (setq scope ...)) ((eq
scope ...) (setq scope ...)) ((eq scope ...) (setq scope ...)))
(org-agenda-prepare-buffers scope) (let ((--dolist-tail-- scope)) (while
--dolist-tail-- (let ... ... ...)))))) res))
org-map-entries(#f(compiled-function () #<bytecode 0x157433e69025>)
\"EXPORT_FILE_NAME<>\\\"\\\"\")
org-hugo-export-wim-to-md(:all-subtrees nil nil)
(lambda (a _s v _b) (org-hugo-export-wim-to-md :all-subtrees a v))(nil
nil nil nil)
org-export-dispatch(nil)
funcall-interactively(org-export-dispatch nil)
call-interactively(org-export-dispatch nil nil)
command-execute(org-export-dispatch)
Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.27, cairo version 1.17.4)
of 2021-03-26
Package: Org mode version 9.5 (9.5-g859984 @
/home/john/.emacs.d/straight/build/org/)
current state:
==============
(setq
org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
org-link-shell-confirm-function 'yes-or-no-p
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
org-odt-format-headline-function 'org-odt-format-headline-default-function
org-persist-before-write-hook '(org-element--cache-persist-before-write)
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-mode-hook '((closure
(org--rds reftex-docstruct-symbol visual-fill-column-width
org-clock-history
org-agenda-current-date org-with-time org-defdecode org-def
org-read-date-inactive org-ans2
org-ans1 org-columns-current-fmt-compiled org-clock-current-task
org-clock-effort
org-agenda-skip-function org-agenda-skip-comment-trees
org-agenda-archives-mode
org-end-time-was-given org-time-was-given org-blocked-by-checkboxes
org-state
org-agenda-headline-snapshot-before-repeat org-agenda-buffer-name
org-agenda-start-on-weekday
org-agenda-buffer-tmp-name buffer-face-mode-face org-struct-menu
org-last-state
org-clock-start-time texmathp-why remember-data-file
org-agenda-tags-todo-honor-ignore-options
iswitchb-temp-buflist calc-embedded-open-mode calc-embedded-open-formula
calc-embedded-close-formula align-mode-rules-list
org-export-registered-backends crm-separator
org-indent-indentation-per-level org-agenda-buffer-name
org-inlinetask-min-level t)
nil (add-hook 'change-major-mode-hook 'org-show-all 'append 'local))
(closure (*this* org-babel-confirm-evaluate-answer-no t) nil
(add-hook 'change-major-mode-hook #'org-babel-show-result-all 'append
'local))
#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook
org-show-all append local] 5]
#[0 "\300\301\302\303\304$\207"
[add-hook change-major-mode-hook org-babel-show-result-all append local]
5]
org-babel-result-hide-spec org-babel-hide-all-hashes)
org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-archive-hook '(org-attach-archive-delete-maybe)
org-persist-before-read-hook '(org-element--cache-persist-before-read)
org-confirm-elisp-link-function 'yes-or-no-p
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
org-babel-pre-tangle-hook '(save-buffer)
org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
org-agenda-loop-over-headlines-in-active-region nil
org-occur-hook '(org-first-headline-recenter)
org-export-before-processing-hook
'(org-blackfriday--reset-org-blackfriday--code-block-num-backticks)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
org-export-before-parsing-hook '(org-attach-expand-links)
org-confirm-shell-link-function 'yes-or-no-p
org-link-parameters '(("attachment" :follow org-attach-follow :complete
org-attach-complete-link)
("id" :follow org-id-open) ("eww" :follow org-eww-open :store
org-eww-store-link)
("rmail" :follow org-rmail-open :store org-rmail-store-link)
("mhe" :follow org-mhe-open :store org-mhe-store-link)
("irc" :follow org-irc-visit :store org-irc-store-link :export
org-irc-export)
("info" :follow org-info-open :export org-info-export :store
org-info-store-link)
("gnus" :follow org-gnus-open :store org-gnus-store-link)
("docview" :follow org-docview-open :export org-docview-export :store
org-docview-store-link)
("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
org-bbdb-complete-link
:store org-bbdb-store-link)
("w3m" :store org-w3m-store-link)
("doi" :follow org-link-doi-open :export org-link-doi-export)
("file+sys") ("file+emacs")
("shell" :follow org-link--open-shell)
("news" :follow
#[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
("mailto" :follow
#[514 "\301\300\302 Q \"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
("https" :follow
#[514 "\301\300\302 Q \"\207" ["https" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
("http" :follow
#[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
("ftp" :follow #[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"] 6
"\n\n(fn URL ARG)"])
("help" :follow org-link--open-help :store org-link--store-help)
("file" :complete org-link-complete-file) ("elisp" :follow
org-link--open-elisp))
org-latex-format-headline-function
'org-latex-format-headline-default-function
org-link-elisp-confirm-function 'yes-or-no-p
org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-html-format-headline-function
'org-html-format-headline-default-function
)
("news" :follow
#[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
("mailto" :follow
#[514 "\301\300\302 Q \"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
("https" :follow
#[514 "\301\300\302 Q \"\207" ["https" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
("http" :follow
#[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
("ftp" :follow #[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"] 6
"\n\n(fn URL ARG)"])
("help" :follow org-link--open-help :store org-link--store-help)
("file" :complete org-link-complete-file) ("elisp" :follow
org-link--open-elisp))
org-latex-format-headline-function
'org-latex-format-headline-default-function
org-link-elisp-confirm-function 'yes-or-no-p
org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-html-format-headline-function
'org-html-format-headline-default-function
)
[-- Attachment #2: Type: text/html, Size: 51560 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-11-07 20:22 [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] John Mathena
@ 2021-11-08 5:59 ` Ihor Radchenko
2021-12-16 2:29 ` Kaushal Modi
2022-01-06 11:17 ` [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] Karl Voit
1 sibling, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2021-11-08 5:59 UTC (permalink / raw)
To: John Mathena; +Cc: emacs-orgmode
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-11-08 5:59 ` Ihor Radchenko
@ 2021-12-16 2:29 ` Kaushal Modi
2021-12-16 2:34 ` Kaushal Modi
0 siblings, 1 reply; 15+ messages in thread
From: Kaushal Modi @ 2021-12-16 2:29 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-org list, John Mathena
[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]
On Mon, Nov 8, 2021 at 1:05 AM Ihor Radchenko <yantar92@gmail.com> wrote:
>
> 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.
>
Hi Ihor,
I followed your change to `org-export--generate-copy-script' in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fe6cefdaaf020c315031a139a7b9bc443cbefc5c
and added a `(org-element-cache-reset)' call in
`org-hugo--get-pre-processed-buffer' after the `(insert ..)' in the temp
buffer.
But I am still seeing that warning.
Ref commit to a branch:
https://github.com/kaushalmodi/ox-hugo/commit/2bdbf51922ec2e01be65397b237d0b716edb5cb4
Can you help fix this?
Thanks!
[-- Attachment #2: Type: text/html, Size: 1784 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-16 2:29 ` Kaushal Modi
@ 2021-12-16 2:34 ` Kaushal Modi
2021-12-16 4:20 ` Ihor Radchenko
0 siblings, 1 reply; 15+ messages in thread
From: Kaushal Modi @ 2021-12-16 2:34 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-org list, John Mathena
[-- Attachment #1: Type: text/plain, Size: 1664 bytes --]
On Wed, Dec 15, 2021 at 9:29 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:
>
> Can you help fix this?
>
Also looking closely, I am seeing a different warning:
Warning (org-element-cache): org-element--cache:
(org-hugo-export-wim-to-md) Cached element is incorrect in *Ox-hugo
Pre-processed ox-hugo-manual.org *<2>. (Cache tic up to date: "yes")
Resetting.
If this warning appears regularly, please report it to Org mode mailing
list (M-x org-submit-bug-report).
The element is: "(headline (:raw-value \"Homepage\" :begin 16675 :end
25840 :pre-blank 0 :contents-begin 16686 :contents-end 25840 :robust-begin
16891 :robust-end 25838 :level 1 :priority nil :tags nil :todo-keyword nil
:todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil
:commentedp nil :post-affiliated 16675 :EXPORT_TITLE \"Org to Markdown for
Hugo\" :EXPORT_FILE_NAME \"_index\" :EXPORT_HUGO_TYPE \"homepage\"
:EXPORT_HUGO_SECTION \"/\" :EXPORT_HUGO_MENU \":menu \\\"1.main\\\" :title
\\\"Homepage\\\"\" :CUSTOM_ID \"main\" :title \"Homepage\" ...))"
The real element is: "(headline (:raw-value \"Homepage\" :begin 16675 :end
25888 :pre-blank 0 :contents-begin 16686 :contents-end 25888 :robust-begin
16891 :robust-end 25886 :level 1 :priority nil :tags nil :todo-keyword nil
:todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil
:commentedp nil :post-affiliated 16675 :EXPORT_TITLE \"Org to Markdown for
Hugo\" :EXPORT_FILE_NAME \"_index\" :EXPORT_HUGO_TYPE \"homepage\"
:EXPORT_HUGO_SECTION \"/\" :EXPORT_HUGO_MENU \":menu \\\"1.main\\\" :title
\\\"Homepage\\\"\" :CUSTOM_ID \"main\" :title \"Homepage\" ...))"
I see the :end and :content-end changing.
[-- Attachment #2: Type: text/html, Size: 2356 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-16 2:34 ` Kaushal Modi
@ 2021-12-16 4:20 ` Ihor Radchenko
2021-12-16 14:33 ` Kaushal Modi
0 siblings, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2021-12-16 4:20 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list, John Mathena
Kaushal Modi <kaushal.modi@gmail.com> writes:
> Also looking closely, I am seeing a different warning:
>
> Warning (org-element-cache): org-element--cache:
> (org-hugo-export-wim-to-md) Cached element is incorrect in *Ox-hugo
> Pre-processed ox-hugo-manual.org *<2>. (Cache tic up to date: "yes")
Can you:
1. Update Org to latest version
2. set org-element--cache-self-verify to 'backtrace
3. set org-element--cache-self-verify-frequency to 1.0
4. Try to reproduce the warning you are seeing
5. If you still see it, post the full warning text including the
backtrace (below the warning).
Best,
Ihor
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-16 4:20 ` Ihor Radchenko
@ 2021-12-16 14:33 ` Kaushal Modi
2021-12-16 15:18 ` Ihor Radchenko
0 siblings, 1 reply; 15+ messages in thread
From: Kaushal Modi @ 2021-12-16 14:33 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-org list, John Mathena
[-- Attachment #1: Type: text/plain, Size: 27845 bytes --]
> Can you:
> 1. Update Org to latest version
> 2. set org-element--cache-self-verify to 'backtrace
> 3. set org-element--cache-self-verify-frequency to 1.0
> 4. Try to reproduce the warning you are seeing
> 5. If you still see it, post the full warning text including the
> backtrace (below the warning).
>
Hi Ihor,
I updated Org to
Org mode version 9.5 (release_9.5-364-gde022e @
/home/kmodi/usr_local/apps/7/emacs/emacs-28/share/emacs/site-lisp/org/)
I am using the latest build of emacs-28 branch:
=====
Emacs version: GNU Emacs 28.0.90 (build 2, x86_64-pc-linux-gnu, GTK+
Version 3.22.30, cairo version 1.15.12)
of 2021-12-16, built using commit 1e578267fb19208504d28253e0c892ceb9a34fb4.
./configure options:
--prefix=/home/kmodi/usr_local/apps/7/emacs/emacs-28
'--program-transform-name=s/^ctags$/ctags_emacs/' --with-modules
--with-harfbuzz --with-native-compilation --enable-checking=yes,glyphs
--enable-check-lisp-object-type CPPFLAGS=-I/home/kmodi/stowed/7/include
'CFLAGS=-ggdb3 -Og' 'CXXFLAGS=-ggdb3 -Og'
'LDFLAGS=-L/home/kmodi/stowed/7/lib -L/home/kmodi/stowed/7/lib64 -ggdb3'
Features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LIBOTF LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3
ZLIB
=====
I also set those 2 variables and then exported the ox-hugo-manual.org[1]
using ox-hugo and get those warnings[2].
Steps to reproduce this issue (after setting those variables as suggested
above):
1. Install ox-hugo from MELPA and require it
2. Download the ox-hugo-manual.org[1]
3. Take point to anywhere inside a subtree with :EXPROT_FILE_NAME: property
(e.g. under the * Org Special Blocks subtree around line 3038)
4. C-c C-e H A (this will export all the valid subtrees in that file using
ox-hugo)
5. The exports abruptly stop around half way due to this error (this error
doesn't always get thrown at the same point):
=====
org-babel-exp process org at position 59086...
org-babel-exp process org at position 59385...
org-babel-exp process org at position 60069...
org-babel-exp process org at position 60740...
org-babel-exp process org at position 63055...
Saving file
/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/doc/content/doc/image-links.md...
Wrote
/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/doc/content/doc/image-links.md
[ox-hugo] 21/ Exporting ‘Source blocks’ ..
org-element--cache-process-request: Format specifier doesn’t match argument
type
(I have an advice applied in between:
modi/advice-org-tangle-and-export-boost. But it's unrelated to this error.)
Debugger entered--Lisp error: (error "Format specifier doesn’t match
argument type")
format("org-element-cache diagnostics( *temp*-467986): Rea..." #<marker
at 26674 in *temp*-467986> "(headline (:raw-value \"Menus\" :begin 28167
:end 14...")
org-element--cache-process-request([26673 26673 25896 1 (paragraph
(:begin 26634 :end 26674 :contents-begin 26634 :contents-end 26674
:post-blank 0 :post-affiliated 26634 :mode nil :granularity element
:org-element--cache-sync-key (76 26672 1152921504606846975) :cached t
:parent (item (:bullet "8. " :begin 26631 :end 26674 :contents-begin 26634
:contents-end 26674 :checkbox nil :counter nil :structure ((26009 0 "1. "
nil nil nil 26029) (26029 0 "2. " nil nil nil 26145) (26145 0 "3. " nil nil
nil 26167) (26167 0 "4. " nil nil nil 26346) (26226 3 "- " nil nil nil
26346) (26346 0 "5. " nil nil nil 26462) (26389 3 "- " nil nil nil 26462)
(26462 0 "6. " nil nil nil 26564) (26564 0 "7. " nil nil nil 26631) (26631
0 "8. " nil nil nil 26674)) :pre-blank 0 :post-blank 0 :post-affiliated
26631 :tag nil :mode item :granularity element :org-element--cache-sync-key
(76 26672 -1) :cached t :parent (plain-list (:type ordered :begin 26009
:end 26674 :contents-begin 26009 :contents-end 26674 :structure ...
:post-blank 0 :post-affiliated 26009 :mode nil :granularity element
:org-element--cache-sync-key ... :cached t :parent ...)))))) 2] nil
#<marker at 26674 in *temp*-467986> nil nil)
org-element--cache-sync(#<buffer *temp*-467986> #<marker at 26674 in
*temp*-467986>)
org-element-at-point(#<marker at 26674 in *temp*-467986>)
org-element-cache-map(#f(compiled-function (el) #<bytecode
0x1c780ded3d2e9ca3>) :next-re "^\\*+ " :fail-re "^\\*+ " :narrow t)
org-scan-tags(#f(compiled-function () #<bytecode -0x1547bc42aa40a914>) t
nil nil)
org-map-entries(#f(compiled-function () #<bytecode -0x1547bc42aa40a914>))
org-export--prepare-file-contents("/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el..."
"548-589" 0 4 1 #<hash-table equal 0/65 0x192d5b1>
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el...")
org-export-expand-include-keyword()
org-export-as(hugo :subtreep nil nil (:output-file
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el..."))
#f(compiled-function (backend file &optional async subtreep visible-only
body-only ext-plist post-process) "Call `org-export-as' with output to a
specified file.\n\nBACKEND is either an export back-end, as returned by,
e.g.,\n`org-export-create-backend', or a symbol referring to\na registered
back-end. FILE is the name of the output file, as\na string.\n\nA non-nil
optional argument ASYNC means the process should happen\nasynchronously.
The resulting buffer will then be accessible\nthrough the
`org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY,
BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as',
which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as
its\nargument and happens asynchronously when ASYNC is non-nil. It\nhas to
return a file name, or nil. Export back-ends can use this\nto send the
output file through additional processing, e.g,\n\n (defun
org-latex-export-to-latex\n (&optional async subtreep visible-only
body-only ext-plist)\n (interactive)\n (let ((outfile
(org-export-output-file-name \".tex\" subtreep)))\n
(org-export-to-file \\='latex outfile\n async subtreep visible-only
body-only ext-plist\n #'org-latex-compile)))\n\nWhen expressed as an
anonymous function, using `lambda',\nPOST-PROCESS needs to be
quoted.\n\nThe function returns either a file name returned by
POST-PROCESS,\nor FILE." #<bytecode 0xeed6499aa2e2203>)(hugo
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el..." nil :subtreep nil)
apply(#f(compiled-function (backend file &optional async subtreep
visible-only body-only ext-plist post-process) "Call `org-export-as' with
output to a specified file.\n\nBACKEND is either an export back-end, as
returned by, e.g.,\n`org-export-create-backend', or a symbol referring
to\na registered back-end. FILE is the name of the output file, as\na
string.\n\nA non-nil optional argument ASYNC means the process should
happen\nasynchronously. The resulting buffer will then be
accessible\nthrough the `org-export-stack' interface.\n\nOptional arguments
SUBTREEP, VISIBLE-ONLY, BODY-ONLY and\nEXT-PLIST are similar to those used
in `org-export-as', which\nsee.\n\nOptional argument POST-PROCESS is called
with FILE as its\nargument and happens asynchronously when ASYNC is
non-nil. It\nhas to return a file name, or nil. Export back-ends can use
this\nto send the output file through additional processing, e.g,\n\n
(defun org-latex-export-to-latex\n (&optional async subtreep
visible-only body-only ext-plist)\n (interactive)\n (let ((outfile
(org-export-output-file-name \".tex\" subtreep)))\n
(org-export-to-file \\='latex outfile\n async subtreep visible-only
body-only ext-plist\n #'org-latex-compile)))\n\nWhen expressed as an
anonymous function, using `lambda',\nPOST-PROCESS needs to be
quoted.\n\nThe function returns either a file name returned by
POST-PROCESS,\nor FILE." #<bytecode 0xeed6499aa2e2203>) (hugo
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el..." nil :subtreep nil))
(prog1 (apply orig-fun args) (if projectile-enabled (progn (add-hook
'find-file-hook #'projectile-find-file-hook-function) (advice-add
'delete-file :before #'delete-file-projectile-remove-from-cache))) (setq
gc-cons-threshold orig-gc-thresh) (message "exec time: %S" (float-time
(time-since t1))))
(let ((orig-gc-thresh gc-cons-threshold) (projectile-enabled (and
(fboundp #'projectile-mode) projectile-mode)) (t1 (current-time))) (setq
gc-cons-threshold (* 200 1024 1024)) (if projectile-enabled (progn
(remove-hook 'find-file-hook #'projectile-find-file-hook-function)
(advice-remove 'delete-file #'delete-file-projectile-remove-from-cache)))
(prog1 (apply orig-fun args) (if projectile-enabled (progn (add-hook
'find-file-hook #'projectile-find-file-hook-function) (advice-add
'delete-file :before #'delete-file-projectile-remove-from-cache))) (setq
gc-cons-threshold orig-gc-thresh) (message "exec time: %S" (float-time
(time-since t1)))))
modi/advice-org-tangle-and-export-boost(#f(compiled-function (backend
file &optional async subtreep visible-only body-only ext-plist
post-process) "Call `org-export-as' with output to a specified
file.\n\nBACKEND is either an export back-end, as returned by,
e.g.,\n`org-export-create-backend', or a symbol referring to\na registered
back-end. FILE is the name of the output file, as\na string.\n\nA non-nil
optional argument ASYNC means the process should happen\nasynchronously.
The resulting buffer will then be accessible\nthrough the
`org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY,
BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as',
which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as
its\nargument and happens asynchronously when ASYNC is non-nil. It\nhas to
return a file name, or nil. Export back-ends can use this\nto send the
output file through additional processing, e.g,\n\n (defun
org-latex-export-to-latex\n (&optional async subtreep visible-only
body-only ext-plist)\n (interactive)\n (let ((outfile
(org-export-output-file-name \".tex\" subtreep)))\n
(org-export-to-file \\='latex outfile\n async subtreep visible-only
body-only ext-plist\n #'org-latex-compile)))\n\nWhen expressed as an
anonymous function, using `lambda',\nPOST-PROCESS needs to be
quoted.\n\nThe function returns either a file name returned by
POST-PROCESS,\nor FILE." #<bytecode 0xeed6499aa2e2203>) hugo
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el..." nil :subtreep nil)
apply(modi/advice-org-tangle-and-export-boost #f(compiled-function
(backend file &optional async subtreep visible-only body-only ext-plist
post-process) "Call `org-export-as' with output to a specified
file.\n\nBACKEND is either an export back-end, as returned by,
e.g.,\n`org-export-create-backend', or a symbol referring to\na registered
back-end. FILE is the name of the output file, as\na string.\n\nA non-nil
optional argument ASYNC means the process should happen\nasynchronously.
The resulting buffer will then be accessible\nthrough the
`org-export-stack' interface.\n\nOptional arguments SUBTREEP, VISIBLE-ONLY,
BODY-ONLY and\nEXT-PLIST are similar to those used in `org-export-as',
which\nsee.\n\nOptional argument POST-PROCESS is called with FILE as
its\nargument and happens asynchronously when ASYNC is non-nil. It\nhas to
return a file name, or nil. Export back-ends can use this\nto send the
output file through additional processing, e.g,\n\n (defun
org-latex-export-to-latex\n (&optional async subtreep visible-only
body-only ext-plist)\n (interactive)\n (let ((outfile
(org-export-output-file-name \".tex\" subtreep)))\n
(org-export-to-file \\='latex outfile\n async subtreep visible-only
body-only ext-plist\n #'org-latex-compile)))\n\nWhen expressed as an
anonymous function, using `lambda',\nPOST-PROCESS needs to be
quoted.\n\nThe function returns either a file name returned by
POST-PROCESS,\nor FILE." #<bytecode 0xeed6499aa2e2203>) (hugo
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el..." nil :subtreep nil))
org-export-to-file(hugo
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/el..." nil :subtreep nil)
(prog1 (org-export-to-file 'hugo outfile async subtreep visible-only)
(org-hugo--after-export-function info outfile))
(let* ((org-use-property-inheritance
(org-hugo--selective-property-inheritance)) (info (org-combine-plists
(org-export--get-export-attributes 'hugo subtreep visible-only)
(org-export--get-buffer-attributes) (org-export-get-environment 'hugo
subtreep))) (pub-dir (org-hugo--get-pub-dir info)) (outfile
(org-export-output-file-name ".md" subtreep pub-dir))) (prog1
(org-export-to-file 'hugo outfile async subtreep visible-only)
(org-hugo--after-export-function info outfile)))
org-hugo-export-to-md(nil :subtreep nil)
(setq ret (org-hugo-export-to-md async :subtreep visible-only))
(if all-subtrees (setq ret (org-hugo-export-to-md async :subtreep
visible-only)) (let ((current-outline-path (org-get-outline-path
:with-self)) (buffer (org-hugo--get-pre-processed-buffer)))
(save-current-buffer (set-buffer buffer) (goto-char (org-find-olp
current-outline-path :this-buffer)) (setq ret (org-hugo-export-to-md async
:subtreep visible-only))) (kill-buffer buffer)))
(cond (is-commented (message "[ox-hugo] `%s' was not exported as that
subtree is..." title)) (is-excluded (message "[ox-hugo] `%s' was not
exported as it is tagged wi..." title matched-exclude-tag)) (t (if
all-subtrees (progn (setq org-hugo--subtree-count (1+
org-hugo--subtree-count)) (message "[ox-hugo] %d/ Exporting `%s' .."
org-hugo--subtree-count title)) (message "[ox-hugo] Exporting `%s' .."
title)) (if (or (or (org-entry-get nil "EXPORT_HUGO_MENU" :inherit)
(save-excursion (goto-char (point-min)) (let (...) (re-search-forward
"^#\\+hugo_menu:.*:menu" nil :noerror)))) (or (let
((page-or-taxonomy-weight ...)) (and (stringp page-or-taxonomy-weight)
(string-match-p "auto" page-or-taxonomy-weight))) (save-excursion
(goto-char (point-min)) (let (...) (re-search-forward
"^#\\+hugo_weight:.*auto" nil :noerror))))) (progn (setq
org-hugo--subtree-coord (org-hugo--get-post-subtree-coordinates subtree))))
(if all-subtrees (setq ret (org-hugo-export-to-md async :subtreep
visible-only)) (let ((current-outline-path (org-get-outline-path
:with-self)) (buffer (org-hugo--get-pre-processed-buffer)))
(save-current-buffer (set-buffer buffer) (goto-char (org-find-olp
current-outline-path :this-buffer)) (setq ret (org-hugo-export-to-md async
:subtreep visible-only))) (kill-buffer buffer)))))
(let ((title (org-element-property :title subtree))) (cond (is-commented
(message "[ox-hugo] `%s' was not exported as that subtree is..." title))
(is-excluded (message "[ox-hugo] `%s' was not exported as it is tagged
wi..." title matched-exclude-tag)) (t (if all-subtrees (progn (setq
org-hugo--subtree-count (1+ org-hugo--subtree-count)) (message "[ox-hugo]
%d/ Exporting `%s' .." org-hugo--subtree-count title)) (message "[ox-hugo]
Exporting `%s' .." title)) (if (or (or (org-entry-get nil
"EXPORT_HUGO_MENU" :inherit) (save-excursion (goto-char ...) (let ...
...))) (or (let (...) (and ... ...)) (save-excursion (goto-char ...) (let
... ...)))) (progn (setq org-hugo--subtree-coord
(org-hugo--get-post-subtree-coordinates subtree)))) (if all-subtrees (setq
ret (org-hugo-export-to-md async :subtreep visible-only)) (let
((current-outline-path (org-get-outline-path :with-self)) (buffer
(org-hugo--get-pre-processed-buffer))) (save-current-buffer (set-buffer
buffer) (goto-char (org-find-olp current-outline-path :this-buffer)) (setq
ret (org-hugo-export-to-md async :subtreep visible-only))) (kill-buffer
buffer))))))
(let* ((info (org-combine-plists (org-export--get-export-attributes 'hugo
subtree visible-only) (org-export--get-buffer-attributes)
(org-export-get-environment 'hugo subtree))) (exclude-tags (plist-get info
:exclude-tags)) (is-commented (org-element-property :commentedp subtree))
is-excluded matched-exclude-tag ret) (let ((all-tags (let
((org-use-tag-inheritance t)) (org-hugo--get-tags)))) (if all-tags (progn
(let ((--dolist-tail-- exclude-tags)) (while --dolist-tail-- (let (...) (if
... ...) (setq --dolist-tail-- ...))))))) (let ((title
(org-element-property :title subtree))) (cond (is-commented (message
"[ox-hugo] `%s' was not exported as that subtree is..." title))
(is-excluded (message "[ox-hugo] `%s' was not exported as it is tagged
wi..." title matched-exclude-tag)) (t (if all-subtrees (progn (setq
org-hugo--subtree-count (1+ org-hugo--subtree-count)) (message "[ox-hugo]
%d/ Exporting `%s' .." org-hugo--subtree-count title)) (message "[ox-hugo]
Exporting `%s' .." title)) (if (or (or (org-entry-get nil
"EXPORT_HUGO_MENU" :inherit) (save-excursion ... ...)) (or (let ... ...)
(save-excursion ... ...))) (progn (setq org-hugo--subtree-coord
(org-hugo--get-post-subtree-coordinates subtree)))) (if all-subtrees (setq
ret (org-hugo-export-to-md async :subtreep visible-only)) (let
((current-outline-path ...) (buffer ...)) (save-current-buffer (set-buffer
buffer) (goto-char ...) (setq ret ...)) (kill-buffer buffer)))))) ret)
(if subtree (let* ((info (org-combine-plists
(org-export--get-export-attributes 'hugo subtree visible-only)
(org-export--get-buffer-attributes) (org-export-get-environment 'hugo
subtree))) (exclude-tags (plist-get info :exclude-tags)) (is-commented
(org-element-property :commentedp subtree)) is-excluded matched-exclude-tag
ret) (let ((all-tags (let ((org-use-tag-inheritance t))
(org-hugo--get-tags)))) (if all-tags (progn (let ((--dolist-tail--
exclude-tags)) (while --dolist-tail-- (let ... ... ...)))))) (let ((title
(org-element-property :title subtree))) (cond (is-commented (message
"[ox-hugo] `%s' was not exported as that subtree is..." title))
(is-excluded (message "[ox-hugo] `%s' was not exported as it is tagged
wi..." title matched-exclude-tag)) (t (if all-subtrees (progn (setq
org-hugo--subtree-count ...) (message "[ox-hugo] %d/ Exporting `%s' .."
org-hugo--subtree-count title)) (message "[ox-hugo] Exporting `%s' .."
title)) (if (or (or ... ...) (or ... ...)) (progn (setq
org-hugo--subtree-coord ...))) (if all-subtrees (setq ret
(org-hugo-export-to-md async :subtreep visible-only)) (let (... ...)
(save-current-buffer ... ... ...) (kill-buffer buffer)))))) ret) (let
((valid-subtree-found (catch 'break (org-map-entries #'(lambda nil ...)
"EXPORT_FILE_NAME<>\"\"")))) (if valid-subtree-found (progn (message "Point
is not in a valid Hugo post subtree; move to..."))) valid-subtree-found))
(let ((subtree (org-hugo--get-valid-subtree))) (if subtree (let* ((info
(org-combine-plists (org-export--get-export-attributes 'hugo subtree
visible-only) (org-export--get-buffer-attributes)
(org-export-get-environment 'hugo subtree))) (exclude-tags (plist-get info
:exclude-tags)) (is-commented (org-element-property :commentedp subtree))
is-excluded matched-exclude-tag ret) (let ((all-tags (let (...)
(org-hugo--get-tags)))) (if all-tags (progn (let (...) (while
--dolist-tail-- ...))))) (let ((title (org-element-property :title
subtree))) (cond (is-commented (message "[ox-hugo] `%s' was not exported as
that subtree is..." title)) (is-excluded (message "[ox-hugo] `%s' was not
exported as it is tagged wi..." title matched-exclude-tag)) (t (if
all-subtrees (progn ... ...) (message "[ox-hugo] Exporting `%s' .." title))
(if (or ... ...) (progn ...)) (if all-subtrees (setq ret ...) (let ... ...
...))))) ret) (let ((valid-subtree-found (catch 'break (org-map-entries
#'... "EXPORT_FILE_NAME<>\"\"")))) (if valid-subtree-found (progn (message
"Point is not in a valid Hugo post subtree; move to...")))
valid-subtree-found)))
org-hugo--export-subtree-to-md(nil nil :all-subtrees)
(closure ((buffer . #<buffer *Ox-hugo Pre-processed ox-hugo-manual.org
*<2>>) (wconfig . #<window-configuration>) (ret) (f-or-b-name . "
ox-hugo-manual.org") (noerror) (visible-only) (async) (all-subtrees .
:all-subtrees) t) nil (org-hugo--export-subtree-to-md async visible-only
:all-subtrees))()
#f(compiled-function (el) #<bytecode -0x14378c494a744d72>)((headline
(:raw-value "Contributing Guide" :begin 142869 :end 143030 :pre-blank 0
:contents-begin 142892 :contents-end 143030 :robust-begin 142948
:robust-end 143028 :level 3 :priority nil :tags nil :todo-keyword nil
:todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil
:commentedp nil :post-affiliated 142869 :EXPORT_FILE_NAME
"contributing-guide" :title "Contributing Guide" :mode nil :granularity
element :cached t :parent (headline (:raw-value "Meta" :begin 140460 :end
143253 :pre-blank 0 :contents-begin 140468 :contents-end 143253
:robust-begin 140520 :robust-end 143251 :level 2 :priority nil :tags nil
:todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil
:archivedp nil :commentedp nil :post-affiliated 140460 :EXPORT_HUGO_MENU
":menu \"7.meta\"" :title "Meta" :mode nil :granularity element :cached t
:parent (headline (:raw-value "Menus" :begin 28210 :end 143253 :pre-blank 0
:contents-begin 28218 :contents-end 143253 :robust-begin 28220 :robust-end
143251 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil
:post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil
:post-affiliated 28210 :title "Menus" :mode nil :granularity element
:cached t :parent (org-data ...))))))))
org-element-cache-map(#f(compiled-function (el) #<bytecode
-0x14378c494a744d72>) :next-re "^\\*+ " :fail-re "^\\*+ " :narrow t)
org-scan-tags((closure ((buffer . #<buffer *Ox-hugo Pre-processed
ox-hugo-manual.org *<2>>) (wconfig . #<window-configuration>) (ret)
(f-or-b-name . "ox-hugo-manual.org") (noerror) (visible-only) (async)
(all-subtrees . :all-subtrees) t) nil (org-hugo--export-subtree-to-md async
visible-only :all-subtrees)) (lambda (todo tags-list level) (progn (setq
org-cached-props nil) (or (and (org-string<> (or (org-cached-entry-get nil
"EXPORT_FILE_NAME") "") ""))))) nil nil)
org-map-entries((closure ((buffer . #<buffer *Ox-hugo Pre-processed
ox-hugo-manual.org *<2>>) (wconfig . #<window-configuration>) (ret)
(f-or-b-name . "ox-hugo-manual.org") (noerror) (visible-only) (async)
(all-subtrees . :all-subtrees) t) nil (org-hugo--export-subtree-to-md async
visible-only :all-subtrees)) "EXPORT_FILE_NAME<>\"\"")
(setq ret (org-map-entries #'(lambda nil (org-hugo--export-subtree-to-md
async visible-only :all-subtrees)) "EXPORT_FILE_NAME<>\"\""))
(save-current-buffer (set-buffer buffer) (setq ret (org-map-entries
#'(lambda nil (org-hugo--export-subtree-to-md async visible-only
:all-subtrees)) "EXPORT_FILE_NAME<>\"\"")) (kill-buffer buffer))
(let ((buffer (org-hugo--get-pre-processed-buffer))) (save-current-buffer
(set-buffer buffer) (setq ret (org-map-entries #'(lambda nil
(org-hugo--export-subtree-to-md async visible-only :all-subtrees))
"EXPORT_FILE_NAME<>\"\"")) (kill-buffer buffer)))
(progn (setq org-hugo--subtree-count 0) (let ((buffer
(org-hugo--get-pre-processed-buffer))) (save-current-buffer (set-buffer
buffer) (setq ret (org-map-entries #'(lambda nil
(org-hugo--export-subtree-to-md async visible-only :all-subtrees))
"EXPORT_FILE_NAME<>\"\"")) (kill-buffer buffer))) (if ret (message
"[ox-hugo] Exported %d subtree%s from %s" org-hugo--subtree-count (if (= 1
org-hugo--subtree-count) "" "s") f-or-b-name) (message "[ox-hugo] No valid
Hugo post subtrees were found")))
(if all-subtrees (progn (setq org-hugo--subtree-count 0) (let ((buffer
(org-hugo--get-pre-processed-buffer))) (save-current-buffer (set-buffer
buffer) (setq ret (org-map-entries #'(lambda nil ...)
"EXPORT_FILE_NAME<>\"\"")) (kill-buffer buffer))) (if ret (message
"[ox-hugo] Exported %d subtree%s from %s" org-hugo--subtree-count (if (= 1
org-hugo--subtree-count) "" "s") f-or-b-name) (message "[ox-hugo] No valid
Hugo post subtrees were found"))) (setq ret (org-hugo--export-subtree-to-md
async visible-only)))
(save-excursion (if all-subtrees (progn (setq org-hugo--subtree-count 0)
(let ((buffer (org-hugo--get-pre-processed-buffer))) (save-current-buffer
(set-buffer buffer) (setq ret (org-map-entries #'...
"EXPORT_FILE_NAME<>\"\"")) (kill-buffer buffer))) (if ret (message
"[ox-hugo] Exported %d subtree%s from %s" org-hugo--subtree-count (if (= 1
org-hugo--subtree-count) "" "s") f-or-b-name) (message "[ox-hugo] No valid
Hugo post subtrees were found"))) (setq ret (org-hugo--export-subtree-to-md
async visible-only))) (if ret nil (setq ret (org-hugo--export-file-to-md
f-or-b-name async visible-only noerror))))
(save-restriction (widen) (save-excursion (if all-subtrees (progn (setq
org-hugo--subtree-count 0) (let ((buffer
(org-hugo--get-pre-processed-buffer))) (save-current-buffer (set-buffer
buffer) (setq ret (org-map-entries ... "EXPORT_FILE_NAME<>\"\""))
(kill-buffer buffer))) (if ret (message "[ox-hugo] Exported %d subtree%s
from %s" org-hugo--subtree-count (if (= 1 org-hugo--subtree-count) "" "s")
f-or-b-name) (message "[ox-hugo] No valid Hugo post subtrees were found")))
(setq ret (org-hugo--export-subtree-to-md async visible-only))) (if ret nil
(setq ret (org-hugo--export-file-to-md f-or-b-name async visible-only
noerror)))))
(progn (save-restriction (widen) (save-excursion (if all-subtrees (progn
(setq org-hugo--subtree-count 0) (let ((buffer ...)) (save-current-buffer
(set-buffer buffer) (setq ret ...) (kill-buffer buffer))) (if ret (message
"[ox-hugo] Exported %d subtree%s from %s" org-hugo--subtree-count (if ...
"" "s") f-or-b-name) (message "[ox-hugo] No valid Hugo post subtrees were
found"))) (setq ret (org-hugo--export-subtree-to-md async visible-only)))
(if ret nil (setq ret (org-hugo--export-file-to-md f-or-b-name async
visible-only noerror))))))
(unwind-protect (progn (save-restriction (widen) (save-excursion (if
all-subtrees (progn (setq org-hugo--subtree-count 0) (let (...)
(save-current-buffer ... ... ...)) (if ret (message "[ox-hugo] Exported %d
subtree%s from %s" org-hugo--subtree-count ... f-or-b-name) (message
"[ox-hugo] No valid Hugo post subtrees were found"))) (setq ret
(org-hugo--export-subtree-to-md async visible-only))) (if ret nil (setq ret
(org-hugo--export-file-to-md f-or-b-name async visible-only noerror))))))
(set-window-configuration wconfig))
(let ((wconfig (current-window-configuration))) (unwind-protect (progn
(save-restriction (widen) (save-excursion (if all-subtrees (progn (setq
org-hugo--subtree-count 0) (let ... ...) (if ret ... ...)) (setq ret
(org-hugo--export-subtree-to-md async visible-only))) (if ret nil (setq ret
(org-hugo--export-file-to-md f-or-b-name async visible-only noerror))))))
(set-window-configuration wconfig)))
(let ((f-or-b-name (if (buffer-file-name) (file-name-nondirectory
(buffer-file-name)) (buffer-name))) ret) (let ((wconfig
(current-window-configuration))) (unwind-protect (progn (save-restriction
(widen) (save-excursion (if all-subtrees (progn ... ... ...) (setq ret
...)) (if ret nil (setq ret ...))))) (set-window-configuration wconfig)))
ret)
org-hugo-export-wim-to-md(:all-subtrees nil nil)
(lambda (a _s v _b) (org-hugo-export-wim-to-md :all-subtrees a v))(nil
nil nil nil)
org-export-dispatch(nil)
funcall-interactively(org-export-dispatch nil)
call-interactively(org-export-dispatch nil nil)
command-execute(org-export-dispatch)
=====
5. But you should still see a *Warnings* buffer with content similar to [2].
[1]:
https://raw.githubusercontent.com/kaushalmodi/ox-hugo/main/doc/ox-hugo-manual.org
[2]: http://ix.io/3IA7
[-- Attachment #2: Type: text/html, Size: 30722 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-16 14:33 ` Kaushal Modi
@ 2021-12-16 15:18 ` Ihor Radchenko
2021-12-16 16:16 ` Kaushal Modi
0 siblings, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2021-12-16 15:18 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list, John Mathena
Kaushal Modi <kaushal.modi@gmail.com> writes:
> I updated Org to
>
> Org mode version 9.5 (release_9.5-364-gde022e @
> /home/kmodi/usr_local/apps/7/emacs/emacs-28/share/emacs/site-lisp/org/)
FYI, it is suspicious. You should be at 9.5.1. Maybe you forgot to make
clean; make autoloads.
> Steps to reproduce this issue (after setting those variables as suggested
> above):
>
> 1. Install ox-hugo from MELPA and require it
> 2. Download the ox-hugo-manual.org[1]
> 3. Take point to anywhere inside a subtree with :EXPROT_FILE_NAME: property
> (e.g. under the * Org Special Blocks subtree around line 3038)
> 4. C-c C-e H A (this will export all the valid subtrees in that file using
> ox-hugo)
I tried on my side and I am getting "Undefined Org macro: issue;
aborting" Does not look like Org's fault unless I miss something.
> 5. The exports abruptly stop around half way due to this error (this error
> doesn't always get thrown at the same point):
> Debugger entered--Lisp error: (error "Format specifier doesn’t match
> argument type")
> format("org-element-cache diagnostics( *temp*-467986): Rea..." #<marker
> at 26674 in *temp*-467986> "(headline (:raw-value \"Menus\" :begin 28167
> :end 14...")
> org-element--cache-process-request(... #<marker at 26674 in *temp*-467986> nil nil)
I am unable to reproduce but I know why it happened (and it is indeed
different from previous one). I just pushed a fix upstream.
Best,
Ihor
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-16 15:18 ` Ihor Radchenko
@ 2021-12-16 16:16 ` Kaushal Modi
2021-12-18 4:35 ` Ihor Radchenko
0 siblings, 1 reply; 15+ messages in thread
From: Kaushal Modi @ 2021-12-16 16:16 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-org list, John Mathena
[-- Attachment #1: Type: text/plain, Size: 4687 bytes --]
On Thu, Dec 16, 2021 at 10:16 AM Ihor Radchenko <yantar92@gmail.com> wrote:
>
> FYI, it is suspicious. You should be at 9.5.1. Maybe you forgot to make
> clean; make autoloads.
>
I actually run a wrapper script to update Org and that has all that:
=====
# cmds to update to latest commit on git main branch
# Ensure that the prefix path is correct in local.mk for
# emacs/home/$1 version.
sed -i 's|^prefix.*=.*|prefix =
/home/kmodi/usr_local/apps/7/emacs/'"$1"'/share|' local.mk
# Update the infodir if needed.
sed -i 's|^infodir.*=.*|infodir = $(prefix)/org/info|' local.mk
echo -e "\\nBuilding for emacs version: $(emacs --version | grep -E
'Emacs [0-9]+\.[0-9]+')\\n"
make cleanall
make autoloads
make compile
make doc
make install
=====
I verified that at least the git hash was latest as of then:
release_9.5-364-g*de022e*
> > Steps to reproduce this issue (after setting those variables as suggested
> > above):
> >
> > 1. Install ox-hugo from MELPA and require it
> > 2. Download the ox-hugo-manual.org[1]
> > 3. Take point to anywhere inside a subtree with :EXPROT_FILE_NAME:
> property
> > (e.g. under the * Org Special Blocks subtree around line 3038)
> > 4. C-c C-e H A (this will export all the valid subtrees in that file
> using
> > ox-hugo)
>
> I tried on my side and I am getting "Undefined Org macro: issue;
> aborting" Does not look like Org's fault unless I miss something.
>
There's a setup included in there; I forgot about that. If you don't mind
trying it again, this would download everything needed:
=====
git clone https://github.com/kaushalmodi/ox-hugo
cd ox-hugo/doc/
# open ox-hugo-manual.org from this dir
=====
and then:
=====
1. Eval <git root>/ox-hugo/ox-hugo.el
2. Take point to anywhere inside a subtree with :EXPROT_FILE_NAME: property
(e.g. under the * Org Special Blocks subtree around line 3038)
3. C-c C-e H A (this will export all the valid subtrees in that file using
ox-hugo)
=====
I am unable to reproduce but I know why it happened (and it is indeed
> different from previous one). I just pushed a fix upstream.
>
Thanks. I see this version after the update:
Org mode version 9.5 (release_9.5-366-g092e92 @
/home/kmodi/usr_local/apps/7/emacs/emacs-28/share/emacs/site-lisp/org/)
The git hash is correct (
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=092e921423f02d48778a0c5d298a211388af8090).
So not sure, why it's still saying version 9.5.
Sorry, but I am getting similar backtrace in another function now:
=====
Debugger entered--Lisp error: (error "Format specifier doesn’t match
argument type")
format("org-element-cache diagnostics( *temp*-378635): Int..." 28172
#<marker at 22334 in *temp*-378635>)
org-element--cache-process-request([28170 28171 22333 1 (headline
(:raw-value "Usage" :begin 17933 :end 22334 :pre-blank 0 :contents-begin
17942 :contents-end 22334 :robust-begin 17978 :robust-end 22332 :level 2
:priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0
:footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated
17933 :CUSTOM_ID "usage" :title "Usage" :mode nil :granularity element
:cached t :parent (headline (:raw-value "Reused Sections" :begin 17054 :end
28172 :pre-blank 0 :contents-begin 17072 :contents-end 28172 :robust-begin
17074 :robust-end 28170 :level 1 :priority nil :tags nil :todo-keyword nil
:todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil
:commentedp nil :post-affiliated 17054 :title "Reused Sections" :mode nil
:granularity element :cached t :parent (org-data (:begin 1 :contents-begin
1 :contents-end 145098 :end 145098 :robust-begin 3 :robust-end 145096
:post-blank 0 :post-affiliated 1 :path nil :mode org-data :CATEGORY nil
:cached t)) :org-element--cache-sync-key (69 . 17054)))
:org-element--cache-sync-key (67 . 17933))) 1] 145000 #<marker at 22334 in
*temp*-378635> nil nil)
org-element--cache-sync(#<buffer *temp*-378635> #<marker at 22334 in
*temp*-378635>)
org-element-at-point(#<marker at 22334 in *temp*-378635>)
org-element-cache-map(#f(compiled-function (el) #<bytecode
-0x1e6a8e662d16360>) :next-re "^\\*+ " :fail-re "^\\*+ " :narrow t)
org-scan-tags(#f(compiled-function () #<bytecode -0x16fb585600906914>) t
nil nil)
org-map-entries(#f(compiled-function () #<bytecode -0x16fb585600906914>))
=====
*Another observation: *
I see this warning when building from the latest main:
In org-element--cache-sync:
org-element.el:5935:19: Warning: assignment to free variable
‘org-element--cache-change-warning’
[-- Attachment #2: Type: text/html, Size: 6654 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-16 16:16 ` Kaushal Modi
@ 2021-12-18 4:35 ` Ihor Radchenko
2021-12-18 17:43 ` Kaushal Modi
2022-04-24 3:37 ` Difference seen in org-version strings when built from git Kaushal Modi
0 siblings, 2 replies; 15+ messages in thread
From: Ihor Radchenko @ 2021-12-18 4:35 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list, John Mathena
Kaushal Modi <kaushal.modi@gmail.com> writes:
> I actually run a wrapper script to update Org and that has all that:
> ...
> I verified that at least the git hash was latest as of then:
> release_9.5-364-g*de022e*
Odd. Though the commit number is indeed correct.
> There's a setup included in there; I forgot about that. If you don't mind
> trying it again, this would download everything needed:
Thanks! I was able to follow your steps this time.
> Sorry, but I am getting similar backtrace in another function now:
Sigh... Should be fixed now. I did not expect that arguments to cache
functions could ever be markers.
After the fix, I was able to see the warning you were talking about in
the earlier email. Your test case revealed an important omission in the
cache logic when a huge number of edits are stacked together into
asynchronous cache queue. Thanks you for providing the excellent
reproducer!
On latest main, your example file is exported without any warnings.
Also, I noticed that the large number of edits makes the cache use a lot
of memory adding load onto the Emacs garbage collector. May I know what
exactly ox-hugo does that triggers that many edits? Exporting your
example files took approximately 30sec on my system (both with and
without cache). I believe that the speed can be improved if cache is
used more optimally.
> *Another observation: *
>
> I see this warning when building from the latest main:
>
> In org-element--cache-sync:
> org-element.el:5935:19: Warning: assignment to free variable
> ‘org-element--cache-change-warning’
Thanks! Fixed.
Best,
Ihor
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-18 4:35 ` Ihor Radchenko
@ 2021-12-18 17:43 ` Kaushal Modi
2021-12-19 9:47 ` Ihor Radchenko
2022-04-24 3:37 ` Difference seen in org-version strings when built from git Kaushal Modi
1 sibling, 1 reply; 15+ messages in thread
From: Kaushal Modi @ 2021-12-18 17:43 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-org list, John Mathena
[-- Attachment #1: Type: text/plain, Size: 2893 bytes --]
On Fri, Dec 17, 2021 at 11:34 PM Ihor Radchenko <yantar92@gmail.com> wrote:
> > There's a setup included in there; I forgot about that. If you don't mind
> > trying it again, this would download everything needed:
>
> Thanks! I was able to follow your steps this time.
>
I really appreciate making this extra effort to help me out. Thanks!
> > Sorry, but I am getting similar backtrace in another function now:
>
> Sigh... Should be fixed now. I did not expect that arguments to cache
> functions could ever be markers.
>
> After the fix, I was able to see the warning you were talking about in
> the earlier email. Your test case revealed an important omission in the
> cache logic when a huge number of edits are stacked together into
> asynchronous cache queue. Thanks you for providing the excellent
> reproducer!
>
No problem! The ox-hugo tests end up indirectly testing a lot of Org
features :D
> On latest main, your example file is exported without any warnings.
>
I just verified that. Also, I did not even need to add
`(org-element-cache-reset)' in `org-hugo--get-pre-processed-buffer' after
the `(insert ..)' in the temp buffer.
Is that expected?
Also, I noticed that now the exports are much more snappier than before!
Also, I noticed that the large number of edits makes the cache use a lot
> of memory adding load onto the Emacs garbage collector. May I know what
> exactly ox-hugo does that triggers that many edits? Exporting your
> example files took approximately 30sec on my system (both with and
> without cache). I believe that the speed can be improved if cache is
> used more optimally.
>
That command exports 81 subtrees (as of now) from ox-hugo-manual.org to
independent Markdown files.
That said, I think that `org-hugo--get-pre-processed-buffer' [1] is the
performance bottleneck. It was added so that Org subtree exports can work
even if one subtree has an internal link to a different subtree in the same
file.
The pre processing logic slurps up the AST of the whole Org buffer, does
org-element-copy on all the link org-elements to point to a place outside
the exported subtree, fixes that link so that the export works, and copies
the modified link element back on the original element. And then the whole
Org temp buffer is overwritten with the modified AST.
And then.. the subtree export happens from there.
This is the only way possible as far as I know to support cross-subtree
links. Credit for this implementation goes to Folkert van der Beek[2].
Let me know if you have any suggestions to improve the performance. I think
that the org-element-copy and writing the huge AST to temp Org buffer is
keeping the GC busy (the ox-hugo-manual.org is about 3700 lines right now).
[1]:
https://github.com/kaushalmodi/ox-hugo/blob/1ea466d33f76eaf2567593fa612b82c22ef86d3d/ox-hugo.el#L4033-L4151
[2]: https://github.com/kaushalmodi/ox-hugo/pull/280
[-- Attachment #2: Type: text/html, Size: 4338 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-12-18 17:43 ` Kaushal Modi
@ 2021-12-19 9:47 ` Ihor Radchenko
0 siblings, 0 replies; 15+ messages in thread
From: Ihor Radchenko @ 2021-12-19 9:47 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list, John Mathena
Kaushal Modi <kaushal.modi@gmail.com> writes:
>> On latest main, your example file is exported without any warnings.
>>
>
> I just verified that. Also, I did not even need to add
> `(org-element-cache-reset)' in `org-hugo--get-pre-processed-buffer' after
> the `(insert ..)' in the temp buffer.
>
> Is that expected?
Depends on your Emacs version. We had to disable the warning for
Emacs<28 because some internal Emacs staff sometimes caused
false-positives. However, if you tested using Emacs 28 or later, not
seeing the warning is suspicious.
> Let me know if you have any suggestions to improve the performance. I think
> that the org-element-copy and writing the huge AST to temp Org buffer is
> keeping the GC busy (the ox-hugo-manual.org is about 3700 lines right now).
Just 145k buffer should normally cause no performance issues on Org side
(on main). Even when you parse the whole buffer into AST. Problems begin
around 5-10Mb. Yet, my 15Mb notes file is perfectly usable :D
I looked through your `org-hugo--get-pre-processed-buffer':
1. org-element-copy should not be too much of an issue, unless you have
many links. Yet, I am not sure why you need to use copy. You may as
well modify the original element directly.
2. You call org-element-map twice making Org loop over the whole AST
twice.
3. It is slightly more optimal to make your lambdas in org-element-map
return nil. org-element-map allocates an extra list collecting all
non-nil return values. If your lambda always returns nil, that list
will not have to be created.
Having said that, my local benchmarking did not show that
org-hugo--get-pre-processed-buffer is a bottleneck. M-x profiler-start
mostly revealed slowness of org-hugo--org-babel-exp-code,
org-babel-expand-noweb-references, org-babel-sha1-hash, and
org-macro-replace-all. Can you also try M-x profiler and see what is the
bottleneck in your case?
Best,
Ihor
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2021-11-07 20:22 [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] John Mathena
2021-11-08 5:59 ` Ihor Radchenko
@ 2022-01-06 11:17 ` Karl Voit
2022-01-06 12:25 ` Ihor Radchenko
1 sibling, 1 reply; 15+ messages in thread
From: Karl Voit @ 2022-01-06 11:17 UTC (permalink / raw)
To: emacs-orgmode
Hi,
* John Mathena <jmmathena@gmail.com> wrote:
>
> 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).
You're doing fine. Thanks for handing in your issue and welcome to
the list.
I do get the same warning in a different situation so I just add my
situation to this thread as well:
Every time I execute =my-title-capitalization()= from
https://github.com/novoid/dot-emacs/blob/master/config.org I get this:
#+BEGIN_EXAMPLE
Warning (emacs): Unrecognized key: _i_
Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting.
If this warning appears regularly, please report it to Org mode mailing list (M-x org-submit-bug-report).
The buffer is: README.org
Current command: nil
Backtrace:
nil
#+END_EXAMPLE
Current versions:
: Org mode version 9.5 (release_9.5-243-g048f47 @ mixed installation! /home/vk/.emacs.d/contrib/org-mode/lisp/ and /home/vk/.emacs.d/contrib/)
: GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian
Any thoughts?
--
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
> get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)]
2022-01-06 11:17 ` [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] Karl Voit
@ 2022-01-06 12:25 ` Ihor Radchenko
0 siblings, 0 replies; 15+ messages in thread
From: Ihor Radchenko @ 2022-01-06 12:25 UTC (permalink / raw)
To: Karl Voit; +Cc: emacs-orgmode
Karl Voit <devnull@Karl-Voit.at> writes:
> Every time I execute =my-title-capitalization()= from
> https://github.com/novoid/dot-emacs/blob/master/config.org I get this:
>
> #+BEGIN_EXAMPLE
> Warning (emacs): Unrecognized key: _i_
> Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting.
> ...
> Any thoughts?
Just one: this is soooo annoying :(
The problem is caused by `capitalize-word', which changes
`buffer-char-modified-tick' even when no real change is made in buffer
and `after-change-functions' are not called.
This is one of the cases when we are trying to be smart and detect
changes in buffers made with `with-silent-modifications', but Emacs
built-in functions trigger false-positive.
See https://list.orgmode.org/87ee7jdv70.fsf@localhost/T/#t
Feel free to set org-element--cache-diagnostics-modifications to nil. It
will disable the warning.
Also, if you use that title-capitalization command frequently, caching
will not be very effective. Cache is refreshed every time Org detects
inconsistency in buffer modifications (even if the detection is
false-positive, like in your case). You might try to set
`org-element--cache-silent-modification-check' to nil to speed things
up, but please read the docstring first.
Best,
Ihor
^ permalink raw reply [flat|nested] 15+ messages in thread
* Difference seen in org-version strings when built from git
2021-12-18 4:35 ` Ihor Radchenko
2021-12-18 17:43 ` Kaushal Modi
@ 2022-04-24 3:37 ` Kaushal Modi
2022-04-24 3:59 ` Ihor Radchenko
1 sibling, 1 reply; 15+ messages in thread
From: Kaushal Modi @ 2022-04-24 3:37 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-org list
On Fri, Dec 17, 2021 at 11:34 PM Ihor Radchenko <yantar92@gmail.com> wrote:
>
> Kaushal Modi <kaushal.modi@gmail.com> writes:
>
> > I actually run a wrapper script to update Org and that has all that:
> > ...
> > I verified that at least the git hash was latest as of then:
> > release_9.5-364-g*de022e*
>
> Odd. Though the commit number is indeed correct.
I figured out this mystery ..
From the org-fixup function in mk/org-fixup.el, I saw that the "git
describe .." command is used to derive the Org version with git hash.
That bakes in the last tag + number of commits seen since that tag in
the org-version returned string.
Turns out that I was simply doing a pull of the main branch and
building Org all this time. I wasn't fetching all the tags!
I saw the version as "release_9.5-364-gde022e". That meant that
"release_9.5" happened to be the last fetched tag in my local repo
back then.
Fix was simple.. I had to do "git fetch --all" before building Org.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Difference seen in org-version strings when built from git
2022-04-24 3:37 ` Difference seen in org-version strings when built from git Kaushal Modi
@ 2022-04-24 3:59 ` Ihor Radchenko
0 siblings, 0 replies; 15+ messages in thread
From: Ihor Radchenko @ 2022-04-24 3:59 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list
Kaushal Modi <kaushal.modi@gmail.com> writes:
> I saw the version as "release_9.5-364-gde022e". That meant that
> "release_9.5" happened to be the last fetched tag in my local repo
> back then.
>
> Fix was simple.. I had to do "git fetch --all" before building Org.
This is indeed something easy to overlook. Maybe we can put it somewhere
in the documentation? Though I am not sure which place would be
appropriate.
Best,
Ihor
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2022-04-24 3:58 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-07 20:22 [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] John Mathena
2021-11-08 5:59 ` Ihor Radchenko
2021-12-16 2:29 ` Kaushal Modi
2021-12-16 2:34 ` Kaushal Modi
2021-12-16 4:20 ` Ihor Radchenko
2021-12-16 14:33 ` Kaushal Modi
2021-12-16 15:18 ` Ihor Radchenko
2021-12-16 16:16 ` Kaushal Modi
2021-12-18 4:35 ` Ihor Radchenko
2021-12-18 17:43 ` Kaushal Modi
2021-12-19 9:47 ` Ihor Radchenko
2022-04-24 3:37 ` Difference seen in org-version strings when built from git Kaushal Modi
2022-04-24 3:59 ` Ihor Radchenko
2022-01-06 11:17 ` [BUG] org-element--cache gives "Unregistered buffer modifications" warning [9.5 (9.5-g859984 @ /home/john/.emacs.d/straight/build/org/)] Karl Voit
2022-01-06 12:25 ` Ihor Radchenko
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.