From: Ihor Radchenko <yantar92@gmail.com>
To: Andrew Arensburger <arensb@ooblick.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Patch: bug in template expansion in org-fill-template
Date: Sat, 30 Apr 2022 17:49:34 +0800 [thread overview]
Message-ID: <877d7699zl.fsf@localhost> (raw)
In-Reply-To: <b098cbaf-e9fe-81f6-18ec-796b410ca2a6@ooblick.com>
Andrew Arensburger <arensb@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
prev parent reply other threads:[~2022-04-30 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 4:08 Patch: bug in template expansion in org-fill-template Andrew Arensburger
2022-04-30 9:49 ` Ihor Radchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877d7699zl.fsf@localhost \
--to=yantar92@gmail.com \
--cc=arensb@ooblick.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).