From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mAvfLPHaK2SMJAAASxT56A (envelope-from ) for ; Tue, 04 Apr 2023 10:08:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ULPFLPHaK2TwKgEA9RJhRA (envelope-from ) for ; Tue, 04 Apr 2023 10:08:17 +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 49D17BECA for ; Tue, 4 Apr 2023 10:08:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjbhF-0004my-HT; Tue, 04 Apr 2023 04:07:17 -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 1pjbhD-0004mk-Fz for emacs-orgmode@gnu.org; Tue, 04 Apr 2023 04:07:15 -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 1pjbhA-000680-Ox for emacs-orgmode@gnu.org; Tue, 04 Apr 2023 04:07:15 -0400 Date: Tue, 04 Apr 2023 08:07:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1680595627; x=1680854827; bh=ah/ZEbNSJiD1S6gQDV9J5efWIgdQ947O4oD+KEJPWas=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=oncMrA+bSjbd5aWWuaLjrotU9xt757lxiA0/pPW17w+5cYX2mVuoFuCPDsl2xRWSM s+CVytEk8TEXD5ixhUWm+K3D4z42K69xUO4rruhyCYPH+41C8lky6qiy4KtyRngD0v WGq7H3o9ZiTf6PfuBc/RqqHTC5f/dOurBPEvUdTwt1drczrwhcSUeOM1lkee0AqhCN PNhuegZI502Y0sGwoT8BxlzNuBaco+FDscy5jFNIVFGEpEolT4TeqCMFLiYk6J6KMY LqmABaOURYroSKeU1RQ0oUsnpyWseqWEFMfdv2GjXAYCKy8tiz9lGeLi1PYg0Oop7k 2DPydKoQjFYuA== To: Ihor Radchenko From: gnuric@pm.me Cc: gnuric@pm.me, orgmode@tec.tecosaur.net, emacs-orgmode@gnu.org Subject: Re: [FR] Allow to #+include files verbatim without any processing (was: Have export treat file: paths in INCLUDED file relative to the INCLUDING file's dir) Message-ID: <875yacrrz5.fsf@pm.me> In-Reply-To: <87cz4lb9ya.fsf@localhost> References: <87h6v9gpno.fsf@pm.me> <87ilfmxen5.fsf@localhost> <87mt4xvn4w.fsf@tec.tecosaur.net> <87ttz5a2zt.fsf@pm.me> <87sfdilgyb.fsf@localhost> <871ql23r92.fsf@pm.me> <87cz4lb9ya.fsf@localhost> Feedback-ID: 29982984: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.40.133; envelope-from=gnuric@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_H2=-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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680595697; a=rsa-sha256; cv=none; b=Rmo74iU/csawjlpFqY2dAtw0a6C24DEmdV9qWXMvVHFRiENhIQrfaP9gwHQHDaSe8cinUG kzqHIJsQjeodDRhWgl98lGhB27IuYLb6F/UER5W+GD0BqySYzu/BJDn4mCN5ELJK7+mJIH nDsrT4NxtBf62cn327Pn0AeHaRizTyH5PeLBtXzNjuTGnRwnzWi32zBoOozA1hxFIJtPfk U0yJXq+kNlEJGUtxawRQiNyCDmuUcHkvtel9daDKF0SU9D3WeIotfcH0LiIFIcfz+UW603 fLy7P51uWvWlgTR05JFpOy5EuftTzYu1EB3eoWN4PRX0/MxEUoJbkJoSUR4YZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=oncMrA+b; dmarc=pass (policy=quarantine) header.from=pm.me; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680595697; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ah/ZEbNSJiD1S6gQDV9J5efWIgdQ947O4oD+KEJPWas=; b=Mqd3HSk+oZE7k5exgVR//jwkICiLcYaCYwiz6j4hIAM+nGFHLjHqaZfJfXRaotukH6OT/R sxYYzXhPFKkXhFzeim/pskYhmsN+JeSoSIKgDM/VzBMjEoUyzGVKMiyvIL7rgljGVnADHc eAYWwNyNmI1NT84L/BzZESgsnIZXjrVxOKTdxRwQzQ7e8bHuPlvry3HMPESsAfgWrSlhSa csmJkamT66V222iB/x6/a/TdCvOe4f1qGOpTcH5TwAe6KCcrkmwCj/QZEy2VfDEM6Xj5WF edCdhB++So971mghiHz/nLmMjfxWQqULT96H6cs26FPNw0qDvztZlsyvye3GmA== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=oncMrA+b; dmarc=pass (policy=quarantine) header.from=pm.me; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -10.00 X-Spam-Score: -10.00 X-Migadu-Queue-Id: 49D17BECA X-TUID: RGrs2xb74IDc Thank you for your detailed reply, Ihor. "Ihor Radchenko" writes: > gnuric@pm.me writes: > >> Hi Ihor, >> Thanks for your reply and clarification on what Timothy meant. >> >> 1. Is there a general workaround that could be used as of now? > > Nothing great. You may have to use a custom macro, but you will then > miss auto adjustment of heading levels and other #+INCLUDE features. > > A bit more dramatic would be advising `org-export--update-included-link' > with :around advice #'ignore. That will skip link updates completely. > >> 2. Is there something I can do to help with a :dir or similar >> option's development? I have some (very) basic knowledge of lisp. > > You can look into `org-export--prepare-file-contents' that is doing all > the processing of the included files. It will have to be modified to > take the new options. The options are parsed by > `org-export-expand-include-keyword'. > > If you have experience with other programming languages, things should > not be too hard - just follow the existing code. > So, looking in ox.el (from Org 9.4.4 coming in GNU Emacs 27.2), it appears that there is an optional INCLUDER arg that is supposed to do what I'm looking for, except that there seems to be a bug somewhere: Try the following: -------------------- CORRECT -------------------- includer.org: #+INCLUDE: "./a/included.org" :includer . a/included.org: [[./a/img.png]] org-html-export-to-html results in the expected output in includer.html: 3D"img.png" Notice there is only ONE a/ in the img src path. Without :includer arg we would get 3D"img.png" Notice there are TWO a/ (a/a/) in the img src path. -------------------------------------------------- -------------------- WRONG -------------------- But if we just add a * section/heading to a/includer.org, e.g., a/includer.org: * some [[./a/img.png]] Now, org-html-export-to-html spits #+BEGINincluder ... 3D"img.png" #+ENDincluder Why are these #+BEGIN_includer #+END_includer delimiters are being produced? ----------------------------------------------- >> 3. If it helps, this behavior has changed since (at least) Org >> 9.1.9-65-g5e4542, which is the default distributed with GNU Emacs >> 26.3. With that Org, export to html took the links in the >> #+INCLUDE'd .org files as being relative to the includer's dir >> (i.e., the PARENT .org file's dir), which I consider 'verbatim' >> inclusion. > > This behaviour is not documented and not defined. > The relative file link resolution was requested in > https://lists.gnu.org/r/emacs-orgmode/2019-02/msg00103.html and then > implemented in 931b7b8faf9. > > Note that #+INCLUDE generally assumes regular Org files and the new > behaviour you stumbled upon makes more sense as the default. > > Unfortunately, this change has not been announced in ORG-NEWS.