Andrew Arensburger <are...@ooblick.com> writes: > There appears to be a bug in `org-fill-template' (in lisp/org-macs.el): > keys to be expanded are sorted by increasing length, so that "noweb" is > processed before "noweb-ref". As a result, if a template includes > "%noweb-ref", `org-fill-template' will expand it as "%{noweb}-ref" > rather than "%{noweb-ref}". > > As far as I can tell, this bug has existed since `org-fill-template' was > added, in e8ef16306ca56af2dceb9e2be0b57c930e9b5584 . I tried to trace it > as back as I could, to see whether there was a good reason for sorting > keys this way, but couldn't find one. > > I'm including a patch with a test to find buggy behavior, and another to > fix it.
Thanks! Applied to main as 82a09ba0a and 4a30e8cc0 with some amendments to the commit messages: Fixed "." in the commit summary and added " " between sentences; (2) Added TINYCHANGE cookies as you do not appear to have copyright assignment. Note that you may need to do copyright paperwork if you decide to contribute in future. See https://orgmode.org/worg/org-contribute.html#copyright Best, Ihor