From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: I can't change startitemize[n]--> startitemize[1]
Date: Thu, 23 Jul 2009 11:52:58 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.00.0907231144340.11304@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <3771A7EB-58A6-4A0A-8AA2-C733BC889781@gmail.com>
On Thu, 23 Jul 2009, Wolfgang Schuster wrote:
>
> Am 23.07.2009 um 17:05 schrieb Aditya Mahajan:
>
>> I think an easier thing to do will be to follow latex's style of
>> \newcommand and \renewcommand. That is, all \definecommands should check if
>> the macro is previously defined or not. If it is defined, issue a warning
>> or an error.
>
> There is \define and \redefine.
I know. What I am asking is that the core macros like \definedescription,
\defineitemgroups, \definehead, which have the general form
\def\defineSOMETHING%
{\dodoubleargument\dodefineSOMETHING}
\def\dodefineSOMETHING[#1][#2]%
{\setvalue{#1}{\dododefineSOMETHING[#2]}
should do some check before the \setvalue. Maybe a universal solution will
be to change \setvalue so that it uses \define (or a check like define)
internally.
>> And maybe have some hook to disable the warning/error for those who know
>> what they are doing.
>
> In this case you can use \def, \edef ...
I meant with commands like \defineSOMETHING above. For example, I once did
\definecolor[page][s=0.9] instead of what I normally do:
\definecolor[pagecolor][s=0.9]. Took a while to figure out what was going
wrong. Some of Xan's error were due to similar things,
\defineSOMETHING[note], \defineSOMETHING[symbol], etc. If all these
commands issued a warning that you are redefining existing macro,
debugging will be much easier. And if you know what you are doing, we
could have
\redefinecolor[page][s=0.9]
that does not issue a warning. Or the easier to implemnet:
\setupcolors[check=error|warn|ignore]
for all \setupSOMETHING commands where the equivalent \defineSOMETHING
defines a control sequence.
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2009-07-23 15:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 12:06 Xan
2009-07-23 12:45 ` Wolfgang Schuster
2009-07-23 14:05 ` Hans Hagen
2009-07-23 14:33 ` Xan
2009-07-23 14:37 ` Hans Hagen
2009-07-23 14:48 ` luigi scarso
2009-07-23 14:58 ` Wolfgang Schuster
2009-07-23 15:05 ` luigi scarso
2009-07-23 15:10 ` Wolfgang Schuster
2009-07-23 15:16 ` luigi scarso
2009-07-23 15:26 ` luigi scarso
2009-07-23 15:33 ` Wolfgang Schuster
2009-07-23 15:46 ` luigi scarso
2009-07-23 15:05 ` Aditya Mahajan
2009-07-23 15:11 ` luigi scarso
2009-07-23 15:16 ` Wolfgang Schuster
2009-07-23 15:52 ` Aditya Mahajan [this message]
2009-07-23 15:57 ` luigi scarso
2009-07-23 16:04 ` Hans Hagen
2009-07-23 15:42 ` Xan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.00.0907231144340.11304@ybpnyubfg.ybpnyqbznva \
--to=adityam@umich.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).