>>>>> "Amir" == Amir Karger <[EMAIL PROTECTED]> writes: Amir> This ought to be doable. It turns out that Perl keeps track of Amir> every file that it includes, so when the reLyX executable says Amir> "do reLyXmain.pl", then the hash %INC stores the full pathname Amir> of reLyXmain.pl. Nice. Amir> So, if you're saying that (for the purpose of finding Amir> syntax.default) you want to have a separate lyxdir variable in Amir> reLyXmain.pl, which is calculated from %INC, then yes, I can Amir> tell which directory reLyXmain.pl is in. But at some point, Amir> $lyxdir in the reLyX executable needs to be set by configure! There are two things. It was a mistake from my part to call the two lyxdir... Let's say that reLyXmain.pl will set a variable system_lyxdir (like in lyx itself) which is the place where system files actually are. lyxdir in the wrapper is only saying where to find them if everything else fails. BTW, I guess it is not only syntax.defaults which is concerned. The layout files are found in the same way aren't they? Amir> Although you'll probably argue that that's not necessary, Amir> because we have case 4 in reLyX, which takes the executable path Amir> and adds "../share/lyx/reLyX" to it. But there must be some Amir> reason we put the configure stuff in there in the first place, Amir> no? Sure, as a last chance. It is not supposed to be used if we can do something else. All this discussion should not hide the fact that there is an actual bug in configure which sets lyxdir to bogus values at times :) However, I have no idea how to fix this one... JMarc