emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Have export treat file: paths in INCLUDED file relative to the INCLU


From: gnuric
Subject: Re: Have export treat file: paths in INCLUDED file relative to the INCLUDING file's dir
Date: Tue, 28 Feb 2023 21:42:09 +0000

Hi Max,

Thanks for your reply.

"Max Nikulin" <manikulin@gmail.com> 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=*.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 "<built-in>"
> # 1 "<command-line>"
> # 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]