Bo Peng wrote:
Symptom:

inset a child document in type include, select a .tex file with
relative path, load. Lyx crashes.

Problem:

In formats.edit(... Filename(file), "text"), file needs to be a full path name.

Patch:

The attached simple patch fixes this. It may also have fixed bug 4107.
 Note that this filename is relative to buffer path.
The patch looks obvious.
Problem:

I think "Load" should be renamed to "Edit". .lyx file is edited in
lyx, and others are edited by 'formats.edit(....)'.
I'd agree but don't care a lot either way.

Richard
Index: src/frontends/controllers/ControlInclude.cpp
===================================================================
--- src/frontends/controllers/ControlInclude.cpp        (revision 19343)
+++ src/frontends/controllers/ControlInclude.cpp        (working copy)
@@ -107,7 +107,7 @@
                kernel().dispatch(FuncRequest(LFUN_BUFFER_CHILD_OPEN, file));
        else
                // tex file or other text file in verbatim mode
-               formats.edit(kernel().buffer(), FileName(file), "text");
+               formats.edit(kernel().buffer(), FileName(makeAbsPath(file,
onlyPath(kernel().buffer().fileName()))), "text");
 }


--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to