Sacha Chua <sa...@sachachua.com> writes:

> I noticed that org-refile-get-targets seems to recalculate the first
> part of the outline path for each heading, which makes it slow on large
> files when org-refile-use-outline-path is set to 'title. The following
> patch let-binds that part to a variable that can be put outside the loop
> for the headings, making it faster in the case where refile targets
> include a few files with lots of headings. Does it make sense? I was
> wondering if I was missing some important reason for it to be inside
> that loop.

Makes sense.

> It feels like a pretty small change (just adding a let), but I 
> have copyright assignment papers on file at the FSF just in case.

Agree. Yet, the tests are failing :)

1 unexpected results:
   FAILED  test-org/refile-get-targets  ((should (equal '("H1\\/foo") 
(org-test-with-temp-text "* H1/foo" (let (... ...) (mapcar ... ...))))) :form 
(equal ("H1\\/foo") ("H1")) :value nil :explanation (list-elt 0 
(arrays-of-different-length 7 2 "H1\\/foo" "H1" first-mismatch-at 2)))

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to