diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-11 18:17:22 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-11 18:17:22 -0500 |
| commit | 08ef5eb32abdf38ff0e6ca73bf7c2e8bf1164ba2 (patch) | |
| tree | 69c3d70ed90fd7bfebb881794ba46270ed9a307f /modules/org-capture-config.el | |
| parent | 4ac82a813b988cd0151ba18ae7bf3cc967eb64ec (diff) | |
| download | dotemacs-08ef5eb32abdf38ff0e6ca73bf7c2e8bf1164ba2.tar.gz dotemacs-08ef5eb32abdf38ff0e6ca73bf7c2e8bf1164ba2.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.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el index be5b6b11a..5cd76f0af 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) |
