From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88409 Path: news.gmane.org!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Re: \resetsetups Date: Thu, 14 Aug 2014 14:23:28 -0400 Message-ID: <53ECFEA0.2060609@rik.users.panix.com> References: <53EBB4C2.2020905@rik.users.panix.com> <03025B92-D74E-4A40-BF5C-BDC99B4743C6@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1070173559==" X-Trace: ger.gmane.org 1408040643 25066 80.91.229.3 (14 Aug 2014 18:24:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2014 18:24:03 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 14 20:23:58 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XHzgr-0003jb-SZ for gctc-ntg-context-518@m.gmane.org; Thu, 14 Aug 2014 20:23:57 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6B2B6102B9 for ; Thu, 14 Aug 2014 20:23:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Je8F91ALlCOS for ; Thu, 14 Aug 2014 20:23:57 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B975410224 for ; Thu, 14 Aug 2014 20:23:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 76A66101EE for ; Thu, 14 Aug 2014 20:23:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MjSuTp5qzaYJ for ; Thu, 14 Aug 2014 20:23:41 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 6699D101E2 for ; Thu, 14 Aug 2014 20:23:41 +0200 (CEST) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s7EINX2P029424 for ; Thu, 14 Aug 2014 20:23:39 +0200 Original-Received: from [192.168.9.122] (pool-71-183-246-109.nycmny.fios.verizon.net [71.183.246.109]) by mailbackend.panix.com (Postfix) with ESMTP id CB1B52EAAC for ; Thu, 14 Aug 2014 14:23:32 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: <03025B92-D74E-4A40-BF5C-BDC99B4743C6@gmail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=166.84.1.89; country=US; region=New York; city=Richmond Hill; latitude=40.7005; longitude=-73.8345; http://maps.google.com/maps?q=40.7005,-73.8345&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RMCGnygu - 652c981e712a - 20140814 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:88409 Archived-At: This is a multi-part message in MIME format. --===============1070173559== Content-Type: multipart/alternative; boundary="------------020006070006040305090202" This is a multi-part message in MIME format. --------------020006070006040305090202 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable On 2014-08-14 00:26, Wolfgang Schuster wrote: > > Am 13.08.2014 um 20:56 schrieb Rik Kabel >: > >> Dear list, >> >> In a number of notes (recent and in the list archive) I have seen=20 >> \resetsetups, used (always) as in a block of code like this from=20 >> Gerben Wierde: >> >> \startsetups chapter:before >> \page[left] >> \noheaderandfooterlines >> \startalignment[left,nothyphenated] >> \startnarrower[4*left] >> \em \getbuffer[chapter:quote] >> \stopnarrower >> \stopalignment >> \resetsetups[quote:text] >> \page[right] >> \noheaderandfooterlines >> \blank[force,2*big] >> \stopsetups >> >> >> What is the purpose of \resetsetups in this code? I see no different=20 >> result without it, and all I can determine from list and document=20 >> searches is that this is a vestigal command from x-fo processing. > > With the \resetsetups command you can remove a previously created=20 > setups environment. As you can see from the following example=20 > =93mysetups=94 doesn=92t exist anymore after the \resetsetups command. > > \startsetups[mysetups] > Dummy text. > \stopsetups > > \starttext > > \doifsetupselse{mysetups}{YES}{NO} > > \resetsetups[mysetups] > > \doifsetupselse{mysetups}{YES}{NO} > > \stoptext > > Wolfgang > Thank you again, Wolfgang. I notice that, while the _contents_ of the setup are removed, and using=20 the reset setup introduces nothing into the text, there is no error or=20 warning generated. (This is also the case, I learned, with an undefined=20 buffer.) I can see that this can be very useful in a number of situations= . Can \resetsetups reset more than one setup in a single execution? When I=20 try \resetsetups[setupA,setupB] it appears to reset neither. I only ask=20 because of the plural name. It does not appear to be a burden to use=20 multiple \resetsetups commands. Are there equivalent commands to \resetsetups and \doifsetupelse for=20 buffers? I could find nothing obvious. The following example shows what I mean by the above statements. My=20 examples are often clearer than my descriptions. \starttext \subject{test 1} \startsetups[mysetups] YES \stopsetups 1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO} \resetsetups[mysetups] 2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO} \startsetups[mysetups] yes \stopsetups 3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO} \subject{test 2} \startsetups[mysetups] YES \resetsetups[mysetups] \stopsetups 1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO} 2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO} \startsetups[mysetups] yes \resetsetups[mysetups] \stopsetups 3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO} \subject{test 3} \startsetups[mysetups] YES \stopsetups 1. =A6\setup[mysetups]=A6 \resetsetups[mysetups] 2. =A6\setup[mysetups]=A6 \startsetups[mysetups] yes \stopsetups 3. =A6\setup[mysetups]=A6 \subject{test 4} \startsetups[mysetups] YES \resetsetups[mysetups] \stopsetups 1. =A6\setup[mysetups]=A6 2. =A6\setup[mysetups]=A6 \startsetups[mysetups] yes \resetsetups[mysetups] \stopsetups 3. =A6\setup[mysetups]=A6 \subject{test 5} 1. =A6\setup[neverdefined]=A6 2. =A6\getbuffer[neverdefined]=A6 \subject{test 6} \startsetups[mysetupstwo] , SIR! \stopsetups \startsetups[mysetups] YES \stopsetups 1. =A6\setup[mysetups]\setup[mysetupstwo]=A6 \resetsetups[mysetups,mysetupstwo] 2. =A6\setup[mysetups]\setup[mysetupstwo]=A6 \stoptext --=20 Rik Kabel --------------020006070006040305090202 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
On 2014-08-14 00:26, Wolfgang Schuster wrote:

