From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mK2DIvKWx2Yt/QAAe85BDQ:P1 (envelope-from ) for ; Thu, 22 Aug 2024 19:52:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id mK2DIvKWx2Yt/QAAe85BDQ (envelope-from ) for ; Thu, 22 Aug 2024 21:52:18 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1724356338; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=feguGPJ3oWZEjanCPtMDcVK4kCcz+uq7Ihd6QxTZ0Dc=; b=i0q9XAG4Iuf+5F7sfW1jJ39iXO3dCyVw+JJBWUh57+UFhxzefloykvb/OPyzgwwwwkDpUF FbORFMWogicLi6IbKy44n9yR7Z2yVp6VlG+s+ABDOjKzOVC3lZoKRq4FAV+JL5EALzFies IlLox9sISxyXfHGytdO848wEtTXkfmSpMTIDd2XJjLyKPsmQd30MteaOn7WTdyjTCqK+zy hJqyKGrhT4sBuBPBe12GYgzd3Gx65mmLxFfP3G/BynSLHRGarmCfQhhI8zDuh7EMg06v95 UEDZD9W/BGc5VSSPwkv5YG4t/LkfxbRuF42FWnqQC7LWkMI+UjLVD3W0JaEVnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724356338; a=rsa-sha256; cv=none; b=JPlOkJHkoQOlzIyWqIibAlVF4ewzp/kdb/9sBl63pdHW6qlB+eDrSKLg8fGFlFz0rJ87Vv x/IvM4pj4AmsH51iDVbYirBVYwGd+5+/pIEhLAHlwzS5Bm/lqerrPcVJeru7sqzXLSsiSK TfBPe9qvL2qSjgxQPl+RpbAzZMZLj5p2rLM4K4gMUnKm9jnqWDsEvWdjhX8DBdyIKDNBLg CtmbHwcj/NanhYZJovkNh+T7hH+AhNhm7CyjbSSzXBSSGmpyRcm5uTt35gqX957KIl52Nd vZf0mYwXGAw1KbwzR2myhnaxJFI0TKed8nGco1sfDTToTgsCAv/GqvM+bc//Sw== 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 3A86D245CE for ; Thu, 22 Aug 2024 21:52:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shDq5-000140-Rv; Thu, 22 Aug 2024 15:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shDq2-00013f-2Z for emacs-orgmode@gnu.org; Thu, 22 Aug 2024 15:51:18 -0400 Received: from smtprelay08.ispgateway.de ([134.119.228.106]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shDpy-00059Q-Iu for emacs-orgmode@gnu.org; Thu, 22 Aug 2024 15:51:16 -0400 Received: from [185.17.206.130] (helo=condition-alpha.com) by smtprelay08.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1shDpr-000000002da-3u0H; Thu, 22 Aug 2024 21:51:07 +0200 Message-Id: To: Ihor Radchenko , =?utf-8?Q?S=C3=A9bastien?= Gendre Cc: Org mode Subject: Re: Org-mode element API: How to extract link description In-Reply-To: <87frr2x95y.fsf@localhost> References: <87o75qyqwm.fsf@k-7.ch> <87frr2x95y.fsf@localhost> Date: Thu, 22 Aug 2024 21:51:07 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: YWxleGFuZGVyLmFkb2xmQGNvbmRpdGlvbi1hbHBoYS5jb20= Received-SPF: pass client-ip=134.119.228.106; envelope-from=alexander.adolf@condition-alpha.com; helo=smtprelay08.ispgateway.de 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: , Reply-to: Alexander Adolf From: Alexander Adolf via "General discussions about Org-mode." Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -6.98 X-Migadu-Queue-Id: 3A86D245CE X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -6.98 X-TUID: IZHpZGfP4eMS Ihor Radchenko writes: > S=C3=A9bastien Gendre writes: > >> With the Org-mode element API, when I get an element of type "link", how >> do I extract the link description=C2=A0? > [...] > Link description is considered to be link contents. > But do note that simple `org-element-at-point' does not compute > contents. It is only available in the full parse tree. From > `org-element-at-point', a practical way to retrieve description text is > using substring between :contents-begin/end. > [...] I use org-link-display-format to get the description part when I have the link as a string. Perhaps something along the lines of (org-link-display-format (buffer-substring-no-properties (org-element-contents-begin link) (org-element-contents-end link))) for your use-case? Hoping to have helped, --alexander