From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 gL61AdPOEmNM/QAAbAwnHQ (envelope-from ) for ; Sat, 03 Sep 2022 05:49:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 7pPbANPOEmMxKQAAG6o9tA (envelope-from ) for ; Sat, 03 Sep 2022 05:49:39 +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 BDCEF3A8C6 for ; Sat, 3 Sep 2022 05:49:37 +0200 (CEST) Received: from localhost ([::1]:39726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUKA4-0003lX-FZ for larch@yhetil.org; Fri, 02 Sep 2022 23:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUK9C-0003lG-9d for emacs-orgmode@gnu.org; Fri, 02 Sep 2022 23:48:42 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:39626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUK9A-0001NC-Cf for emacs-orgmode@gnu.org; Fri, 02 Sep 2022 23:48:41 -0400 Received: by mail-pf1-x434.google.com with SMTP id t129so3671416pfb.6 for ; Fri, 02 Sep 2022 20:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=hFqYlBAnj6nnmPqXwK255pi+CYicOqWXBVms0qoN8fk=; b=Z7J+QwKk89z7zTbftqTu5Oj7lYUUINrJy5Fjyy718BO5igy+cMZoSu5pB7BolSgdu2 cCsoGglWVew+hQ+otYnRXs3c5w6wCnQsmlf6Mshbd7Ybsj9qnh9Ixzoz329Uk68ROSFl 2oqsmW9l5gDRN8Hv4YDlhkL/sOXkajI/VgniwGQjGKS0u8xfaNse2iEUmbCEBysF5M9e vE9Byislpfel0Wz7C1720d68xugmRLiE3o1GD/J4AoeSz/JNh1JdyogHyio3bwjKr2et eK1ogMXiiwxumDOHHWUNKjRK8koo1nVtHAhh+ofxlClmrnY1Co9gWDIvIAV2bwA7JSKO tdYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=hFqYlBAnj6nnmPqXwK255pi+CYicOqWXBVms0qoN8fk=; b=lxIJL7kuiGdMdLznlErcAjxQlv3LPfu9q1ko5Dh/dofbmJ51jq5vtc0HGwOmdS7XXM PUyCMi7W2mBWSM5O6ljKaJuwIObkZJZJjmStUF2/pQrgVuroOSXOH+OoZ3ldjviXLpiu 5UUZk8Its5aDLg3Y+jtwakG9VvdAzRqigQKIDkJMoDRjFKTyBYBMFK55d2gffKla81O3 A9Xp3KsaCRr1c2pV46rYxFqgyDEURIlAqI2V50FctlJt4qeYaaDvN3sjb2wBUxD5S1dC 5lNoI0yhykxcNpefG2PNDNspe7eR0bGU1sW4Vvv4f6n5meCumo+p+P38pnvIJ01Ffax6 GcBQ== X-Gm-Message-State: ACgBeo0V9nhcfZFq8TlaiNCs+de/ZM5SaJy2Il/sTfj72bLXBlVrYAto +SGldNJ7e/626krzh3Psb1o= X-Google-Smtp-Source: AA6agR5/WFGQQN2qg86tC2/lrFfphSb88SzGpg21TF8f+cZr5dxrtP19HxTJpglE5GxuMHxqveeofg== X-Received: by 2002:a63:5658:0:b0:42a:1663:b965 with SMTP id g24-20020a635658000000b0042a1663b965mr32925868pgm.486.1662176918674; Fri, 02 Sep 2022 20:48:38 -0700 (PDT) Received: from localhost ([2409:8a70:2b2:5800:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id v123-20020a622f81000000b0052d4afc4302sm2732272pfv.175.2022.09.02.20.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 20:48:38 -0700 (PDT) From: Ihor Radchenko To: Rohit Patnaik Cc: emacs-orgmode@gnu.org Subject: Re: In an export transcoder, when should I use org-element-property to get values vs. the contents parameter In-Reply-To: References: Date: Sat, 03 Sep 2022 11:49:36 +0800 Message-ID: <8735d9m81b.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: , 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=1662176977; 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=hFqYlBAnj6nnmPqXwK255pi+CYicOqWXBVms0qoN8fk=; b=R5aRUGH1IX8z4tTl03XfxEIhHbAM5VSoUMt2ONgSyuVaKKL8mKhVi9avy+FM4wqwsR5LD5 3SIyqtx5dyuo5czi1dbMIn+tJDBgAqEccI3Lp3/OiVgWBWoCTdUwIU8O+Q7idCfRgu+/CF oXcHazGwuYUwfhIL0PowUqzelRVcaoVVu7IKFi3eMr03DHoHrUbyx1MDJr3DpQlRkiuKJ7 0DmtB/qn4cTkGUutcj1CGGRjY2hnb/E3qTD/M1XRiNvCV9aZD0bJEy0N/Xxyi0K/zVabTI V1KgBbzdGjE/xQlPMCYUucziTpPzDi+P0bqI0rK/cXvGfhDF9mFOGc0JI2/OEA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662176977; a=rsa-sha256; cv=none; b=XmiRJY8nkEq2N2FIhkMxTWhyP8XN2dpCwLqf3wqxc4YEsregKKZZP6KoKGd7zbT320GQs8 v4ClSQ6UzrlsVqd/yNfAReAXLBgmNpp2PPTaVCTXuia/ACQTnpOt1KELCo/o1G1pV1PXY7 huy5IQ/L+DU9X3oPCetuH3WVwoimdGctxugBbpwYLraF0JWXjTGLxFly1rJuDFQq/BjptT jZfUpjP1je38KrP2xlqVcvIFVo55mrxRunTFFr5F/sYHA1tRQYFyqSQH+6trfuyHbVqFzx i1TwyVju5pAFqXX3sIrDd187/ve6TaKOMEbwUX09p+QtKGN+K6dXYqCjSkeX/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z7J+QwKk; 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: -3.77 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z7J+QwKk; 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: BDCEF3A8C6 X-Spam-Score: -3.77 X-Migadu-Scanner: scn0.migadu.com X-TUID: RYuFgcTlEwer "Rohit Patnaik" writes: > My question is, why does org-md-verbatim use org-element-property to retrieve > the text to be transcoded, when org-md-bold and org-md-italic use the contents > parameter. In other words, couldn't the function be simplified to something like > this: You can't because the contents of verbatim element is always nil. Verbatim cannot contain other objects inside. All the objects that can contain other objects are listed in org-element-object-containers. > The broader context for my question is that I'm writing my own org exporter, and > I'd like some more clarity on what the distinction is between getting the value > of the element with org-element-property and relying on the export framework to > pass the value to the transcoder via the contents parameter. Any Org element is structured as (type properties contents). However, not all the Org elements have contents (as I mentioned above). Elements without contents generally store their text in one of the PROPERTIES. You may find it useful to examine org-element-interpret-TYPE functions to see how the element text can be recovered from its PROPERTIES and CONTENTS. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92