LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Wed, 17 Sep 2008 15:51:57 +0100
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
In-Reply-To:
Content-Type:
text/plain; charset=ISO-8859-1
From:
Joseph Wright <[log in to unmask]>
Parts/Attachments:
text/plain (95 lines)
Will Robertson wrote:

>> - The module prefix \err is not really that helpful, as some of the
>> functions are related to information rather than errors: would \msg_ be
>> better (at least for the non-error parts)?
> 
> This is a rather sweeping change but I agree. \msg_ is pretty good, I
> think.

Sorry if I overstated the case.  I should add that \msg follows the dtx
name, whereas \err isn't related at all.  Most of the expl3 modules seem
to follow the dtx name to some extent.

>> - Saving the error messages to file to save memory is not really relevant
>> today, especially as every message needs a tlp in any case.
> 
> AND all my working directories keep being littered with .err files :)

Also true (I wondered where the .err file had appeared from, initially).

> I highly, highly approve of writing out error messages (and even
> warnings) separately.
> I think the interface that we currently has suffices for a lower layer,
> but like you say we need a better "package author" user interface.
> 
> I'd imagine hypothetical commands like this: (note the first argument of
> each)
> 
> ...
> \msg_def:Nnnpnn \msg_log: {fontspec/AREA/TAG1}
>    #1 {Message with arg '#1'}{"Possible Help text"}
> 
> \msg_def:Nnnpnn \msg_info: {fontspec/AREA/TAG2}
>    #1 {Message with arg '#1'}{"Possible Help text"}
> 
> \msg_def:Nnnpnn \msg_warn: {fontspec/AREA/TAG3}
>    #1 {Message with arg '#1'}{"Possible Help text"}
> 
> \msg_def:Nnnpnn \msg_err:  {fontspec/AREA/TAG4}
>    #1 {Message with arg '#1'}{"Possible Help text"}
> ...
> 
> Used inside the package like this:
> 
> \msg_show:nw {fontspec/AREA/TAG1} {<arg>}
> \msg_show:nw {fontspec/AREA/TAG2} {<arg>}
> \msg_show:nw {fontspec/AREA/TAG3} {<arg>}
> \msg_show:nw {fontspec/AREA/TAG4} {<arg>}

Nice idea: much clearer all round than either the expl3 or LaTeX2e
approaches.

> 
> The next important step is that users would then be able to override the
> status of errors. Sick of the warning "fontspec/AREA/TAG3" ? Put this in
> your preamble:
> 
>   \MessageStatus{fontspec/AREA/TAG3}{log}
> 
> or something like that. Similarly, if you're computing ArcTan{1/0} you
> might want
> 
>   \MessageStatus{kernel/math/DivideByZero}{ignore}

Also a good idea: this is something that it is a pain to have to provide
on a per-package basis.

> You could also provide generic "verbose" and "quiet" modes to
> promote/demote all messages by one level.
> 
>   \MessageStatus{warn}{log}
> 
> Or just for particular packages.
> 
>   \MessageStatus{fontspec/*/*, warn}{log}
> 
> 
> (I'm thinking of something like David Kastrup's makematch syntax for
> this first argument in all the examples above. Whatever the syntax is, I
> think you get the idea.)

You could probably miss out the "*", and just have something like:

\MessageStatus{info} % info for everything
\MessageStatus{fontspec = warn}
\MessageStatus{fontspec/AREA = err}
\MessageStatus{/kernel/math/DivideByZero = ignore}

based on a "keys" approach (for example, I think that my suggested
l3keys could probably manage this, or something similar but dedicated).
Of course, this still relies on people creating the messages in the
correct way, but your proposed system for that should be okay.
-- 
Joseph Wright

ATOM RSS1 RSS2