[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: inconsistent escaping of coderef regexp
From: |
Nicolas Goaziou |
Subject: |
Re: Bug: inconsistent escaping of coderef regexp |
Date: |
Thu, 01 Apr 2021 17:45:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hello,
Tom Gillespie <tgbugs@gmail.com> writes:
> It is not possible to strip coderefs when tangling and also search for
> those coderefs using org-link-search. This is because org-link-search
> uses org-src-coderef-regexp which calls regexp-quote on the regexp
> string while org-babel-tangle-single-block does not and uses the
> regexp string directly without quoting it. I'm not sure about the best
> way to fix this. It seems to me that the call to regexp-quote should
> be removed but I'm not entirely sure of the consequences of doing
> that. Thoughts?
This would be wrong. A format string is not a regexp, and therefore
needs to be quoted. E.g., one might want to use "/* %s */".
`org-babel-tangle-single-block' should make use of
`org-src-coderef-regexp' and, possibly, `org-src-coderef-format'.
> PS While on the topic of coderefs, let me drop a note that is a
> preview of some of the issues I have encountered while working on a
> full formal grammar for org. Having the -l switch control this is an
> awful design that induces more complexity into the org-mode grammar
> than nearly any other feature. Source block switches are completely
> inconsistent with the rest of org and completely undiscoverable. I had
> no idea they even existed until I was trying to figure out which
> header argument could be used to set the coderef regexp. The -l option
> and switches in general need to have their behavior implemented as
> part of the standard header arguments like everything else so that
> users can migrate away from switches with an eye toward removing them
> entirely.
Switches predate Babel and its header arguments. Also, they are
orthogonal to Babel. I don't know what a sound design would be here,
tho.
Regards,
--
Nicolas Goaziou
- Re: Bug: inconsistent escaping of coderef regexp,
Nicolas Goaziou <=
- Re: Bug: inconsistent escaping of coderef regexp, Timothy, 2021/04/01
- Re: Bug: inconsistent escaping of coderef regexp, Tom Gillespie, 2021/04/04
- Re: Bug: inconsistent escaping of coderef regexp, Nicolas Goaziou, 2021/04/04
- Re: Bug: inconsistent escaping of coderef regexp, Tom Gillespie, 2021/04/05
- Re: Bug: inconsistent escaping of coderef regexp, Tom Gillespie, 2021/04/05
- Re: Bug: inconsistent escaping of coderef regexp, Nicolas Goaziou, 2021/04/07
- Re: Bug: inconsistent escaping of coderef regexp, Tom Gillespie, 2021/04/07
- Re: Bug: inconsistent escaping of coderef regexp, Nicolas Goaziou, 2021/04/09