From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wK6tFak4EmOYZwEAbAwnHQ (envelope-from ) for ; Fri, 02 Sep 2022 19:08:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UDG+Fak4EmPmhQEAauVa8A (envelope-from ) for ; Fri, 02 Sep 2022 19:08:57 +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 D3FAC37B92 for ; Fri, 2 Sep 2022 19:08:56 +0200 (CEST) Received: from localhost ([::1]:33580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUAA3-0007YP-Sx for larch@yhetil.org; Fri, 02 Sep 2022 13:08:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUA9X-0007Y0-Qb for emacs-orgmode@gnu.org; Fri, 02 Sep 2022 13:08:23 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37957) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUA9V-00007h-Tc for emacs-orgmode@gnu.org; Fri, 02 Sep 2022 13:08:23 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0C6325C00E5 for ; Fri, 2 Sep 2022 13:08:20 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute5.internal (MEProxy); Fri, 02 Sep 2022 13:08:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quanticle.net; h=cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t= 1662138500; x=1662224900; bh=amq4arSi7r7j2WnuOY0tLxAZLmfTXmUW8jG RYnm89QM=; b=SYGVwIx2gZ8XuY5/B+y0XEr9pZz908TkdD9MTNN+ns2xc2BBpqC bB4vrc09C0J6DHsqRo9I+Gybs+ljOu4oRqWBvY0OssN3e8mLE/vj96IwhhmasAW4 0X7PBwkMiOVfTpXu+/qcucg9viX+YCTIgQhOQbbDeJVqN8osYM7dP6Ux1bsyKMFr GHh6jVS4LtpkwQvT8aM6092mIp6uEBK42VIG8qN79pD6Fur/U+nIMB441g8VyY1S +4ZdxAhcuWQMZd8s5q5WSoSqJBfNXhEg0tH333oV5NC9h65xw7M+HuMMw+zj/1Ge 3ZhSS9jbeO6aPOTHyUthgOurCBuhwFFhS+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1662138500; x= 1662224900; bh=amq4arSi7r7j2WnuOY0tLxAZLmfTXmUW8jGRYnm89QM=; b=y AhG+H1b8+X1RQIj/untLO8dHIm2aaSs6GdquUuBO0FNHUhh0yGJv1/bbnJUQDk6E mTJABTinrnPP42kKUIYshrcvWRnQS5pFpzXTLpz261VoKVrzEew5sFQmwhy/g8Ik KfJmLHmWrZWefRBPLFK1FLeVVPHmBfKrxI4Apjh//2EBfsuXoKnTpkWb+4BuYPiJ QlYUhtDUPCofdTQKJHASdQE7fFtA2mYQBRUsMRYVxoj+e8dL3TStaoZG7rAEYMjN kypvcQQwuj+3Z6fuhb8a/I8wqud7e8/tYr+nrOlLZV9RcgSImX9+e8i94rWlq3rH WukSscZBDaKd4GxLKEQhA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeltddgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtre dtreertdenucfhrhhomhepfdftohhhihhtucfrrghtnhgrihhkfdcuoehquhgrnhhtihgt lhgvsehquhgrnhhtihgtlhgvrdhnvghtqeenucggtffrrghtthgvrhhnpeehudeludelke ekhfdvieegteelhfeghfetvdefkedvvedvfeeftdfhhfegvefgteenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehquhgrnhhtihgtlhgvsehquh grnhhtihgtlhgvrdhnvght X-ME-Proxy: Feedback-ID: i0db1457f:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 63E8236A0073; Fri, 2 Sep 2022 13:08:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-841-g7899e99a45-fm-20220811.002-g7899e99a Mime-Version: 1.0 Message-Id: Date: Fri, 02 Sep 2022 12:07:57 -0500 From: "Rohit Patnaik" To: emacs-orgmode@gnu.org Subject: In an export transcoder, when should I use org-element-property to get values vs. the contents parameter Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.28; envelope-from=quanticle@quanticle.net; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: , 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=1662138537; 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=amq4arSi7r7j2WnuOY0tLxAZLmfTXmUW8jGRYnm89QM=; b=Dgy1PLwJV7kWsr0N6gE6ERbmcG2EZta5QrtxeMVfJuTSC9hIrDPjx2KvSo1Pbpj8FklWEX 1MRnQjOjx2oWmSCPU/oHQ9yw71xN2cXJd+p+ce5n9UgAwgfD2z+bpkzPE/onVMv2TZ4XBv 7I8Kpxq0sxYWPOtvv7ZxMSCq4hthWzj5Mqd/Tn2mDjq+kAwIXfz7ga3o0mWWKKHqj26wtA v6RCt2X8Ypm2Bg6B+pmBfAO4dfD5hDTVQZDo+SIrclfmV7X0zxIw7uUgk5eufjQpO5RUeY UHF+77bkMd4vvfmNI5xQt+PH07279VesasbR/dkK51n8LXpblj0Tq6OtRrKYmg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662138537; a=rsa-sha256; cv=none; b=SPS/bSTBLg6hvKnyptZlbqg9GX20TU5lVbA2qWB99DPCZh9ROCzKjWef/99+oO5RK+tVYC LemDQm3k3efg/z8lgygP9Gnp16LyG96gxX40M9opcGLwJq7GiUcuVVgUKOwlE4oaHjiddl ztahT1FtzRKgctcyZWZSGMYyrmjbbq55qq46U3ueEXI8D44j+pwmOSE/89XVM3KigMFmbh rwmnczzRd+qjOpXpKGYzwz54dZCR7qmCrKEfuXbKv6RIj9r0DdH+OLw+WAxNs9wRLSkaY2 MhX/+y6bxVrA+qnkM3g7SKoywaoem23/8fek+87Q5/6VtZpxJ46Oxx+Co1/ZZQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=quanticle.net header.s=fm1 header.b=SYGVwIx2; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="y AhG+H1"; dmarc=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" X-Migadu-Spam-Score: 3.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=quanticle.net header.s=fm1 header.b=SYGVwIx2; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="y AhG+H1"; dmarc=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" X-Migadu-Queue-Id: D3FAC37B92 X-Spam-Score: 3.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: mGS7VrPF0gx0 I'm looking at function that handles transcoding inline code and verbatim text in ox-md: (defun org-md-verbatim (verbatim _contents _info) "Transcode VERBATIM object into Markdown format. CONTENTS is nil. INFO is a plist used as a communication channel." (let ((value (org-element-property :value verbatim))) (format (cond ((not (string-match "`" value)) "`%s`") ((or (string-prefix-p "`" value) (string-suffix-p "`" value)) "`` %s ``") (t "``%s``")) value))) 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: (defun org-md-verbatim (_verbatim contents _info) "Transcode VERBATIM object into Markdown format. CONTENTS is nil. INFO is a plist used as a communication channel." (format (cond ((not (string-match "`" contents)) "`%s`") ((or (string-prefix-p "`" contents) (string-suffix-p "`" contents)) "`` %s ``") (t "``%s``")) contents)) 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. Thanks, Rohit