emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tony aldon <tony.aldon.adm@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ol: Fix org-link-search
Date: Thu, 21 Apr 2022 12:25:05 +0200	[thread overview]
Message-ID: <CACWitSCAgB=W7m3V3K3hG5+X-AbU0R=T2vncY6vaUvg-Dc=5tQ@mail.gmail.com> (raw)
In-Reply-To: <CACWitSA6eYp68L3u3HFxA-U-EE=s9ZDQxKaHmaFPdL+UxXVEOw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

On Thu, Apr 21, 2022 at 12:23 PM tony aldon <tony.aldon.adm@gmail.com>
wrote:

> You're right I was effectively missing affiliated keywords and so my
> patch is wrong.
>
> Thank you for your quick feedback and insight.
>
> Have a nice day,
> Tony Aldon
>
> On Thu, Apr 21, 2022 at 7:39 AM Ihor Radchenko <yantar92@gmail.com> wrote:
>
>> tony aldon <tony.aldon.adm@gmail.com> writes:
>>
>> > If I'm not wrong, name defined after #+NAME: should be match first
>> > before trying a fuzzy search in the function `org-link-search`.
>> > ...
>> > -                     (name (org-element-property :name element)))
>> > +                     (name (org-element-property :value element)))
>>
>> I think you are missing something.
>>
>> A standaline
>>
>> #+name: some name
>>
>> is a keyword, not an element name, but a generic keyword element.
>>
>> Named elements are the elements with affiliated keywords (not ordinary
>> keywords):
>>
>> #+name: some other name
>> Some element that can have affiliated keywords. It may be a paragraph,
>> like here or e.g. source block. Link search should not try to search
>> standalone keywords and hence it is sufficient to check for :name
>> element property. :value will miss e.g. named source blocks.
>>
>> Try running (org-element-at-point) on the first and second #+name in org
>> buffer.
>>
>> Best,
>> Ihor
>>
>

[-- Attachment #2: Type: text/html, Size: 2119 bytes --]

  parent reply	other threads:[~2022-04-21 10:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 16:10 tony aldon
2022-04-21  5:39 ` Ihor Radchenko
     [not found]   ` <CACWitSA6eYp68L3u3HFxA-U-EE=s9ZDQxKaHmaFPdL+UxXVEOw@mail.gmail.com>
2022-04-21 10:25     ` tony aldon [this message]
2022-04-21 13:00 ` Ihor Radchenko

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='CACWitSCAgB=W7m3V3K3hG5+X-AbU0R=T2vncY6vaUvg-Dc=5tQ@mail.gmail.com' \
    --to=tony.aldon.adm@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] ol: Fix org-link-search' \
    /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

Code repositories for project(s) associated with this 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).