From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 ALVlOmB1/mPMsAAAbAwnHQ (envelope-from ) for ; Tue, 28 Feb 2023 22:42:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gBFnOWB1/mPKLQAAG6o9tA (envelope-from ) for ; Tue, 28 Feb 2023 22:42:56 +0100 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 84910310E0 for ; Tue, 28 Feb 2023 22:42:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX7k2-00064Y-3W; Tue, 28 Feb 2023 16:42:34 -0500 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 1pX7jq-0005Mc-UL for emacs-orgmode@gnu.org; Tue, 28 Feb 2023 16:42:26 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pX7jp-0001W5-1R for emacs-orgmode@gnu.org; Tue, 28 Feb 2023 16:42:22 -0500 Date: Tue, 28 Feb 2023 21:42:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1677620538; x=1677879738; bh=d758p+UasCnqNuqt/RzKFgzB35KdVNUgBXBFBGM8lrc=; 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=QTIxEy6tjZdyMjbJ9nX1/kRiAAbsBKHJv70/eHgOxXCjZNoaI0rqETa/yAAbM+VmH FtxBQWRGxn38Xh3GFEJvZjNQhf+r1og6qtI6x+KMBtq1T2u2LhG93bV7IDDJQ0pRVd qP5DtWpDQgOM5rgD7VEinOabuJPbrvH6nEl7hpB8tlEUKau3aQliLJxa7C3zRnLCEe 1aRQ5FNYm1pzdLxoTnx1uLMFeweJiRcfLR/p5euvp3GO7mu49Y3L0kaPekPq1QX6eb BtOd9qIGf/wtipkAbJ98e5YTJIN1gd6O3841xsXMwQbu5bRvUllLW9jW0/ELqHvy6q E4U3sIVZ4ziDw== To: Max Nikulin From: gnuric@pm.me Cc: gnuric@pm.me, emacs-orgmode@gnu.org Subject: Re: Have export treat file: paths in INCLUDED file relative to the INCLUDING file's dir Message-ID: <87pm9ta2ms.fsf@pm.me> In-Reply-To: References: <87h6v9gpno.fsf@pm.me> 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.43.22; envelope-from=gnuric@pm.me; helo=mail-4322.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=1677620576; a=rsa-sha256; cv=none; b=AwjgDfdt0vjCJsxL6jzjxPQ2QaC56PMNDZMaGNHVNChqI9qZSiwsuCEBX4rBr+RHO5gd3V 9ICXUfHbHxJX3HAHllwN+f9v+rLO4gnzdbAueaNQqxdkXnEKJEe6nUy4dERqY18ec7ViQD 7VCM6ZrNasfUgr5oyTUuVc5jgE2MO+zgevCyJJa3YT6J9zjH2jrflbWAChVhZ4A4uXgP4Q txb6mrTaVkOI2Yq+dfLykYGtDSp4m6tgWxfk+BnbcbvOnY8gT0XiiI7wOqkFvfhuq0E62R Umg+qZG/yy1hmHljLZwYu2Wun/qIQx8WAmG/doVrRRkIj6Hbs6PDPORr2wb4SA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=QTIxEy6t; 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=1677620576; 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=d758p+UasCnqNuqt/RzKFgzB35KdVNUgBXBFBGM8lrc=; b=NA2FLCdNFo9G4Jlp0D4/9ci0onfCrGzph8cT7ms7cWRU4iOKhmBqXxFqGH630Y9JdKYriL LwpeIrq1zEimk640uMvjl14pAT+JIQFIg7WHmpaq/5O7JtSrHOAC+XWRjiLT1S6hOM33a0 u47Zk3rbUFXL4wM1JQsa9QZRLtE9vcOGihR+ftyYRJoBQ4VqmYH0vxVwQD6Wxf7s7ABNH3 CC4AY3TAT2odOD17uDo/yDgmqWbQ+lyKrRSCjXfLqlW8GX1qtBICP0eb2bG4TN8+AQTJBV jVMnCwQ/MueWzA09SGkq9OihtlkUp3hx56Pnq23/B67bhoJFH4FpzUoeksac8g== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.48 X-Spam-Score: -6.48 X-Migadu-Queue-Id: 84910310E0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pm.me header.s=protonmail3 header.b=QTIxEy6t; 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 X-TUID: 6iJPS4KoaEPo Hi Max, Thanks for your reply. "Max Nikulin" writes: > On 26/02/2023 08:52, gnuric@pm.me wrote: >> (basically similar to what #include >> directive in C preprocessor would do, e.g.). As of now, the >> above >> s.org exports to s.html which has the file: link converted to >> >> file:///home/user/media/s/media/s01_image.png > > Doesn't cpp behave in a similar way? > > grep --include=3D*.h -r '' h-0.h include-1/ > h-0.h: > h-0.h:#include "include-1/h-1.h" > h-0.h: > h-0.h:extern int h0; > include-1/h-1.h: > include-1/h-1.h:#include "include-2/h-2.h" > include-1/h-1.h: > include-1/h-1.h:extern int h1; > include-1/include-2/h-2.h: > include-1/include-2/h-2.h:extern int h2; > You have two #include directives in your example, which are processed recursively according to the preprocessor rules. What I had in mind was one #include preprocessor directive (similar to one #+INCLUDE: 'directive' in Org) and a non-preprocessor directive (`file:' in Org). > cpp -nostdinc h-0.h > # 1 "h-0.h" > # 1 "" > # 1 "" > # 1 "h-0.h" > > # 1 "include-1/h-1.h" 1 > > # 1 "include-1/include-2/h-2.h" 1 > > extern int h2; > # 3 "include-1/h-1.h" 2 > > extern int h1; > # 3 "h-0.h" 2 > > extern int h0; > > > So in a file residing in ./include-1/ reference to > "include-2/h-2.h" > means ./include-1/include-2/h-2.h, not ./include-2/h-2.h Regards, Omid