From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kBM1MfPFaGKfZAAAbAwnHQ (envelope-from ) for ; Wed, 27 Apr 2022 06:26:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wIg1MfPFaGIqeAAAauVa8A (envelope-from ) for ; Wed, 27 Apr 2022 06:26:27 +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 74E162D337 for ; Wed, 27 Apr 2022 06:26:27 +0200 (CEST) Received: from localhost ([::1]:39478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njZFy-00023J-1Q for larch@yhetil.org; Wed, 27 Apr 2022 00:26:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njZE6-000225-KH for emacs-orgmode@gnu.org; Wed, 27 Apr 2022 00:24:30 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:42843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njZE4-0004uQ-V6 for emacs-orgmode@gnu.org; Wed, 27 Apr 2022 00:24:30 -0400 Received: by mail-pf1-x434.google.com with SMTP id j17so570343pfi.9 for ; Tue, 26 Apr 2022 21:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=jpkzCHLya8cjmZV2iYtW8JUBpIOA7QmQT1iIcqOowho=; b=l6FrCCzVOtGDQ7lRZoWBIS3ELr5fHk6fCyctkLfmTr8HIlc6og6q6yOF/zsV+1zoWW hbQuu9opKl7GQyK89V2nOFQt6rXkVmEW5L2bG89UwFSm/LCixEdYK0cL/P6nl78hzkLO LSzWP9XshFe6BNGfeEeCfF/RfW2Az4gnINm2yhopsnmHosD0ADhZa86L9bN3vEN6zvid gYFoQV+Em2R6W4Yd+9KmCtJK4s+n1a1f4zWelrCvwi5dxCm20FHCFZJ/3iZHYmdD78JI Nnn9e+uQ1UeNcAS5gkCfZtXpfMm91GDwB9xRc3SWsdsH8pkwGBzKd2zKcPlZyjE25F52 Op1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=jpkzCHLya8cjmZV2iYtW8JUBpIOA7QmQT1iIcqOowho=; b=fwHJMbxUMy96RTpUC/YHWj2Kjqmpw+fySXeneFz/ZR7Ly7H09jn7SY29/u/ZJguaX0 zN6C0t2xGQvJfZQpwffglgBKtg8tkHMnbF1VhVxC+WNqTk5DiHKUQmpCD/9M8MY/99pY C7SBouar/Y2kqvv4Nz+MsV1hOdQd+kdQ1Lo5jSe5MFslNwTUo78iRuX3KouCBT0dG9Xy FUWLgiWmOskSk2+HHClAy8hV+5xj0O+1iArpq+6lUAPgl9l7JYywNSd/sbe8uHOMcKhC u9yx9Q3lLzpueXFBp6AKFqpVAb9e5F+YWQVHl0F0j3B0Q+I78CKWCVbmswEVLC0LUXQg Htxw== X-Gm-Message-State: AOAM532HTwoEZIIhqOD4ZZiEwteRU6UIcIukkqQCWDkbioCGtCobOTFc ybCfpUJrysBg+s3NIWWHerI= X-Google-Smtp-Source: ABdhPJwie1KdD4JLlmDI7uHNtSBOoP5EKBuNdFI+GbHgYH4sOHqsNLL1m7L4PYJt2UzMSMSznVWQQg== X-Received: by 2002:a62:6dc3:0:b0:505:895a:d38b with SMTP id i186-20020a626dc3000000b00505895ad38bmr28208360pfc.7.1651033467572; Tue, 26 Apr 2022 21:24:27 -0700 (PDT) Received: from localhost ([23.27.206.157]) by smtp.gmail.com with ESMTPSA id d9-20020a056a00198900b00508379f2121sm16998812pfl.52.2022.04.26.21.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 21:24:26 -0700 (PDT) From: Ihor Radchenko To: Ignacio Casso Subject: Re: [BUG] link abbreviations do not work inside property drawers [9.5.2 (release_9.5.2-38-g682ccd @ /home/ignacio/repos/emacs/lisp/org/)] In-Reply-To: References: <87y1zvlyj0.fsf@localhost> <878rrsut3o.fsf@localhost> <8735i0vtn7.fsf@localhost> Date: Wed, 27 Apr 2022 12:25:18 +0800 Message-ID: <87wnfbup8x.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=yantar92@gmail.com; helo=mail-pf1-x434.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=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: , Cc: emacs-orgmode@gnu.org 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=1651033587; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=jpkzCHLya8cjmZV2iYtW8JUBpIOA7QmQT1iIcqOowho=; b=JD9zF3rydfilKxSeheXFsVp1zeG4LABtPifUqiP1PrS7clZYiKIYTorx1JiNVfAs11a6/h h1UhPMwfKrl8pvs1rjtVfc6iX1WPhM8K8gjvUk7wSB6NfdNnl6W6EPT39I7hDfK9Dtsskf y+1p3qRDDpL5Qr4ldH06RrepxrlRGv3PkgbJA3Ry0kABS2ZreXZJBhVjC7eFrn43bX1bbF s0lNxkfJOjIvNFNPzugV8tjMPImvmn1qYJBZejAc9Rs4rVwKziVlH90PQGTNZO31GJAHOl e1DFtnp8bMnek2m3rYwwhBkVP2akInZX72xuH16ewBFgRpu+8W6u+Oii1Ca5Jw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651033587; a=rsa-sha256; cv=none; b=tDth1TUtBQpg1j0f1NnBiyzws8SBPK381TasMspdoNidijwpuLxTKEWv2TYWtk0Nh55NZf 6AQIjMJUXCiuKmyQq6skxEX8W6TppJT/WMI9vhFHd7AlqcpKkx09la3m6LyrhZinMqKg6w NysNVlX51s7imWHOze168L1sHaXSJXWaZT5LpcjG405KWq/m+jou2ULqh3O7S+KjHupo2g 9t5GraXxwuhZ9FBYtrTm9NzjnrdxCAGplDW4Br5kL+mHnPpRqlRJ121qwBeKYxGdfM9pgw cc/j4yyfk1LqezYQ4YtLdGhIerRP5y3vMQjP0XIEj8LC0eY6wiXDB69eLsM5xw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=l6FrCCzV; 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: -5.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=l6FrCCzV; 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: 74E162D337 X-Spam-Score: -5.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2UqcSqm6Mjmg Ignacio Casso writes: >> A better approach could be using org-link-expand-abbrev. It is an API >> function and should be forward-compatible. > > Do you mean something like this? > > (defun org-open-at-point-global () > ... > (cond ((org-in-regexp org-link-any-re) > (org-link-open-from-string > (org-link-expand-abbrev (match-string-no-properties 0)))) > ...)) > > Right now that is not enough because `org-link-expand-abbrev' only works > for links without square brackets, like "abbrev:suffix", and > `org-link-any-re' matches links with square brackets, like > "[[abbrev:suffix]]". That could be easily worked around in > `org-open-at-point-global' but maybe it would be better to change > `org-link-expand-abbrev' to work with both forms. Fair point. Then, the most future-proof way would be calling org-element-link-parser. It should take care about abbrev expansion and other edge cases. Then, you just need to use :raw-link property of the parsed link element. Best, Ihor