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 YKvREz9g5WRDDgAASxT56A (envelope-from ) for ; Wed, 23 Aug 2023 03:26:23 +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 cF//Ej9g5WR8+gAAG6o9tA (envelope-from ) for ; Wed, 23 Aug 2023 03:26:23 +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 AD38348F24 for ; Wed, 23 Aug 2023 03:26:22 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=0brg.net header.s=protonmail2 header.b=N2xOwctR; 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=1692753983; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=EJtyOeZ+BauMQVRZj8DAnG0XNWpYPxDmJr9+7VTtqKE=; b=Tj3uwrxXlFFGESpu5SbQtav7jFEgWW9rBU7sDAUz4Dj8hO75IY+CawjuxhG7Zg6J0y7wFb ESUXK9zpqRI1zCKZZE5GjBAJuefkkS6yuoaM/vFwO4LLIC9mZQ71g5F1tGoAox/6AEq7XL WIQHsfA5h7fCmHNMPEW4eBzje1j85gOeRrzXSPaP7uhKYaEORpo9VmUy1d0QICBhynCpWS MhXqJk7m/03C52SBO8fp4vZRmyiIh+lKvdrFv7SDoDU+6Jr3gy7FfPYe4NFAVHQ0S6kei5 G1CK60CG1t2ZnNXVzHFVbtiWrryyJgxKu3ut1Oa2YRxzLXJTecwPhEX0jSfXPg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692753983; a=rsa-sha256; cv=none; b=FNjWTuBDmD3IRJhCjahLU8TFZwb7S7MpBymIEG8OGvy6sKjI+E1C9TI/HVbtf2Qcc5lvPD 3eVYUgZbkftouPdaD/tIsqxmJnA74J4VOHNqS6cpSlaqB5eZKG3Oztva2LYJGaJvjzV4K/ kOjabfL1SsmWdpvesbAZF7T8vsFpceToJWdKB6Zwkz7cp8pkb+7sPqaJ8QesXvvtyoMwBz fOFj6OzZpt77i28MtFy33ZZxpTYSALrYQr+2OcoOZPT28oTVe43UM2RRRsHfKo20vuGrEW P2y9k8WVnxNN6y+mvpBAVNkom1dJwt/LgAMYa6+CBUy/ZFlsXmHyKMZJsewsKg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=0brg.net header.s=protonmail2 header.b=N2xOwctR; 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 1qYccl-0006sl-Rd; Tue, 22 Aug 2023 21:25:31 -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 1qYcci-0006s5-A6 for emacs-orgmode@gnu.org; Tue, 22 Aug 2023 21:25:29 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYccd-0001wC-36 for emacs-orgmode@gnu.org; Tue, 22 Aug 2023 21:25:27 -0400 Date: Wed, 23 Aug 2023 01:25:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0brg.net; s=protonmail2; t=1692753912; x=1693013112; bh=EJtyOeZ+BauMQVRZj8DAnG0XNWpYPxDmJr9+7VTtqKE=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=N2xOwctRs7uB01lXmb7L7Rmnv1Wo2AfbEskdA1mlsjONe94Htfpa0DI83ODq0i1hv 38vv8KfMciEhx5CwFv0Z8rGB12I6amgULjoZZtMuMpCrqlRqU0Zev9CjhDQ+gF4CMZ UI4+qA2hUulh/a3DF1L9OL22ZQpEfqO7adrEYvpE+hwZGLGH57WUkubXRxebueyrEc c6ByYLqdYDxl7qbkFoDkrwlge3MiQvv+T9+NCHrnzmJ8eyGkw6LmFiDvxHqif0IDbL 7bp8257fdkKibQWtGDJGdYpkNdafBBpajhFTRpk1fFdgPMXSqOu63yrKIZu+3HRtsc 7559uM8KF4VIg== To: emacs-orgmode@gnu.org From: Hraban Luyat Subject: org-element: headline's :title is sometimes string, sometimes list Message-ID: 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.43.17; envelope-from=hraban@0brg.net; helo=mail-4317.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.87 X-Spam-Score: -6.87 X-Migadu-Queue-Id: AD38348F24 X-Migadu-Scanner: mx1.migadu.com X-TUID: fTeRKISTY5Hh Hi all. I'll let the code speak: (with-temp-buffer (org-mode) (insert "* Hello") (cl-flet ((say-type (prefix hl) (message "Headline title from %s is of type: %s" prefix (type-of (org-element-property :title hl))))) (org-element-map (org-element-parse-buffer) 'headline (lambda (hl) (say-type "map" hl))) (goto-char (point-min)) (say-type "context" (org-element-context)) (say-type "at-point" (org-element-at-point)))) 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=20 documented, how would I go about figuring this out myself? The=20 org-element API documentation is daunting. Question 2: how do I reliably get the title as a string? Properties are=20 fine, I don't mind, but that weird list structure is awkward to handle. Thank you Hraban