From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WFUNGLA55mRzwgAASxT56A (envelope-from ) for ; Wed, 23 Aug 2023 18:54:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eIosF7A55mS2VAAAG6o9tA (envelope-from ) for ; Wed, 23 Aug 2023 18:54:08 +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 E0A945C231 for ; Wed, 23 Aug 2023 18:54:07 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=0brg.net header.s=protonmail2 header.b=aGtdH+So; 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=reject) header.from=0brg.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692809648; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=FYFz6DmxaLBYofCzBGqTJHaWFrgVR3JNCrGgEHIVnmU=; b=mBeZ5u3joK1b+IaUYfwlfW2PlIdL/+plJbV3nx6vp5OPxLswsncaJWBh7jXlaKOGPkGH71 jEZXjpEQT0IQCwn52bvlxHSnga/QVJ4jpV/An3kBLVpi0ZXGF2DBO3JR8V8FdVlOmlJsEH sbEHpwldYurXYYl0FexH24Hx5j3f8TZwA/GhYFWd1WxwzESLgvVTSmWUxyJkTCEu7bpE3M 0eS3M/P1dd72hUrrn6LJFurGHhydnai3QrxuIEB2lQ9Wren5AFfb10W+OZ8grnHVehP0U4 YDPcW0qknEump7OLg2aIUtT8mOcBEMHyrVPN6562Q+MX8+Y447N6eepFEZ+gcw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692809648; a=rsa-sha256; cv=none; b=DFNeO8MIs+MzJZhcV5nCTv9oxn/m8T/lLYXGfa2JQKPdmbJBdaPop6yOK0HT1AKI2fAItA aAo/8mFidDSpJYwPe855thFxEerYYhu2hxJp1yH7wtZHSH+3mtSfCptoJCCqMKaoqW8p1r oQEIJPNi0yrGzLYz772FF6hVGN1PVidlxDQrm1NW/0cGOuuLOwTD4XVbyPXA2rF2omkEQ0 xzesFC8i5hyqmzPiyYWG/CQBOn919sO1n6QvbrtNIIHwqbzKFnRE96AMkubLoKtqOoHZSE 8/AJv78gP6YKRitnJp53FhMkCGx21WTgQKl8aQfLNdMdy6ZXiAc2KwHDUQiKuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=0brg.net header.s=protonmail2 header.b=aGtdH+So; 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=reject) header.from=0brg.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYr3W-0007ge-FQ; Wed, 23 Aug 2023 12:50:06 -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 1qYpMu-0000CD-0r for emacs-orgmode@gnu.org; Wed, 23 Aug 2023 11:02:00 -0400 Received: from mail-4018.proton.ch ([185.70.40.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYpMq-0000XB-75 for emacs-orgmode@gnu.org; Wed, 23 Aug 2023 11:01:59 -0400 Date: Wed, 23 Aug 2023 15:01:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0brg.net; s=protonmail2; t=1692802912; x=1693062112; bh=FYFz6DmxaLBYofCzBGqTJHaWFrgVR3JNCrGgEHIVnmU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=aGtdH+Sos0n4HSLrQHozobliyAtdlAqeCKfepO0zfg+Znq8Nr6x8IQCOBncdeIgYL M0mSfdApkBYwxGlnN0Ym0+DX3oQcZZYyIuaHjvVPuKHXYGcqiCmTXbbo3FkHzHugce Xt8iZzGphITMvcDufeMEjA5DHfpxl2Gfj1AfPBYpxExBav6WrIl5rgtNZVZKIwwGDz 6YE1x743m2Rz6yzL88RvtHEAG/OxjyOEobDrEP1bQbQrYh+U3tmpT8yXdxjhNOS9pP vNxCZ9PLbYojWaY3pPqJ94z5rA8yneOnpFvRcrY/Coorq3PpvdZ0zSI+iOU8KxMn1M IGUummw0M4AKQ== To: Ihor Radchenko From: Hraban Luyat Cc: emacs-orgmode@gnu.org Subject: Re: org-element: headline's :title is sometimes string, sometimes list Message-ID: <7ac20359-6211-4940-9204-b4c9b0b5024f@0brg.net> In-Reply-To: <87jztm6qcd.fsf@localhost> References: <87jztm6qcd.fsf@localhost> Feedback-ID: 10755604:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.18; envelope-from=hraban@0brg.net; helo=mail-4018.proton.ch 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.96 X-Spam-Score: -6.96 X-Migadu-Queue-Id: E0A945C231 X-Migadu-Scanner: mx1.migadu.com X-TUID: yhu8ojak/qis Thank you Ihor. On 8/23/23 5:49 AM, Ihor Radchenko wrote: > Hraban Luyat writes: > >> I expect: "string" everywhere. >> >> I get: >> >> Headline title from map is of type: cons >> Headline title from context is of type: string >> Headline title from at-point is of type: string >> >> Question 1: Do you know what that `cons' structure is? Where is it >> documented, how would I go about figuring this out myself? The >> org-element API documentation is daunting. > This is "anonymous element". `org-element-parse-buffer', by default, > parses down to object level: > > * Heading *bold* text > > contains bold markup, which is reflected in the parsed AST. The title > itself is called secondary value, which may contain Org markup. > > You are not getting it using `org-element-at-point' API because it does > not parse objects and simply returns a heading parsed down to element > level - :title is not parsed in details. > >> Question 2: how do I reliably get the title as a string? Properties are >> fine, I don't mind, but that weird list structure is awkward to handle. > Use `org-element-interpret-data' to convert Org AST back to plain text. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at