From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0OPIHt2K1WZkBQEAqHPOHw:P1 (envelope-from ) for ; Mon, 02 Sep 2024 09:52:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0OPIHt2K1WZkBQEAqHPOHw (envelope-from ) for ; Mon, 02 Sep 2024 11:52:29 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=b3Wn5gUv; 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=quarantine) header.from=pm.me ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1725270749; 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=W3I0lXzqkesxMW9rKVaUD+xG85cm6k7Mo9cyGXmSDGw=; b=kw0Ycn1KpWbaCX63AD4+jog6IRlqk5qF15B/BiOrdkUBeyF7/6BKUsTJA9KW+Ry9YH1h/F ZdkKv4wT2uPKSusrl4uRSoKiI/yxFvf0CFJNYTT0P0+7qRA9PZtNj9PbY1Gr5oC1sFORaB 32Iyc6Up6Vzh29tT4xIGGACas8cMQqCQi6ZQ+GDut5gvm4p9X0fxrZPPtcDngl0kKu/jkS GtMXm1I2bdhpRpT1Bikrx5/o6i4Qhs1iWFmZVO9Qp8cnEvYvoMSgDaJ5weeFpQbjpGd6tL 7D6dhd0u0StQODhhn/OB7DTAXM9mZ9e+1PXPG+iV4xoBN132yrAidRJcrgYKfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=b3Wn5gUv; 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=quarantine) header.from=pm.me ARC-Seal: i=1; s=key1; d=yhetil.org; t=1725270749; a=rsa-sha256; cv=none; b=qdd4fSX41azi7GyImNPUAMhtOkMVLh78zb6C1EZfiFd/InAg527lFtYvAW2XL+N5tFGcgA PhvN1od0lgBDb6h4Fagdj+o2CbLLnG7KTeMg73R6X7xKNwx+ZSE0vae6tVbmGKOyqXrgF9 8Fv3y1Vc69pK9SRkMvKqPy4nMSk7eGcZJodTqbREN6Ny001ETUK8w1LbNubJBuGzHWwjxE xhHIA4o5XtmrErpvHAQwKdYpOzHLpbegH/zDkHxGiJ+Ztym/KU9k9L/Jl2GJs7SPS5bMEV Uk8NpHEsaRw6IzHYa5h4Y5QKVC5tSd1HjMDctiU/rDU8/Gddif4PvinNnmrRfA== 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 2E51760FAD for ; Mon, 2 Sep 2024 11:52:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sl3il-0001sI-JC; Mon, 02 Sep 2024 05:51:39 -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 1sl3ih-0001ru-LP for emacs-orgmode@gnu.org; Mon, 02 Sep 2024 05:51:35 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sl3if-0003Ks-HR for emacs-orgmode@gnu.org; Mon, 02 Sep 2024 05:51:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1725270688; x=1725529888; bh=W3I0lXzqkesxMW9rKVaUD+xG85cm6k7Mo9cyGXmSDGw=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=b3Wn5gUvbVJdtsOrc5dg0XluSzy8WbcnuHHEVuNLCZcevW6U5PQkH2l6TldipdVYB EUntkpGx0tXKc5EFnETx21bmcIkBdtxm6TGuWhR5LWNEWedT6EkSZeJ7pWs7M/Sppd DfzPI//81divpHNqGzQISes5MxEXXnaS1bCftkMewbtiqfGm610+1luHWtAhHIeGM5 vP5MViQPYuOhwJ1EbWFMO7bibJMw45u0fzy3oxP/w3LXRqAbJSji0kxIVX/OeAN0jj b8FVskm7bhzX3r5JBzY+yIUhmfzSccZFDCKIoKjt3gUzIXxZYePWFhk+Jt9gsCOzPy DQn2cA+vWrOJA== Date: Mon, 02 Sep 2024 09:51:24 +0000 To: emacs-orgmode@gnu.org From: Antonio Romano Subject: Should "org-element-parse-buffer" check whether the buffer's major mode is org mode? Message-ID: <1b2b8c2791e628f6a41ef533e49a5ac9e3dee8a4.camel@pm.me> Feedback-ID: 77338314:user:proton X-Pm-Message-ID: 709ec40460ca87b34b9d89b9d009cd05b3b9cf52 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.133; envelope-from=n58r@pm.me; helo=mail-40133.protonmail.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_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 2E51760FAD X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -8.91 X-Spam-Score: -8.91 X-TUID: /QCCTrmWNBEF Hi all, yesterday I've sent a question on Emacs StackExchange=C2=A0 (https://emacs.stackexchange.com/questions/82063) where I described a small issue I had encountered while using Org Element API.=C2=A0 What I did was simply parse out a buffer, change all headlines's TODO keyword in its AST to "DONE", interpret the resulting AST and finally print out the resulting document to a new buffer. The issue I had encountered was that an headline like "* TODO Hello" would wrongly become "* DONE TODO Hello" instead of "* DONE Hello". A kind user pointed out that the issue was that I called "org-element- parse-buffer" in a fundamental-mode buffer and, in fact, turning on org-mode beforehand solved the issue. As the user suggested, I'm here to ask you if this is the intended behavior or if it would be better limiting the usage of the function to org-mode (and derived) buffers only. Thank you in advance.