Am 13.08.2014 um 20:56 schrieb Rik Kabel <context@rik.users= .panix.com>:

Dear list,

In a number of notes (recent and in the list archive) I have seen \resetsetups, used (always) as in a block of code like this from Gerben Wierde:
\startsetups chapter:before
  \page[left]
  \noheaderandfooterlines
  \startalignment[left,nothyphenated]
	\startnarrower[4*left]
	    \em \getbuffer[chapter:quote]
	\stopnarrower
  \stopalignment
  \resetsetups[quote:text]
  \page[right]
  \noheaderandfooterlines
  \blank[force,2*big]
\stopsetups

What is the purpose of \resetsetups in this code? I see no different result without it, and all I can determine from list and document searches is that this is a vestigal command from x-fo processing.

With the \resetsetups command you can remove a previously created setups environment. As you can see from the following example =93mysetups=94 doesn=92t exist anymore after the \resetse= tups command.

\startsetups[mysetups]
=A0 Dummy text.
\stopsetups

\starttext

\doifsetupselse{mysetups}{YES}{NO}

\resetsetups[mysetups]

\doifsetupselse{mysetups}{YES}{NO}

\stoptext

Wolfgang

Thank you again, Wolfgang.

I notice that, while the _contents_ of the setup are removed, and using the reset setup introduces nothing into the text, there is no error or warning generated. (This is also the case, I learned, with an undefined buffer.) I can see that this can be very useful in a number of situations.

Can \resetsetups reset more than one setup in a single execution? When I try \resetsetups[setupA,setupB] it appears to reset neither. I only ask because of the plural name. It does not appear to be a burden to use multiple \resetsetups commands.

Are there equivalent commands to \resetsetups and \doifsetupelse for buffers? I could find nothing obvious.

The following example shows what I mean by the above statements. My examples are often clearer than my descriptions.
\starttext

\subject{test 1}

\startsetups[mysetups]
=A0 YES
\stopsetups

1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

\resetsetups[mysetups]

2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

\startsetups[mysetups]
=A0 yes
\stopsetups

3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

\subject{test 2}

\startsetups[mysetups]
=A0 YES
=A0 \resetsetups[mysetups]
\stopsetups

1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

\startsetups[mysetups]
=A0 yes
=A0 \resetsetups[mysetups]
\stopsetups

3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

\subject{test 3}

\startsetups[mysetups]
=A0 YES
\stopsetups

1. =A6\setup[mysetups]=A6

=A0 \resetsetups[mysetups]

2. =A6\setup[mysetups]=A6

\startsetups[mysetups]
=A0 yes
\stopsetups

3. =A6\setup[mysetups]=A6

\subject{test 4}

\startsetups[mysetups]
=A0 YES
=A0 \resetsetups[mysetups]
\stopsetups

1. =A6\setup[mysetups]=A6

2. =A6\setup[mysetups]=A6

\startsetups[mysetups]
=A0 yes
=A0 \resetsetups[mysetups]
\stopsetups

3. =A6\setup[mysetups]=A6

\subject{test 5}

1. =A6\setup[neverdefined]=A6

2.=A0 =A6\getbuffer[neverdefined]=A6

\subject{test 6}

\startsetups[mysetupstwo]
=A0 , SIR!
\stopsetups

\startsetups[mysetups]
=A0 YES
\stopsetups

1. =A6\setup[mysetups]\setup[mysetupstwo]=A6

=A0 \resetsetups[mysetups,mysetupstwo]

2. =A6\setup[mysetups]\setup[mysetupstwo]=A6

\stoptext

--
Rik Kabel
--------------020006070006040305090202-- --===============1070173559== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1070173559==--