Hi, Consider the following source file \edef\x{\jobname} \show\x Run it with pdftex, you get:
\x=macro: ->"foo bar".
With luatex (0.40):
\x=macro: ->foo bar.
This is a problem eg when using LaTeX when it tries to \input\jobname.aux. Regardless of any particular format, there is a consistency problem with pdftex, which should be fixed, imo by making luatex behave the same as pdftex, namely quote the file name in \jobname. Thanks, Manuel.
Manuel Pégourié-Gonnard wrote:
Regardless of any particular format, there is a consistency problem with pdftex, which should be fixed, imo by making luatex behave the same as pdftex, namely quote the file name in \jobname.
There is a consistency problem with the web2c extension that handles filename quoting, yes. I have removed the quotes recently after it became obvious that the quoting mechanism in web2c does not know how to deal with directory separators in font file names properly. I'll think about this some more, but just going back to whatever web2c was doing just because that was what web2c was doing, may not such a good solution. Perhaps we could backport the braced filename support to the rest of web2c ... Best wishes, Taco
Taco Hoekwater a écrit :
There is a consistency problem with the web2c extension that handles filename quoting, yes. I have removed the quotes recently after it became obvious that the quoting mechanism in web2c does not know how to deal with directory separators in font file names properly.
Ok. Isn't it possible to fix web2c quoting mechanism rather than removing the quotes? (Perhaps more a question for texk...)
I'll think about this some more, but just going back to whatever web2c was doing just because that was what web2c was doing, may not such a good solution. Perhaps we could backport the braced filename support to the rest of web2c ...
Why not, I have no opinion about that, as long a the solution you choose doesn't break popular macro packages, such as LaTeX. Thanks, Manuel.
Taco Hoekwater a écrit :
I'll think about this some more, but just going back to whatever web2c was doing just because that was what web2c was doing, may not such a good solution. Perhaps we could backport the braced filename support to the rest of web2c ...
By the way, if you backport braced filename support to web2c (which is imo a good idea), will old-style quoting (like '\input "foo bar".ext') still be supported? Manuel.
Manuel Pégourié-Gonnard wrote:
Taco Hoekwater a écrit :
I'll think about this some more, but just going back to whatever web2c was doing just because that was what web2c was doing, may not such a good solution. Perhaps we could backport the braced filename support to the rest of web2c ...
By the way, if you backport braced filename support to web2c (which is imo a good idea), will old-style quoting (like '\input "foo bar".ext') still be supported?
Yes (there are all sorts of backward compatibility disasters otherwise).
Manuel Pégourié-Gonnard wrote:
Hi,
Consider the following source file
\edef\x{\jobname} \show\x
Run it with pdftex, you get:
\x=macro: ->"foo bar".
With luatex (0.40):
\x=macro: ->foo bar.
This is a problem eg when using LaTeX when it tries to \input\jobname.aux.
Regardless of any particular format, there is a consistency problem with pdftex, which should be fixed, imo by making luatex behave the same as pdftex, namely quote the file name in \jobname.
more sounds like a bug in pdftex to me, luatex also supports {some name} and you don't want {} back then sorry, but luatex is *not* in all aspecets the same as pdftex of course you can just overload jobname if it suits you \let\oldjobname\jobname \def\jobname{"\oldjobname"} Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, Apr 28, 2009 at 12:45:50AM +0200, Taco Hoekwater wrote:
Perhaps we could backport the braced filename support to the rest of web2c ...
On Tue, Apr 28, 2009 at 08:31:04AM +0200, Hans Hagen wrote:
luatex also supports {some name}
According to the documentation braced filenames are supported for
fonts, see 2.7.11 "Font syntax":
\font\myfont = {cmr10}
But neither \input or \openin supports this syntax:
\catcode`\{=1
\catcode`\}=2
\catcode`\#=6
\def\msg#{\immediate\write16}
\openin0={abc def.tex}
\ifeof0 \msg{EOF}\else\msg{OK}\fi
\input{abc def.tex}
\end
File 'abc def.tex' exists, but it isn't found (or other files without spaces
in their name). Result from 'luatex -ini':
! Too many }'s.
l.6 \openin0={abc def.tex}
?
EOF
! I can't find file `{abc'.
l.14 \input{abc
def.tex}
Please type another input file name:
Miss I something?
Generally braced file names would be a nice feature.
Yours sincerely
Heiko
Hans Hagen a écrit :
of course you can just overload jobname if it suits you
\let\oldjobname\jobname \def\jobname{"\oldjobname"}
I guess we'll have to add this in the ini files, but this means that the behaviour of the primitives start to be different from ConTeXt to Plain and LaTeX and I'm not sure it's the best way to go... is it the only solution (of course modifying Plain or LaTeX is not an option...)? -- Elie
Elie Roux wrote:
Hans Hagen a écrit :
of course you can just overload jobname if it suits you
\let\oldjobname\jobname \def\jobname{"\oldjobname"}
I guess we'll have to add this in the ini files, but this means that the behaviour of the primitives start to be different from ConTeXt to Plain
don't worry about that ... if macro packages load each others file at all, then it often happens under strict control (i.e. low level wrapped code) so no user will be affected also, since for instance context had some macro names in use that later showed up as primitives in engines so "primitive names" already behave different anyway (this i snot so much different from name space issues discussed before) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen a écrit :
also, since for instance context had some macro names in use that later showed up as primitives in engines so "primitive names" already behave different anyway
Ok. The only questions remaining are about details: We have to override \jobname for LaTeX, this is not an option, but what about Plain? As I never use it, I don't know if it's common to have \input\jobname.myextention... Also, how should the old \jobname be renamed? Something like luajobname? Thank you, -- Elie
Elie Roux wrote:
Hans Hagen a écrit :
also, since for instance context had some macro names in use that later showed up as primitives in engines so "primitive names" already behave different anyway
Ok. The only questions remaining are about details: We have to override \jobname for LaTeX, this is not an option, but what about Plain? As I never use it, I don't know if it's common to have \input\jobname.myextention...
well, in luatex that's ok then but if pdftex adds "" you'd get \input "some name with spaces".myextention which is strange anyway ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen a écrit :
\input\jobname.myextention...
well, in luatex that's ok then
Hum, unless I'm mistaken that's not ok because while compiling 'foo bar.tex', you get \input foo bar.tex which is likely to complain about a missing foo.tex file.
but if pdftex adds "" you'd get \input "some name with spaces".myextention which is strange anyway
Strange but it "works". Anyway, the best solution indeed would be to have support for \input{\jobname.ext} and adapt existing macro packages. Manuel.
Manuel Pégourié-Gonnard
Hans Hagen a écrit :
\input\jobname.myextention...
well, in luatex that's ok then
Hum, unless I'm mistaken that's not ok because while compiling 'foo bar.tex', you get
\input foo bar.tex
which is likely to complain about a missing foo.tex file.
One somewhat perverse solution would be to have \jobname return catcode 12 tokens only (including the space) and let only catcode 10 spaces finish a file name. Probably a bit obscure, but it would appear to do the trick to me. -- David Kastrup
participants (7)
-
David Kastrup
-
Elie Roux
-
Hans Hagen
-
Heiko Oberdiek
-
Manuel Pégourié-Gonnard
-
taco
-
Taco Hoekwater