From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 mH/vNNjHNmOm6AAAbAwnHQ (envelope-from ) for ; Fri, 30 Sep 2022 12:41:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iGEsNdjHNmNwxAAA9RJhRA (envelope-from ) for ; Fri, 30 Sep 2022 12:41:28 +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 893CB42817 for ; Fri, 30 Sep 2022 12:41:27 +0200 (CEST) Received: from localhost ([::1]:56044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeDSQ-0004UO-5r for larch@yhetil.org; Fri, 30 Sep 2022 06:41:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeDRa-0004Re-Le for emacs-orgmode@gnu.org; Fri, 30 Sep 2022 06:40:36 -0400 Received: from mail-ua1-x933.google.com ([2607:f8b0:4864:20::933]:39714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oeDRW-000149-I0 for emacs-orgmode@gnu.org; Fri, 30 Sep 2022 06:40:33 -0400 Received: by mail-ua1-x933.google.com with SMTP id bu4so1550794uab.6 for ; Fri, 30 Sep 2022 03:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=vBvlzt+gDZFKC3OYTVAde9SGe16/cM43078FdNkTMKw=; b=DH8R5mHju9CjU+OJekRMEnKEArv90iRSELIo/wr17ZdqIL9RRodHpp6mthLVWs5cow UR5eBCCHUL0XdErhPp9qm9BQ9ePmHmQA5C6ozoO51OELUOIgxAGEHzvLZFiaCKn9XXGy MoGjg32wWH4SULvvX18fVabUHMUnd4uFUP7jdRBPSZYN9nyF/aV4uCL60fwohfbX+W2D hDHErNt4tks1izQEVjKSPeY+ZKqwNKYQElpRFIfzIzkIKNhAuJeWYwqlZXRIsrxR2Aqb pQitUN32XvgHq57S7z1ZmRTlcfUdHnVh/pCZ4MkJK/zzsZabvfPkM/DQ5kgHb6UbNhrY /Cmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=vBvlzt+gDZFKC3OYTVAde9SGe16/cM43078FdNkTMKw=; b=XkWs7cLdjm7X4u57htIfhOhDotcpiHDOWUMe/3G4635Q2TTA51PGPFeX+SdkUc8+mX 9j7d8hTXqDEKjYTKKeehLRw/d/dEY4AcQS6k6fbA5jDGzrR2SLOY3w2ZaNh6CcVcGUvY k+B/N4o7rPFZSZSSUouoZwm0Nud4AcodMYBmgBFGRKfW2b+T9bPtJGI345AtnTaaK2Uq lKiL9uiunyXenbAX7EGIrZW788W9O+00+6VaFbJ/mJBRUN9QPApGCS1n8wm19ATVKPtw VVRpyZ8p4bYxkt0oSJhuYkyqyD6WRHPbAQAHVYzSLoTb2dxphmr7RRS4TLWGld4UC0t/ KOuQ== X-Gm-Message-State: ACrzQf1Gn+Aj7uo8alY06sehfbXibHauxGjWeOl7/CIpYSkbZn03TnsT NH3BFqonecWL+wwne1bKy9VMgRKYcYu4I9ByOHulqLgspFw= X-Google-Smtp-Source: AMsMyM7yRid3DlBerFl/ZZLTWwFs96SgK7Wo8a5kcnxyft4wtzom71o71Noj3qt16wjKAnskb6zsUcmq7uOJK+fOwWI= X-Received: by 2002:ab0:2b05:0:b0:3af:13aa:b107 with SMTP id e5-20020ab02b05000000b003af13aab107mr4288249uar.20.1664534427217; Fri, 30 Sep 2022 03:40:27 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?L=C3=A9o_Ackermann?= Date: Fri, 30 Sep 2022 12:40:16 +0200 Message-ID: Subject: Ox unindents lines but I can't see when To: Org Mode List Content-Type: multipart/alternative; boundary="0000000000004032fb05e9e29fd0" Received-SPF: pass client-ip=2607:f8b0:4864:20::933; envelope-from=leo.komba@gmail.com; helo=mail-ua1-x933.google.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664534487; 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=vBvlzt+gDZFKC3OYTVAde9SGe16/cM43078FdNkTMKw=; b=Vhg5IqiLY8T37bdCIQk2VcQnFNC60xKk/x6r5+MwsFWXqTaBn0CLWq3aDi2r3j884+7+wp iOLj7Dh2PuvSEEpxIP413aYiXsDDo3cgVYvJetshmFFTycPq4ro19ea3eJi0mC6ABWWNIp 6yOX9agwBNYxUpwjO1kGfafQKQ+Wku8R/wHPgjqo/6qgPUlHeNOlRnUZIIjeNSvmj/rags 5RfY9ydy6UA00pExzkmJei7rLMFZ8rNWZyZVnSBREskzqtv1Ld1so4HAS54LnfgPBVdmF8 mVJxdDAPLKNRF2KuYqJ6+59EYKOeyic0+OMkdiWfeLbU4V2x6zyiuVKUPPNlLg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664534487; a=rsa-sha256; cv=none; b=HnFDUEIQ7nRTxsFgOvQc4t+x+ZqFlP7J8lw0SjcALZ3kLFfNwl/wJqcmtyAuZRJcWEAd7n c2TjlLAbSczcEDyCkYfFFILUyNNjht+h5ikoR2b2XEHvGQ/OLnbc/OAG+nJUCC149u9Rvt VifZYWwcd4nTx9rvockP0n1sDRp397CMWslo7XvZjwSRrt/MFCz0IgopK10C7ifa2hSTae aHrQUv9tgDWvTq0Hu3vRbOm9tar2DVJ1H+1RAGuau/b6dFXXabcjAAvdewmaLGpRKnMG4D AwdjUnXQINKS07VAmXD/GLXhwWDlhUFcWv3UCt01tRwlvTK6M0DwDQcxneifyQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DH8R5mHj; 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: -5.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DH8R5mHj; 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: 893CB42817 X-Spam-Score: -5.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: GF8C+Z2ozBi6 --0000000000004032fb05e9e29fd0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear all, I'm currently working on a tiny project org-inline-blocks that aims to provide a simple syntax for latex-blocks in org-mode based on indent. Namely, instead of #+begin_theorem ... #+end_theorem, it will be possible to write "Theorem." and the export will be based on indent to decide whether some text belongs to the block or not. Unfortunately, ox modifies the indentation of the org-text before running the filter functions. Here is an illustration. Consider the following file `hamlet.org`: --- *Prince Hamlet of Denmark is the son of the recently deceased King Hamlet, and nephew of King Claudius, his father=E2=80=99s brother and successor. Claudius hastily married King Hamlet=E2=80=99s widow, Gertrude, Hamlet=E2= =80=99s mother, and took the throne for himself. Denmark has a long-standing feud with neighbouring Norway, in which King Hamlet slew King Fortinbras of Norway in a battle some years ago. Although Denmark defeated Norway and the Norwegian throne fell to King Fortinbras=E2=80=99s infirm brother, Denmark = fears that an invasion led by the dead Norwegian king=E2=80=99s son, Prince Forti= nbras, is imminent.* * On a cold night on the ramparts of Elsinore, the Danish royal castle, the sentries Bernardo and Marcellus discuss a ghost resembling the late King Hamlet which they have recently seen, and bring Prince Hamlet=E2= =80=99s friend Horatio as a witness.* *---* and this tiny `org-export-filter-body`'s function: --- * (with-eval-after-load 'ox (defun org-strange-behavior (text backend info) "Print text, as read by the export-filter-body functions." (when (org-export-derived-backend-p backend 'latex) (message text))) (add-to-list 'org-export-filter-body-functions 'org-strange-behavior))* *---* When exporting `hamlet.org` in whatever format, the Message buffer shows this: --- *Prince Hamlet of Denmark is the son of the recently deceased King Hamlet, and nephew of King Claudius, his father=E2=80=99s brother and successor. Claudius hastily married King Hamlet=E2=80=99s widow, Gertrude, Hamlet=E2= =80=99s mother, and took the throne for himself. Denmark has a long-standing feud with neighbouring Norway, in which King Hamlet slew King Fortinbras of Norway in a battle some years ago. Although Denmark defeated Norway and the Norwegian throne fell to King Fortinbras=E2=80=99s infirm brother, Denmark = fears that an invasion led by the dead Norwegian king=E2=80=99s son, Prince Forti= nbras, is imminent.On a cold night on the ramparts of Elsinore, the Danish royal castle, the sentries Bernardo and Marcellus discuss a ghost resembling the late King Hamlet which they have recently seen, and bring Prince Hamlet=E2= =80=99s friend Horatio as a witness.* *---* *My question is thus: how can I prevent ox from unindenting the last line ? * I explored ox as much as I could, and did not find anything promising :/. I'm aware of an `org-export-preserve-breaks` variable but it preserves too much things (and causes export to be odd, in my opinion). If I run org-unindent-buffer in the buffer, the last line is unindented. But this function is not called in ox as far as I saw. Moreover, given that I'm writing a package, using an org-verse environment all around is not suitable. Best, Leo --0000000000004032fb05e9e29fd0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear all,

I'm currently working on a tiny= project org-inline-blocks that aims to provide a simple syntax for latex-b= locks in org-mode based on indent. Namely, instead of #+begin_theorem ... #= +end_theorem, it will be possible to write "Theorem." and the exp= ort will be based on indent to decide whether some text belongs to the bloc= k or not.
Unfortunately, ox modifies the indentation of the org-t= ext before running the filter functions. Here is an illustration.

Consider the following file `= hamlet.org`:

---
Prince Hamlet of Denmark is the son of th= e recently deceased King Hamlet, and nephew of King Claudius, his father=E2= =80=99s brother and successor.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Claudius hast= ily married King Hamlet=E2=80=99s widow, Gertrude, Hamlet=E2=80=99s mother,= and took the throne for himself. Denmark has a long-standing feud with nei= ghbouring Norway, in which King Hamlet slew King Fortinbras of Norway in a = battle some years ago.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Although Denmark defe= ated Norway and the Norwegian throne fell to King Fortinbras=E2=80=99s infi= rm brother, Denmark fears that an invasion led by the dead Norwegian king= =E2=80=99s son, Prince Fortinbras, is imminent.


=C2=A0 =C2=A0= =C2=A0 =C2=A0 On a cold night on the ramparts of Elsinore, the Danish roya= l castle, the sentries Bernardo and Marcellus discuss a ghost resembling th= e late King Hamlet which they have recently seen, and bring Prince Hamlet= =E2=80=99s friend Horatio as a witness.
---

and= this tiny `org-export-filter-body`'s function:

---
=C2=A0= =C2=A0 (with-eval-after-load 'ox
=C2=A0 =C2=A0 =C2=A0 (defun org-st= range-behavior (text backend info)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "Pri= nt text, as read by the export-filter-body functions."
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 (when (org-export-derived-backend-p backend 'latex)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message text)))

=C2=A0 =C2=A0 = =C2=A0 =C2=A0(add-to-list 'org-export-filter-body-functions
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'org-str= ange-behavior))
---

When exporting `hamlet.org` in whatever format, the Message buffer s= hows this:

---
Prince Hamlet of Denmark is the son of the rece= ntly deceased King Hamlet, and nephew of King Claudius, his father=E2=80=99= s brother and successor.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Claudius hastily ma= rried King Hamlet=E2=80=99s widow, Gertrude, Hamlet=E2=80=99s mother, and t= ook the throne for himself. Denmark has a long-standing feud with neighbour= ing Norway, in which King Hamlet slew King Fortinbras of Norway in a battle= some years ago.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Although Denmark defeated N= orway and the Norwegian throne fell to King Fortinbras=E2=80=99s infirm bro= ther, Denmark fears that an invasion led by the dead Norwegian king=E2=80= =99s son, Prince Fortinbras, is imminent.

On a cold night on the ram= parts of Elsinore, the Danish royal castle, the sentries Bernardo and Marce= llus discuss a ghost resembling the late King Hamlet which they have recent= ly seen, and bring Prince Hamlet=E2=80=99s friend Horatio as a witness.
=
---

My question is thus: = how can I prevent ox from unindenting the last line ?=C2=A0
<= br>
I explored ox as much as I could, and did not find anything p= romising :/.=C2=A0
I'm aware of an `org-export-preserve-break= s` variable but it preserves too much things (and causes export to be odd, = in my opinion).=C2=A0
If I run org-unindent-buffer in the buffer,= the last line is unindented. But this function is not called in ox as far = as I saw.
Moreover, given that I'm writing a package, using a= n org-verse environment all around is not suitable.
Best,
Leo
--0000000000004032fb05e9e29fd0--