auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Small patch for subfiles.el


From: Ikumi Keita
Subject: Re: [AUCTeX-devel] Small patch for subfiles.el
Date: Tue, 21 Feb 2017 03:30:06 +0900

Hi Arash,

> I think this can be fixed by adding

>     (dolist (name TeX-style-path)
>                (TeX-load-style-file (expand-file-name style name)))

> to second condition as well.

Is that really necessary?  On my environment, just replacing
`file-name-base' with `file-name-sans-extension' in subfiles.el seems
enough.  After that replacement, a subfile which has
\documentclass[../../main.tex]{subfiles}
loads ../../auto/main.el, without modifying `TeX-load-style'.

> When invoked as (TeX-load-style "../../main-file.tex") from
> `TeX-run-style-hooks' (with `file-name-sans-extension' as you suggested,
> of course), `TeX-load-style' sees a complex path and starts the second
> condition.  But then, it makes a recursive call to (TeX-load-style
> style) which is (TeX-load-style "main-file").  Now the t condition is
> called and (TeX-load-style-file ...) does not find any auto generated
> file it standard style path since the additions of the first run are
> lost.

I agree most part of this analysis, but the last part
> since the additions of the first run are lost.
does not seem to apply.  The recursive call is done with the variable
`TeX-style-path' assigned a new local value by `let*' statement as
>               (TeX-style-path (append (list (expand-file-name
>                                              TeX-auto-local dir)
>                                             (expand-file-name
>                                              TeX-auto-local master-dir)
>                                             (expand-file-name
>                                              TeX-style-local dir)
>                                             (expand-file-name
>                                              TeX-style-local master-dir))
>                                       TeX-style-path)))
, so the `dolist' loop in the t condition does find
"../../auto/main.el", I think.

I suppose that the problem of the Uwe's comment
> I still don't understand why auctex scans
> \documentclass[../main.tex]{subfiles}
> 
> But not.
> \documentclass[../../main.tex]{subfiles}
will also be resolved by replacing `file-name-base' with
`file-name-sans-extension' in subfiles.el.  That is, both "../main.tex"
case and "../../main.tex" case work correctly.  (On the other hand, I
have no idea why the former worked without that replacement.)

Regards,
Ikumi Keita



reply via email to

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