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: Nicolas Goaziou
Subject: Re: Can no longer org-set-link-parameters with "fuzzy" link types
Date: Tue, 06 Apr 2021 14:06:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hello,

Kyle Meyer <kyle@kyleam.com> 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]