emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Can no longer org-set-link-parameters with "fuzzy" link types


From: Adam Sneller
Subject: Re: Can no longer org-set-link-parameters with "fuzzy" link types
Date: Tue, 6 Apr 2021 13:20:06 +0100

Thank you both for the replies!

Nicholas - can you recommend how to best implement this with font-lock-add-keywords?

Best regards,

-Adam

> On 6 Apr 2021, at 13:06, Nicolas Goaziou wrote:
>
> Hello,
>
> Kyle Meyer writes:
>
>> [ Sorry for the slow response. ]
>>
>> Adam Sneller writes:
>>
>>> I have a function that searches for broken fuzzy links in org-mode and
>>> applies org-warning face to anything it finds:
>>>
>>> (org-link-set-parameters
>>> "fuzzy"
>>> :face (lambda (path)
>>> (let ((org-link-search-inhibit-query t))
>>> (if (condition-case nil
>>> (save-excursion
>>> (save-match-data
>>> (org-link-search path (point) t)))
>>> (error nil))
>>> 'org-link 'org-warning))))
>>>
>>> In 9.4.4 this patch breaks this:
>>>
>>> https://code.orgmode.org/bzg/org-mode/commit/8c4e270df280a08b7e61295712c86246088146ba
>>>
>>> Is there some other recommended way to get this done as of 9.4.4?
>>
>> I don't know enough about the change to say whether this is recommended,
>> but it looks like you could get the behavior you're after with something
>> like
>>
>> (add-to-list 'org-link-parameters
>> '("fuzzy" :face (lambda (path) ...)))
>
> Link parameters are meant to be used with "scheme:path" links. However,
> we forbid internal link types, as writing [[fuzzy:whatever]] would be
> confusing for Org. As a consequence, link parameters are not meant to
> control internal links.
>
> We might need a different variable specific to internal links, but in
> the current case, using `font-lock-add-keywords' should be sufficient.
>
> Regards,
> --
> Nicolas Goaziou

reply via email to

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