emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* #+LINK abbrevs possible in #+INCLUDEs ?
@ 2015-04-27 14:59 Detlef Steuer
  2015-04-27 15:49 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Detlef Steuer @ 2015-04-27 14:59 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

Emacs and git in today´s fresh version.

I have two files:

file1.org:
--------------------
#+LINK: HOME http://example.de

* My Homepage
  You can find my homepage [[HOME][here]]

#+INCLUDE: file2.org
--------------------

file2.org
--------------------
#+LINK: HOME2 http://other.example.de

* My other page
  You can find my other page [[HOME2][here]]
--------------------

I can export file2.org to html as expected.

I can´t export file1.org to html with the included file2.org.
Only if I move the #+LINK line from file2 to file1 the export
works as expected.

In my setting file2.org must export standalone, so moving the LINKs to
file1 is no option. An ugly workaround would be to include the
abbreviation for HOME2 in both files.  Ugly.

Is there a woraround/setting to have local #+LINK directives working in
included files? 

Regards
Detlef

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: #+LINK abbrevs possible in #+INCLUDEs ?
  2015-04-27 14:59 #+LINK abbrevs possible in #+INCLUDEs ? Detlef Steuer
@ 2015-04-27 15:49 ` Nicolas Goaziou
  2015-04-27 17:55   ` Detlef Steuer
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2015-04-27 15:49 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode

Hello,

Detlef Steuer <detlef.steuer@gmx.de> writes:

> I have two files:
>
> file1.org:
> --------------------
> #+LINK: HOME http://example.de
>
> * My Homepage You can find my homepage [[HOME][here]]
>
> #+INCLUDE: file2.org
> --------------------
>
> file2.org --------------------
> #+LINK: HOME2 http://other.example.de
>
> * My other page
>   You can find my other page [[HOME2][here]]
> --------------------
>
> I can export file2.org to html as expected.
>
> I can´t export file1.org to html with the included file2.org.
> Only if I move the #+LINK line from file2 to file1 the export
> works as expected.
>
> In my setting file2.org must export standalone, so moving the LINKs to
> file1 is no option. An ugly workaround would be to include the
> abbreviation for HOME2 in both files.  Ugly.
>
> Is there a woraround/setting to have local #+LINK directives working in
> included files?

You can extract out #+LINK: keywords in a file, e.g. "setup.org" and
use #+SETUPFILE: ... in both "file1.org" and "file2.org".

You can also use 

  #+SETUPFILE: file2.org

in "file1.org".

Set-up (e.g., link abbreviations) is not refreshed after expanding
INCLUDE keywords. I cannot remember why, tho. Maybe for (dubious)
efficiency reasons.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: #+LINK abbrevs possible in #+INCLUDEs ?
  2015-04-27 15:49 ` Nicolas Goaziou
@ 2015-04-27 17:55   ` Detlef Steuer
  2015-04-27 18:46     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Detlef Steuer @ 2015-04-27 17:55 UTC (permalink / raw)
  To: emacs-orgmode

> Hello,
> 
> Detlef Steuer <detlef.steuer@gmx.de> writes:
> 
> > I have two files:
> >
> > file1.org:
> > --------------------
> > #+LINK: HOME http://example.de
> >
> > * My Homepage You can find my homepage [[HOME][here]]
> >
> > #+INCLUDE: file2.org
> > --------------------
> >
> > file2.org --------------------
> > #+LINK: HOME2 http://other.example.de
> >
> > * My other page
> >   You can find my other page [[HOME2][here]]
> > --------------------
> >
> > I can export file2.org to html as expected.
> >
> > I can´t export file1.org to html with the included file2.org.
> > Only if I move the #+LINK line from file2 to file1 the export
> > works as expected.
> >
> > In my setting file2.org must export standalone, so moving the LINKs
> > to file1 is no option. An ugly workaround would be to include the
> > abbreviation for HOME2 in both files.  Ugly.
> >
> > Is there a woraround/setting to have local #+LINK directives
> > working in included files?
> 
> You can extract out #+LINK: keywords in a file, e.g. "setup.org" and
> use #+SETUPFILE: ... in both "file1.org" and "file2.org".

OK, but still this is kind of ugly, because the LINKs really are file
specific for ,- in the long run -,  multiple files.


> 
> You can also use 
> 
>   #+SETUPFILE: file2.org
> 
> in "file1.org".
>

The real file2.org is somewhat big and would be scanned completely,
wouldn't it?

> Set-up (e.g., link abbreviations) is not refreshed after expanding
> INCLUDE keywords. I cannot remember why, tho. Maybe for (dubious)
> efficiency reasons.
> 

If you don't remember, may be it would be possible to try it out?
Would love it and as a feature it looks natural for an included file! 

Thank you for the hints!

Regards
Detlef

> 
> Regards,
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: #+LINK abbrevs possible in #+INCLUDEs ?
  2015-04-27 17:55   ` Detlef Steuer
@ 2015-04-27 18:46     ` Nicolas Goaziou
  2015-04-28 15:02       ` Detlef Steuer
  2015-04-29 11:42       ` Alan Schmitt
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2015-04-27 18:46 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode

