From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4MaYGk6TAGRqSgAAbAwnHQ (envelope-from ) for ; Thu, 02 Mar 2023 13:15:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mPYVGk6TAGTDXQAAauVa8A (envelope-from ) for ; Thu, 02 Mar 2023 13:15:10 +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 0AD9810CF6 for ; Thu, 2 Mar 2023 13:15:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXhpA-0007iu-DB; Thu, 02 Mar 2023 07:14:16 -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 1pXhp3-0007gD-Q9 for emacs-orgmode@gnu.org; Thu, 02 Mar 2023 07:14:10 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXhp1-0003XC-QW for emacs-orgmode@gnu.org; Thu, 02 Mar 2023 07:14:09 -0500 Received: by mail-lf1-x12c.google.com with SMTP id g17so21860178lfv.4 for ; Thu, 02 Mar 2023 04:14:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677759245; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=TU+h29NKS6zAaIaHvRaoY413fFkett10EQkvPIDi58U=; b=BTsVkO4VkiOT2K7vdJvPfPhtCMvr9TvsK4p1r7R7MCh1BUeIesyubBYZNeSZBddYJm QDXjM8Uaxv0pQHSEL+4WGDrUPOiWykDqRdzMKuQh7aU8bmXTrkaZG95EvFvwxJ4+Xxaz JucQimaSNNigNBsTvE9gmaa8peyL7WWC7P8fJjx9Cq1IzRF6ezt0XukmLd/Xu8TMNG1O lgD8EdOCezKVqyfvfabf5tUhTsgw1MrFOzUNQz8EEsJ6B+/Vb3UJwB0M67jZXixLRRAN yxPrBL7FCX697NG3yuSoCxueZnALAvE8Ch7UrQmX0LZhUjSLUFnkms8sq9CVgm4v9E1z Rd0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677759245; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TU+h29NKS6zAaIaHvRaoY413fFkett10EQkvPIDi58U=; b=3p+rA6iUpA/DeG7QiNcRieOSaysbXjnDpNnnPg7cH49AOtkST6QvMhAioteS/yr0In 1Al06sBz43c7d4SNCbyAOAYpkk/Xx+Tt++3bo95WlwCk+Xkkezotrx8g4jzd1dS6dS4E E2OSRuzWQv7VTJ8Pf2hIJ+DJ3WxJiSxpx10Env3FjriqysB+e+uICU/10OKV0lzOtcLC wp3RNcnbxNFnZ5XlRq2rmNSLQTFV6U9cL9HWW8KMjHfRypK/u/rcmaMhBf++r/Vlurff +NpkN2dOrTe06Wpqi6oiCwJl3b6zexIabhCEezLXlgxXbhikPH4e4xfPoeUmz9KTJ6RD Kmxg== X-Gm-Message-State: AO0yUKXzZ2DEJvF2o9/PbGjd0U2mMjR9MWp1qHcoUzcJf/MlvAcxzKgV mjS6Cge1zSWS+XZL+ar36K806fMcjkc= X-Google-Smtp-Source: AK7set/QJYLh4zYdVVNWXry2INadkVRXMOcMM3ZnF4QWBts/Isvgv1c4q/rR2xmW/KpzEp8Vv/mqoA== X-Received: by 2002:ac2:4ad0:0:b0:4e1:b880:ba1c with SMTP id m16-20020ac24ad0000000b004e1b880ba1cmr2398892lfp.9.1677759244833; Thu, 02 Mar 2023 04:14:04 -0800 (PST) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id v28-20020ac2593c000000b004cb43c9bf9asm2099093lfi.208.2023.03.02.04.14.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Mar 2023 04:14:04 -0800 (PST) Message-ID: <0b6ac51e-bee8-6aad-4233-0a459572d5b4@gmail.com> Date: Thu, 2 Mar 2023 19:14:02 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: Have export treat file: paths in INCLUDED file relative to the INCLUDING file's dir Content-Language: en-US To: emacs-orgmode@gnu.org, gnuric@pm.me References: <87h6v9gpno.fsf@pm.me> <87pm9ta2ms.fsf@pm.me> From: Max Nikulin Mail-Followup-To: emacs-orgmode@gnu.org, gnuric@pm.me In-Reply-To: <87pm9ta2ms.fsf@pm.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=manikulin@gmail.com; helo=mail-lf1-x12c.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 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, NICE_REPLY_A=-0.092, 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-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=1677759310; a=rsa-sha256; cv=none; b=AuL+4qETiF7erovVXB71byq/oPugu4l+ZkP47eblp8/3sDJUWWA1DRlWRozePE8lCK+wEh tTUGWY5/Wikf/XPhDPt0WRM9UqDGJmUx4VHI9t9QrlMA2Ryfdq6Ds2vfRfyM3GbLwrAs0a kvLP6X1PYBmygiMaj4f38OWW+jmOk4q4LLM+w46PixG+6vk2ze/jgK7Y4AvHAuyA9nubVB ciP42XbGDshVC9B9LRaKEiHyIjaOIJbqFJRKwHd7M/znTp9lf2vJ7/uLazqjnGyOe1ETXa Zba7oO/duge2B78C7JAJ02Cq7wU6kux49Ua8MS4UA0fTrJJ4dHWY5gvTu4CFuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=BTsVkO4V; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677759310; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=TU+h29NKS6zAaIaHvRaoY413fFkett10EQkvPIDi58U=; b=AKTLJp46bKVwykFMRx+JGRl6Nblo0+17BfAdcFa9/3YPLgi+fkHgit44GnphlPvdjRa6nF 7AUayiHvo3iBAOIWDWd/P2IwY8ZM8Yx/9Z8Yy/sMpCgUxGXDNn0cWfhK7+6ZVxMqeFfzYf /q9xsrTdqQR+u1cxpT9UQk2/c2HcFIf9NTElxw8E0+L0f9ooGqFyc36OHH2RvlrFtgedl5 ZZw1uYlyEXzyj2024ypmqmjQEGJdoqokUCii0LH+8mpVBTmrCzbU0dFj7HnqDKdi/VDzHo 6ZuNj1486KgjZRkvoeuPvq5qumYij4vseFlLZXacqzd8HEQjJVP2rnWaVjw4kA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.89 X-Spam-Score: -1.89 X-Migadu-Queue-Id: 0AD9810CF6 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=BTsVkO4V; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: RwJOsVPfZ4jT On 01/03/2023 04:42, gnuric wrote: >> 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" ... > 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). My idea was that second include should simulate a link relative to the include-1/h-1.h file. I have no idea which feature of cpp may be used to distinguish behavior of include and link in respect to relative paths. My expectation is that relative paths are resolved in respect to the file where they reside. I admit that in some cases included file may be a kind of template, so it may add e.g. a logo specific to each project. However, perhaps, I would prefer to define a macro. Notice that CPP has another feature: include path, so while searching for a file directories from a list tried till file is found: #include and cpp -I /usr/include/lib1 -I /usr/include/lib2 Org does not have such concept.