emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Kyle Meyer <kyle@kyleam.com>
Cc: Adam Sneller <adam.sneller@ms2.digital>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Can no longer org-set-link-parameters with "fuzzy" link types
Date: Tue, 06 Apr 2021 14:06:15 +0200	[thread overview]
Message-ID: <877dlfmxc8.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <874kgkcjx1.fsf@kyleam.com> (Kyle Meyer's message of "Mon, 05 Apr 2021 20:54:02 -0400")

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	other threads:[~2021-04-06 12:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  4:00 Can no longer org-set-link-parameters with "fuzzy" link types Adam Sneller
2021-04-06  0:54 ` Kyle Meyer
2021-04-06 12:06   ` Nicolas Goaziou [this message]
2021-04-06 12:20     ` Adam Sneller
2021-04-07 17:42       ` Nicolas Goaziou

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=877dlfmxc8.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=adam.sneller@ms2.digital \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    /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).