aboutsummaryrefslogtreecommitdiff
path: root/modules/org-capture-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 18:17:22 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 18:17:22 -0500
commit8d096854f015025751fcbe80e531577ea0b70093 (patch)
treee2b479248f5e0611bec25afdabf684645cf575c0 /modules/org-capture-config.el
parentf56c8f6dd329f44ba3df5c807e3efaaeaf01c95f (diff)
downloaddotemacs-8d096854f015025751fcbe80e531577ea0b70093.tar.gz
dotemacs-8d096854f015025751fcbe80e531577ea0b70093.zip
fix(org-capture): single-source the file+headline cache key
`cj/org-capture--goto-file-headline' stored the marker under `(list (expand-file-name (buffer-file-name)) headline)' while the lookup helper `cj/org-capture--file-headline-cache-key' uses `(list (org-capture-expand-file path) headline)'. They agree for plain absolute paths, but a symlinked target (`expand-file-name' doesn't follow symlinks, `find-file' canonicalizes the buffer name) or a capture path that needs `org-capture-expand-file's special handling would make the put-key and get-key diverge, so the cache would silently never hit. Production now goes through the helper too, so the key is built one way.
Diffstat (limited to 'modules/org-capture-config.el')
-rw-r--r--modules/org-capture-config.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el
index be5b6b11..5cd76f0a 100644
--- a/modules/org-capture-config.el
+++ b/modules/org-capture-config.el
@@ -76,7 +76,7 @@ re-scanning large target files after the first successful lookup."
(org-mode))
(org-capture-put-target-region-and-position)
(widen)
- (let* ((key (list (expand-file-name (buffer-file-name)) headline))
+ (let* ((key (cj/org-capture--file-headline-cache-key path headline))
(marker (gethash key cj/org-capture--file-headline-target-cache)))
(if (cj/org-capture--headline-marker-valid-p marker headline)
(goto-char marker)