From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ID2aDfUxYWI/JgEAbAwnHQ (envelope-from ) for ; Thu, 21 Apr 2022 12:29:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +E+RDfUxYWJ6dAAA9RJhRA (envelope-from ) for ; Thu, 21 Apr 2022 12:29:09 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B25FF2D30C for ; Thu, 21 Apr 2022 12:29:08 +0200 (CEST) Received: from localhost ([::1]:44136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhU3e-0000Gs-H6 for larch@yhetil.org; Thu, 21 Apr 2022 06:29:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhU03-0007ze-Mt for emacs-orgmode@gnu.org; Thu, 21 Apr 2022 06:25:27 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:41858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhU01-0001Tg-IV for emacs-orgmode@gnu.org; Thu, 21 Apr 2022 06:25:23 -0400 Received: by mail-lf1-x12a.google.com with SMTP id h3so3158004lfu.8 for ; Thu, 21 Apr 2022 03:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=81M/hir7sP+MotPIwTlwPjIlrD5GlKr4FT81QN1O07I=; b=TqkhKOrX7pAYZSDhWSrhPrVJgOdDLwL14ap5uX133JF1XE5Zpcu0FQxrGGPkOspha2 Z9pvQmVJDGt/RHa0DtMkQ5s99ZCUiO6idfYgPDXfeVKJVfN42ZFWCu/12RkFBMQu3J0H ZGA+iR+OYeUhC5YqAhJPuusixUj+b4ywU3aWXsb7Dwrdo6xYfw5m3J+yog0eTlwYbMiz Xqk15BR6VKKHqRAHhX/hBeIVi/b3qr+AmZeRRwSRscj/LQCVET9ewNiHdCE8ejMZjpwC t4l2J0Ev4utQ4YKt2mzsL81QBqwmEqEKePH3gV3utE//u3U737b4k2SPsc9k2p5YwZlf iWaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=81M/hir7sP+MotPIwTlwPjIlrD5GlKr4FT81QN1O07I=; b=J7qRHKdktX7t0br1f92X00CAuytzbnlMVT+JCjoNDkS5PQog9QAFy3kfyolsnSDVkq CGTzu4BAB879ISNRULaZhA6wvkRjDBUzcH0nZklKJsmAau3RTqHlGJ3xoT73jwEeYpVJ NAfnzmWn0TCnUs5hlONFH6kxLRVt9/KiFyn5rQ8OcI8ozomN/yhEzejb+KAms2uc/shQ 7TzYUYxhJvF93BZ6224xFM3A54sM4s6PKbsG5snFkhrO2kY2FUCIiTlZwgiwAJikDYQ9 x9vHwNDftYyEU9RVAWPhhbYPDUlmqRnYNrW29eFeIcVIz8WABjtcrRWHr/beGHTr/TTv 7pTQ== X-Gm-Message-State: AOAM530ndw6Yww0PRhpHh/HqNaXfdXX1gXhH+SkdzAMLdJGQv7T43S84 56cV0mNiLeesaOjxFtafcxYsuGC2In2fkpNZGCYLRxSyhEQ= X-Google-Smtp-Source: ABdhPJzKTnTudYmYMBUI6JWtrGrdX58oNXGK2mi56N+sXccWBN8uIxOdQwl/5VJWOBaV5jZzJP1Wp4hrL8KmfSouotg= X-Received: by 2002:a05:6512:39c1:b0:44a:e25d:47fd with SMTP id k1-20020a05651239c100b0044ae25d47fdmr17767711lfu.580.1650536716481; Thu, 21 Apr 2022 03:25:16 -0700 (PDT) MIME-Version: 1.0 References: <87tuan3sgj.fsf@localhost> In-Reply-To: From: tony aldon Date: Thu, 21 Apr 2022 12:25:05 +0200 Message-ID: Subject: Re: [PATCH] ol: Fix org-link-search To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000acb8e505dd27869d" Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=tony.aldon.adm@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650536948; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=81M/hir7sP+MotPIwTlwPjIlrD5GlKr4FT81QN1O07I=; b=NHjXlPk5Pqxe2Q38LDqqJq4lTk7xliZHrHTsjrPVtbPONqrdFCswoICj+pKiarUH00tI7U GKTdB2AeUVGUBWgKDKCxkuQY/QWI80BozP08Ljc0YcQWD/8yTNQ4jzGG9CJwDMH6MwBkvH oGoe2UOOQZ6lk1I+ecQOxE0uga7EnBfzDyBaJ9OeNtB9YVE1x1OLUd6xqwfaJ+/l2AluEQ 9+uPUnOy0PzO7FZsDqIu0ioawu5NuuMZP4zv+nY1ufdTkQVMAc7nr9D4LD3ikCOH8RheEs /9JTfQUtc6ET+bbnukCbB2DACnazr+icf1s4HvQWZ3lPWqyir73wPuFTGR37zg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650536948; a=rsa-sha256; cv=none; b=rJmbjKsV6/9imoK1HaYXPqpCL+p3HsYNx36kUac7Mqqliz8GCJOa9WV/OU2aHSqGjBC8wy bptF5pzALTn1Nh+8KEKumEB0DdSRnm5VO8wJC+gJPz+K1yj0GEOBhKZzq6DCSPni5CG5LT 3KB5lec9LhoonQh+n0jsfqS2sUAgq4PIRxR3mEul/9LwhyAG2ttOFqKnNIlTcII3p0aysc iqli+tAo0i2bb3X8anbQgj8KnzZmtTRNj76rhDPbGuhLNnWA4rWf5O6VjiP76RcSdxDDwR GFwXP81SzXUUekSzFgI4Q3S/net7s+yaOHlsic3VDEHDl9kdswyxT7TZXe/+RQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TqkhKOrX; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.54 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TqkhKOrX; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B25FF2D30C X-Spam-Score: -2.54 X-Migadu-Scanner: scn1.migadu.com X-TUID: il6I4YM2Kgrb --000000000000acb8e505dd27869d Content-Type: text/plain; charset="UTF-8" On Thu, Apr 21, 2022 at 12:23 PM tony aldon 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 wrote: > >> tony aldon 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 >> > --000000000000acb8e505dd27869d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Apr 21, 2022 at 12:23 PM tony aldon <tony.aldon.adm@gmail.com> wrot= e:
You're right I was effectively missing affiliated keywords and so m= y
patch is wrong.

Thank you for your quick feedback and insight.<= br>
Have a nice day,
Tony Aldon

On Thu, Apr 21, 2022 at 7:39 AM Ih= or Radchenko <ya= ntar92@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`.
> ...
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(name (org-element-property :name element)))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(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
--000000000000acb8e505dd27869d--