ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* texmfstart fails silently on incorrect input
@ 2006-06-04 17:28 Aditya Mahajan
  2006-06-05  0:50 ` "Guðmundur J. Kristjánsson"
  2006-06-05 16:11 ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Aditya Mahajan @ 2006-06-04 17:28 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texmfstart fails silently on incorrect input
  2006-06-04 17:28 texmfstart fails silently on incorrect input Aditya Mahajan
@ 2006-06-05  0:50 ` "Guðmundur J. Kristjánsson"
  2006-06-05  2:20   ` Aditya Mahajan
  2006-06-05 16:11 ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: "Guðmundur J. Kristjánsson" @ 2006-06-05  0:50 UTC (permalink / raw)


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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texmfstart fails silently on incorrect input
  2006-06-05  0:50 ` "Guðmundur J. Kristjánsson"
@ 2006-06-05  2:20   ` Aditya Mahajan
  2006-06-05 16:01     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2006-06-05  2:20 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texmfstart fails silently on incorrect input
  2006-06-05  2:20   ` Aditya Mahajan
@ 2006-06-05 16:01     ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2006-06-05 16:01 UTC (permalink / raw)


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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texmfstart fails silently on incorrect input
  2006-06-04 17:28 texmfstart fails silently on incorrect input Aditya Mahajan
  2006-06-05  0:50 ` "Guðmundur J. Kristjánsson"
@ 2006-06-05 16:11 ` Hans Hagen
  2006-06-05 16:51   ` Aditya Mahajan
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2006-06-05 16:11 UTC (permalink / raw)


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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texmfstart fails silently on incorrect input
  2006-06-05 16:11 ` Hans Hagen
@ 2006-06-05 16:51   ` Aditya Mahajan
  2006-06-05 17:21     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2006-06-05 16:51 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texmfstart fails silently on incorrect input
  2006-06-05 16:51   ` Aditya Mahajan
@ 2006-06-05 17:21     ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2006-06-05 17:21 UTC (permalink / raw)


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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-06-05 17:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-04 17:28 texmfstart fails silently on incorrect input Aditya Mahajan
2006-06-05  0:50 ` "Guðmundur J. Kristjánsson"
2006-06-05  2:20   ` Aditya Mahajan
2006-06-05 16:01     ` Hans Hagen
2006-06-05 16:11 ` Hans Hagen
2006-06-05 16:51   ` Aditya Mahajan
2006-06-05 17:21     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).