Open notevenaperson opened 2 years ago
Hello,
This is the first I've heard of ~/.org-timestamps/
. I don't know what's going on here; probably some change in org-export
in a newer version than what I have installed.
But I don't understand that part of the code very well, could you help me out?
I don't understand it very well, either; I managed to hack something together when I was working on it, but that part of the org-export
library is not easy to follow.
ISTR that more recent Org versions might solve this problem in a better way, but I'm not sure. You might want to look into that first.
Hello, your patch export with useful anchors is just what I was looking for, and worked like I was expecting when I pasted it in, but the second time I ran it I got an error. And the third time, and the fourth time. Only deleting the cache under ~/.org-timestamps/ makes it work again, but that second time after, it stops working too. It seems that a bad cache is generated that dooms the next export to fail. Can you reproduce?
Debug trace
``` Debugger entered--Lisp error: (error "Format specifier doesn’t match argument type") format("org%07x" "My%20heading") org-export-format-reference("My%20heading") (let ((old (org-export-format-reference stored))) (and (not (assoc old cache)) stored)) (progn (let ((old (org-export-format-reference stored))) (and (not (assoc old cache)) stored))) (if stored (progn (let ((old (org-export-format-reference stored))) (and (not (assoc old cache)) stored)))) (let ((stored (cdr (assoc cell crossrefs)))) (if stored (progn (let ((old (org-export-format-reference stored))) (and (not (assoc old cache)) stored))))) (lambda (cell) (let ((stored (cdr (assoc cell crossrefs)))) (if stored (progn (let ((old ...)) (and (not ...) stored))))))((headline "My" "heading")) cl-some((lambda (cell) (let ((stored (cdr (assoc cell crossrefs)))) (if stored (progn (let ((old ...)) (and (not ...) stored)))))) ((headline "My" "heading") (other "My" "heading"))) (or (cl-some #'(lambda (cell) (let ((stored (cdr ...))) (if stored (progn (let ... ...))))) cells) (if (org-element-property :raw-value datum) (progn (unpackaged/org-export-new-title-reference datum cache))) (org-export-format-reference (org-export-new-reference cache))) (let* ((crossrefs (plist-get info :crossrefs)) (cells (org-export-search-cells datum)) (new (or (cl-some #'(lambda (cell) (let ... ...)) cells) (if (org-element-property :raw-value datum) (progn (unpackaged/org-export-new-title-reference datum cache))) (org-export-format-reference (org-export-new-reference cache)))) (reference-string new)) (let ((--dolist-tail-- cells) cell) (while --dolist-tail-- (setq cell (car --dolist-tail--)) (setq cache (cons (cons cell new) cache)) (setq --dolist-tail-- (cdr --dolist-tail--)))) (setq cache (cons (cons reference-string datum) cache)) (plist-put info :internal-references cache) reference-string) (or (car (rassq datum cache)) (let* ((crossrefs (plist-get info :crossrefs)) (cells (org-export-search-cells datum)) (new (or (cl-some #'(lambda ... ...) cells) (if (org-element-property :raw-value datum) (progn (unpackaged/org-export-new-title-reference datum cache))) (org-export-format-reference (org-export-new-reference cache)))) (reference-string new)) (let ((--dolist-tail-- cells) cell) (while --dolist-tail-- (setq cell (car --dolist-tail--)) (setq cache (cons (cons cell new) cache)) (setq --dolist-tail-- (cdr --dolist-tail--)))) (setq cache (cons (cons reference-string datum) cache)) (plist-put info :internal-references cache) reference-string)) (let ((cache (plist-get info :internal-references))) (or (car (rassq datum cache)) (let* ((crossrefs (plist-get info :crossrefs)) (cells (org-export-search-cells datum)) (new (or (cl-some #'... cells) (if (org-element-property :raw-value datum) (progn ...)) (org-export-format-reference (org-export-new-reference cache)))) (reference-string new)) (let ((--dolist-tail-- cells) cell) (while --dolist-tail-- (setq cell (car --dolist-tail--)) (setq cache (cons (cons cell new) cache)) (setq --dolist-tail-- (cdr --dolist-tail--)))) (setq cache (cons (cons reference-string datum) cache)) (plist-put info :internal-references cache) reference-string))) unpackaged/org-export-get-reference((headline (:raw-value "My heading" :begin 15 :end 140 :pre-blank 0 :contents-begin 28 :contents-end 139 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil ...) (section (:begin 28 :end 140 :contents-begin 28 :contents-end 139 :post-blank 1 :post-affiliated 28 :parent #1) (paragraph ... ...))) (:export-options nil :back-end #s(org-export-backend :name html :parent nil :transcoders (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :options (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :filters (... ... ...) :blocks nil :menu (104 "Export to HTML" ...)) :translate-alist ((bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) (paragraph . org-html-paragraph) ...) :exported-data #\nHi.\n
\n" 4 8 (:parent (paragraph ... ...))) (:export-options nil :back-end #s(org-export-backend :name html :parent nil :transcoders (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :options (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :filters (... ... ...) :blocks nil :menu (104 "Export to HTML" ...)) :translate-alist ((bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) (paragraph . org-html-paragraph) ...) :exported-data #It seems that
org-export-format-reference
reads the "useful slug" in the cache from the previous export, while it expects the normal return value oforg-export-new-reference
. But I don't understand that part of the code very well, could you help me out?