emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9] ol.el: add description format parameter to org-link-param


From: Ihor Radchenko
Subject: Re: [PATCH v9] ol.el: add description format parameter to org-link-parameters
Date: Sat, 30 Jul 2022 14:29:51 +0800

Hugo Heagren <hugo@heagren.com> writes:

> The test fails because of an error in `rx-to-string', which is called
> by `org-insert-link'. It was failing because I have the following
> code:
>
> ,----
> | (rx-to-string `(: string-start (submatch (or ,@all-prefixes)) ":"))
> `----
> ...
> We could just as easily do it by leaving the parameters as they are,
> and using a link 'type' which is definitely not in the list. I have
> taken this approach in the new version of the patch. I've used
> "fake-link-type", which will surely not be used, even in anyone's
> strange personal config. Admittedly it /could/ be used though (it
> would be possible to add it if someone wanted), so if you'd rather, I
> can develop something which uses a fake link type which is /by
> definition/ not in `org-link-parameters', it would just be rather a
> lot more work and the test case might subsequently be less clear to
> understand.
>
> Hope that helps -- do the tests pass for you now?

The tests are passing on my side.

However, even though you fixed the tests, you did nothing to fix the
actual problem revealed by the tests. The rx-to-string call may still
suffer from the described edge case. Why not simply shield the
rx-to-string call with (and all-prefixes ...)? I'd leave the previous
version of the tests as they had a benefit of testing this edge case.

Best,
Ihor



reply via email to

[Prev in Thread] Current Thread [Next in Thread]