diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-11 17:17:53 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-11 17:17:53 -0500 |
| commit | ec62f5b5091ef928895b40544e8265bc828386f5 (patch) | |
| tree | e49fbf668ea984cd037a2e4d6adffd368c20949b /modules/lorem-optimum.el | |
| parent | 6d6b59832ee433be56625ca270e92a1000771f22 (diff) | |
| download | dotemacs-ec62f5b5091ef928895b40544e8265bc828386f5.tar.gz dotemacs-ec62f5b5091ef928895b40544e8265bc828386f5.zip | |
perf(org-capture): cache file+headline target markers
A task capture took 15-20 seconds: Org resolves a `(file+headline FILE "Headline")' target by opening the file, widening, and regex-scanning from the top for the headline, and the inbox template captures to `(file+headline inbox-file "Inbox")' over and over. An `:around' advice on `org-capture-set-target-location' caches a marker per resolved file/headline. On the next capture it validates the marker (still live, still in an Org buffer, still at a heading, headline text still matches) and jumps straight there. On any mismatch it falls back to the normal scan/create and refreshes the cache. `M-x cj/org-capture-clear-target-cache' resets it. Tests cover the cache hit, marker invalidation after the headline text changes, and creating a missing headline.
Diffstat (limited to 'modules/lorem-optimum.el')
0 files changed, 0 insertions, 0 deletions
