texmfstart fails silently on incorrect input
Hi, when I try texmfstart whatever nothing happens. Shouldn't a warning or an error be given to say that texmfstart could not find 'whatever'. This will make it easier to detect typos while trying out commands by hand. I do get such a message when using texmfstart --verbose whatever, but I think that such a behaviour should be default. Hans, is it reasonable to define a method report_error(str) in class KpseRemote def report_error(str) $stderr.puts(str) end end and modify line 2110 of texmfstart.rb to def run(fullname) if ! fullname || fullname.empty? then %%% report("the file '#{$filename}' is not found") report_error("the file '#{$filename}' is not found") ..... Maybe there are other places also where an error report will be useful. Aditya
Hi all. Just a quick note regarding "silentness" in Context. I have on two occasions had problems with silent errors: 1) When using the bib module and putting spaces between citation variables and their value. For example, doing: \startpublication[k = ArcticCorsairTrawling, t = misc] instead of \startpublication[k=ArcticCorsairTrawling, t=misc] 2) When trying to define an abstract command: \definestartstop [abstract] [before={\midaligned{\bf Abstract} \startnarrower[2*middle]}, after={\stopnarrower \blank[big]}] In this case the command was defined when I used "...before = ..." but did not alter the text in any way. So after all this rambling I have two questions: 1) Is this silent mode intended? 2) Is whitespace not allowed before or after when defining with or using the "=" sign? Best regards/Kær kveðja, Guðmundur J. Kristjánsson gjk@vitum.net | gjk@hi.is | Tel. +354-893-4444. Aditya Mahajan wrote:
Hi,
when I try
texmfstart whatever
nothing happens. Shouldn't a warning or an error be given to say that texmfstart could not find 'whatever'. This will make it easier to detect typos while trying out commands by hand.
I do get such a message when using texmfstart --verbose whatever, but I think that such a behaviour should be default.
Hans, is it reasonable to define a method report_error(str) in
class KpseRemote def report_error(str) $stderr.puts(str) end end
and modify line 2110 of texmfstart.rb to
def run(fullname) if ! fullname || fullname.empty? then %%% report("the file '#{$filename}' is not found") report_error("the file '#{$filename}' is not found") .....
Maybe there are other places also where an error report will be useful.
Aditya
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
On Mon, 5 Jun 2006, "Guðmundur J. Kristjánsson" wrote:
Just a quick note regarding "silentness" in Context.
I have on two occasions had problems with silent errors:
1) When using the bib module and putting spaces between citation variables and their value. For example, doing:
\startpublication[k = ArcticCorsairTrawling, t = misc]
instead of
\startpublication[k=ArcticCorsairTrawling, t=misc]
2) When trying to define an abstract command: \definestartstop [abstract] [before={\midaligned{\bf Abstract} \startnarrower[2*middle]}, after={\stopnarrower \blank[big]}]
In this case the command was defined when I used "...before = ..." but did not alter the text in any way.
So after all this rambling I have two questions: 1) Is this silent mode intended?
No, this is the usual behaviour.
2) Is whitespace not allowed before or after when defining with or using the "=" sign?
Parially, space after = is fine, space before = is ignored silently. This is because with \dosetvalue {one}{a}{ b} \onea is defined, while with \dosetvalue {one}{a }{ b} \onea is undefined. Hans, can \dosetvalue be defined to ignore the space of #2, something like \unprotect \def\dosetvalue#1#2#3% {\dodosetvalue{#1}[#2]#3} \def\dodosetvalue#1[#2#3]#4% {\doifelse{#3}{\space} {\@EA\def\csname#1#2\endcsname{#4}} {\@EA\def\csname#1#2#3\endcsname{#4}}} With this \dosetvalue {one}{a }{ b} (\onea) works, but this does not work for \definestartstop [abstract] [before = {{\bf Abstract}}] I do not know the implication in terms of speed. In case there is a heavy penality, one can have a switch to ignore spaces in value assignments. Aditya
Aditya Mahajan wrote:
2) Is whitespace not allowed before or after when defining with or using the "=" sign?
Parially, space after = is fine, space before = is ignored silently.
changing that would break things (esp when a space is set this way, and not using \space)
This is because with
\dosetvalue {one}{a}{ b}
\onea is defined,
while with
\dosetvalue {one}{a }{ b} \onea is undefined.
Hans, can \dosetvalue be defined to ignore the space of #2, something like
\unprotect \def\dosetvalue#1#2#3% {\dodosetvalue{#1}[#2]#3}
\def\dodosetvalue#1[#2#3]#4% {\doifelse{#3}{\space} {\@EA\def\csname#1#2\endcsname{#4}} {\@EA\def\csname#1#2#3\endcsname{#4}}}
With this
\dosetvalue {one}{a }{ b} (\onea)
works, but this does not work for
\definestartstop [abstract] [before = {{\bf Abstract}}]
indeed; if supported, this would have to take place in the comma list parser and the base assignment which would slow down things a lot
I do not know the implication in terms of speed. In case there is a heavy penality, one can have a switch to ignore spaces in value assignments.
hm, maybe some day (such changes would demand much testing) and will be easier to do once we have lua enhanced tex (end of year) 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 -----------------------------------------------------------------
Aditya Mahajan wrote:
Hi,
when I try
texmfstart whatever
nothing happens. Shouldn't a warning or an error be given to say that texmfstart could not find 'whatever'. This will make it easier to detect typos while trying out commands by hand.
I do get such a message when using texmfstart --verbose whatever, but I think that such a behaviour should be default.
Hans, is it reasonable to define a method report_error(str) in
class KpseRemote def report_error(str) $stderr.puts(str) end end
and modify line 2110 of texmfstart.rb to
def run(fullname) if ! fullname || fullname.empty? then %%% report("the file '#{$filename}' is not found") report_error("the file '#{$filename}' is not found") .....
Maybe there are other places also where an error report will be useful.
there is the non-verbose checking def output(str) $stdout.puts(str) end so we can use output("the file '#{$filename}' is not found") (i dislike stderr -) 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 Mon, 5 Jun 2006, Hans Hagen wrote:
Aditya Mahajan wrote:
Hi,
when I try
texmfstart whatever
nothing happens. Shouldn't a warning or an error be given to say that texmfstart could not find 'whatever'. This will make it easier to detect typos while trying out commands by hand.
I do get such a message when using texmfstart --verbose whatever, but I think that such a behaviour should be default.
Hans, is it reasonable to define a method report_error(str) in
class KpseRemote def report_error(str) $stderr.puts(str) end end
and modify line 2110 of texmfstart.rb to
def run(fullname) if ! fullname || fullname.empty? then %%% report("the file '#{$filename}' is not found") report_error("the file '#{$filename}' is not found") .....
Maybe there are other places also where an error report will be useful.
there is the non-verbose checking
def output(str) $stdout.puts(str) end
so we can use
output("the file '#{$filename}' is not found")
this will be fine.
(i dislike stderr -)
Any particular reason? Aditya
Aditya Mahajan wrote:
On Mon, 5 Jun 2006, Hans Hagen wrote:
Aditya Mahajan wrote:
Hi,
when I try
texmfstart whatever
nothing happens. Shouldn't a warning or an error be given to say that texmfstart could not find 'whatever'. This will make it easier to detect typos while trying out commands by hand.
I do get such a message when using texmfstart --verbose whatever, but I think that such a behaviour should be default.
Hans, is it reasonable to define a method report_error(str) in
class KpseRemote def report_error(str) $stderr.puts(str) end end
and modify line 2110 of texmfstart.rb to
def run(fullname) if ! fullname || fullname.empty? then %%% report("the file '#{$filename}' is not found") report_error("the file '#{$filename}' is not found") .....
Maybe there are other places also where an error report will be useful.
there is the non-verbose checking
def output(str) $stdout.puts(str) end
so we can use
output("the file '#{$filename}' is not found")
this will be fine.
(i dislike stderr -)
Any particular reason?
mostly that it takes more work to collect both when piping (to a log file) and so, either i want to see messages or not and verbose can control that 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 -----------------------------------------------------------------
participants (3)
-
"Guðmundur J. Kristjánsson"
-
Aditya Mahajan
-
Hans Hagen