Detlef Steuer <detlef.steuer@gmx.de> writes:

> The real file2.org is somewhat big and would be scanned completely,
> wouldn't it?

Only special keywords are parsed.

The advantage of SETUPFILE is that it works even outside of export.

>> Set-up (e.g., link abbreviations) is not refreshed after expanding
>> INCLUDE keywords. I cannot remember why, tho. Maybe for (dubious)
>> efficiency reasons.
>
> If you don't remember, may be it would be possible to try it out?
> Would love it and as a feature it looks natural for an included file!

I agree. I added this in 2965f8fb0c048a20b52ba90627e7cca6fe706c93. Thank
you.


Regards,

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: #+LINK abbrevs possible in #+INCLUDEs ?
  2015-04-27 18:46     ` Nicolas Goaziou
@ 2015-04-28 15:02       ` Detlef Steuer
  2015-04-29 11:42       ` Alan Schmitt
  1 sibling, 0 replies; 8+ messages in thread
From: Detlef Steuer @ 2015-04-28 15:02 UTC (permalink / raw)
  To: emacs-orgmode

> 
> >> Set-up (e.g., link abbreviations) is not refreshed after expanding
> >> INCLUDE keywords. I cannot remember why, tho. Maybe for (dubious)
> >> efficiency reasons.
> >
> > If you don't remember, may be it would be possible to try it out?
> > Would love it and as a feature it looks natural for an included
> > file!
> 
> I agree. I added this in 2965f8fb0c048a20b52ba90627e7cca6fe706c93.
> Thank you.
> 

Fantastic! Works like expected now!

Detlef

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: #+LINK abbrevs possible in #+INCLUDEs ?
  2015-04-27 18:46     ` Nicolas Goaziou
  2015-04-28 15:02       ` Detlef Steuer
@ 2015-04-29 11:42       ` Alan Schmitt
  2015-04-29 15:05         ` Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Alan Schmitt @ 2015-04-29 11:42 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

On 2015-04-27 20:46, Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

>>> Set-up (e.g., link abbreviations) is not refreshed after expanding
>>> INCLUDE keywords. I cannot remember why, tho. Maybe for (dubious)
>>> efficiency reasons.
>>
>> If you don't remember, may be it would be possible to try it out?
>> Would love it and as a feature it looks natural for an included file!
>
> I agree. I added this in 2965f8fb0c048a20b52ba90627e7cca6fe706c93. Thank
> you.

Does this mean that #+INCLUDE is now a superset of #+SETUPFILE (I've had
some cases where I needed to do both)?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: #+LINK abbrevs possible in #+INCLUDEs ?
  2015-04-29 11:42       ` Alan Schmitt
@ 2015-04-29 15:05         ` Nicolas Goaziou
  2015-04-30 11:30           ` Alan Schmitt
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2015-04-29 15:05 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hello,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Does this mean that #+INCLUDE is now a superset of #+SETUPFILE (I've had
> some cases where I needed to do both)?

No, it isn't. 

INCLUDE are expanded only during export. SETUPFILE are read whenever you
open a document or use C-c C-c on a keyword.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: #+LINK abbrevs possible in #+INCLUDEs ?
  2015-04-29 15:05         ` Nicolas Goaziou
@ 2015-04-30 11:30           ` Alan Schmitt
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Schmitt @ 2015-04-30 11:30 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

On 2015-04-29 17:05, Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Does this mean that #+INCLUDE is now a superset of #+SETUPFILE (I've had
>> some cases where I needed to do both)?
>
> No, it isn't. 
>
> INCLUDE are expanded only during export. SETUPFILE are read whenever you
> open a document or use C-c C-c on a keyword.

I see. So is this a correct characterization:

SETUPFILΕ behaves as if all the "#+" lines of the pointed file were in
the current file.

INCLUDE behaves as if all the lines of the pointed file were in the
current file during export.

Hence if a file only has "#+" lines, as in:

--8<---------------cut here---------------start------------->8---
#+author: Programmation Fonctionnelle
#+date: Année 2014-2015
#+options: toc:nil d:RESULTS

#+property: header-args:ocaml :tangle yes

#+LaTeX_CLASS_OPTIONS: [a4paper]
#+latex_header: \usepackage{color}
#+latex_header: \usepackage{minted}
--8<---------------cut here---------------end--------------->8---

then I only need to SETUPFILE it (but I cannot just INCLUDE it because
of the tangle property that needs to be set when the file is opened).

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-30 11:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-27 14:59 #+LINK abbrevs possible in #+INCLUDEs ? Detlef Steuer
2015-04-27 15:49 ` Nicolas Goaziou
2015-04-27 17:55   ` Detlef Steuer
2015-04-27 18:46     ` Nicolas Goaziou
2015-04-28 15:02       ` Detlef Steuer
2015-04-29 11:42       ` Alan Schmitt
2015-04-29 15:05         ` Nicolas Goaziou
2015-04-30 11:30           ` Alan Schmitt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).