From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oOsuDlD8FmGZLwEAgWs5BA (envelope-from ) for ; Sat, 14 Aug 2021 01:12:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OKS1CVD8FmEECQAAbx9fmQ (envelope-from ) for ; Fri, 13 Aug 2021 23:12:16 +0000 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 AB0EE2874C for ; Sat, 14 Aug 2021 01:12:15 +0200 (CEST) Received: from localhost ([::1]:32956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEgLV-0000nb-RW for larch@yhetil.org; Fri, 13 Aug 2021 19:12:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEgL6-0000nN-Gl for emacs-orgmode@gnu.org; Fri, 13 Aug 2021 19:11:48 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:41480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEgL5-0007Z5-1E for emacs-orgmode@gnu.org; Fri, 13 Aug 2021 19:11:48 -0400 Received: by mail-pl1-x630.google.com with SMTP id e15so13936657plh.8 for ; Fri, 13 Aug 2021 16:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=it9R1f6DqG7pu/5p0slWVSX105NdEhyd7qKJ8Jali4k=; b=thKnd69FueLlUoaEJ51Is9vc/iQ6SeXvxenIyg7PT05K+pCjBFToo2Fv7Am54O6Xtn piTcSde7BbdtndTztaNSdbEv0QRjs+wVImY4+UK7oiUTUK2vRFU+O64XuND2/Pykoha0 8JR6sFKfgUSseqRL8MsGeECGIFMmgSz8ZkSZmFA4nnBYcReYpLpM1///8zdJrbsiK0Cq +EhfGs9GaXCrddSxcVbIq3r90alb/sIq4Jp0Hdyb9jiUY25vBXGDPLuuVyZ74WRPNVdc CV2aixlkqH0WTgWor8detaQQep05svqVEPNorUZQ7jJt6ECwuj1W/Nt1uehX9j9WuhAQ Tbbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=it9R1f6DqG7pu/5p0slWVSX105NdEhyd7qKJ8Jali4k=; b=gioPSIGlwb17BhcJb1Mac/6nPqNHik9uPXmApV2TO1c5mrEp8Du9jK4/fvC7dBRH6M 10e6CBGKXDGYxLA/+gMX/Qc3PWyRlyAoixfSCALLXjNcdd6h3U8qL7KwQhLQv0/Z0aRj tBmHZmaGfBtU7JRP2+CLybjaX0ehHP00SS1t9SjKLGhzI6gsQMCeGBgVv37ggOT0nBMu ziB04AVS+T5LQvw1mpNp7UbQC2wCIGr8H8tjAIhvU2zbzTTaDkcavUgykkRzhUZl7nnK 8Ir3U8pOmY+lRF34PxuQ/9DW5ILVoiyNI/WejiNPnr9dePb9/2o9nN58EoOj+3Q90iem 8lRg== X-Gm-Message-State: AOAM5311fsFxvmQq5fastdEr7yPuQdKpUj2VuUiH22g29xmjo1kunfof Uw2VvVxhDAtFlsr55+L38ZMTl2rJbidOXw== X-Google-Smtp-Source: ABdhPJzvmtGDoYrOKUx4JiQ1A54ILkL3XhefJ9FmguD2XxM5UkF+/gFR8AB1MCGDQPeoLd7uJz3VbQ== X-Received: by 2002:a63:6705:: with SMTP id b5mr4416252pgc.69.1628896305477; Fri, 13 Aug 2021 16:11:45 -0700 (PDT) Received: from r1 ([190.239.232.245]) by smtp.gmail.com with ESMTPSA id y67sm3458307pfg.218.2021.08.13.16.11.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 16:11:45 -0700 (PDT) From: Rodrigo Morales To: emacs-orgmode@gnu.org Subject: [Q] How to programmatically get the description of a link? Date: Fri, 13 Aug 2021 18:10:47 -0500 Message-ID: <87eeax54aw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-pl1-x630.google.com X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 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, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628896335; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=it9R1f6DqG7pu/5p0slWVSX105NdEhyd7qKJ8Jali4k=; b=Ng+QigEzr7RHzR+mLDNDsB4v35ou/9ePk0KWlEAUZ4WviW8pX0Zf+XQwTjcs9jNEY6kXrv N3T2ObMrFtKGy1wAWLZSsU94qpqv+Q5mN9s2A8ZNzNohz7aO1QSPUu2kY+m3Vc1ifAAjM4 OXWuaUsAJX7ni70rllqJy2YUOYRD9ky7gd5/Lkz9xdXqX5AxjhjGDhP2g/4X5Ar7tmlF5a OySrYC8CSLidQJsGa5LcbT4vsCrDa4nxgMpGGt3upJR7OzKaqbKPxCIA6ynAIgXdByw3t/ aI5WOTg9ViORv96yYbnc3pxwM8d5jYXD9vJFqnVnUiPIyP0GpgoRfcJ2S3dfag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628896335; a=rsa-sha256; cv=none; b=myihYQCAAo006KNq8qPDouDqmNCE8sVncywz/6hp+NrTiVC46zjcPHrpbsHiBCd+p6LxBR LmCHO9jVqH45pXLTVb49B1dxtTkyBgLoDmJxmXPw+/4DwHA/yvy2XB4uyZIOjm+SFU1PVz 4p/IsDIn0sqcmTn7ErnC8Za/MjA4ZTpsJ54OrolGV7RA7FwcoO1uGNAUIoJJGReP3RjNDo AtMomr4Wzrx0/22c+hBGcAc9LIExTu+NMQi+lamObb1odHKIbbq3IY1v6/wKkH9czVbADs vbDq0wlc/+HwvFL+OiART9oaVHOTpCFSrMFTUiPkuBewxaPHUcfWUYT5rx4zhg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=thKnd69F; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=thKnd69F; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: AB0EE2874C X-Spam-Score: -2.11 X-Migadu-Scanner: scn1.migadu.com X-TUID: YpigrZAh9dYj * The question Let's say I have the following link #+BEGIN_SRC org This is a sentence [[foo][bar]]. This is another sentence. #+END_SRC How to programmatically get the description of the link (i.e. =bar=)? * Additional information I've tried using =org-element-context=. The following sexp was executed when the cursor was on the link which was presented above. #+BEGIN_SRC text ELISP> (with-current-buffer "main.org" (org-element-context)) #+END_SRC #+BEGIN_SRC text (link (:type "fuzzy" :path "foo" :format bracket :raw-link "foo" :application nil :search-option nil :begin 1 :end 15 :contents-begin 8 :contents-end 13 :post-blank 0 :parent (paragraph (:begin 1 :end 16 :contents-begin 1 :contents-end 16 :post-blank 0 :post-affiliated 1 :parent nil)))) #+END_SRC and =org-element-at-point=. The following sexp was executed when the cursor was on the link which was presented above. #+BEGIN_SRC text ELISP> (with-current-buffer "main.org" (org-element-at-point)) #+END_SRC #+BEGIN_SRC text (paragraph (:begin 1 :end 16 :contents-begin 1 :contents-end 16 :post-blank 0 :post-affiliated 1 :parent nil)) #+END_SRC but neither of those get the description of the link as metadata.