From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/63109 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Stop with an error signal Date: Sun, 31 Oct 2010 00:44:19 -0400 (EDT) Message-ID: References: <1DE1D6A3-7A98-4981-96DF-C554172E9FF4@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1288500256 20782 80.91.229.12 (31 Oct 2010 04:44:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 31 Oct 2010 04:44:16 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 31 05:44:12 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PCPm7-0004i9-HF for gctc-ntg-context-518@m.gmane.org; Sun, 31 Oct 2010 05:44:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5E63FCA7F6; Sun, 31 Oct 2010 05:44:10 +0100 (CET) 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 0tSUaqpf7L3j; Sun, 31 Oct 2010 05:44:07 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 50599CA7F2; Sun, 31 Oct 2010 05:44:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8A313CA7F2 for ; Sun, 31 Oct 2010 05:44:05 +0100 (CET) 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 2CrCzE8ILGmI for ; Sun, 31 Oct 2010 05:43:54 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 2678BCA7E7 for ; Sun, 31 Oct 2010 05:43:54 +0100 (CET) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9V4hpxF024518 for ; Sun, 31 Oct 2010 05:43:53 +0100 Original-Received: FROM adi-laptop (bas3-montreal02-1096680238.dsl.bell.ca [65.94.3.46]) By tombraider.mr.itd.umich.edu ID 4CCCF406.5BA58.10383 ; Authuser adityam; 31 Oct 2010 00:43:50 EDT In-Reply-To: <1DE1D6A3-7A98-4981-96DF-C554172E9FF4@gmail.com> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.12.86; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06DpgHQcW - 4773716fcdd2 - 20101031 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:63109 Archived-At: On Sun, 31 Oct 2010, Wolfgang Schuster wrote: > > Am 31.10.2010 um 01:27 schrieb Aditya Mahajan: > >> Hi, >> >> I want to write a macro that checks for some settings and if the settings are wrong stop the current compilation and terminate with an error message. Right now I have >> >> \def\ERROR >> {\writeline >> \showmessage\??externalfilter??{forbidden}\getexternalfilterdirectory >> \batchmode >> \normalend} >> >> This prints the error message on the terminal and exits. However the exit status (the value of $?) is 0, if the tui file has changed the document is compiled a second time anyways. >> >> How can I force context (the macro package) to exit with a status of 1 so that context (the program) does not attempt a second compilation? > > \starttext > > one > > \scrollmode\undefined\forcequitjob{bye} > > two > > \stoptext \forcequitjob is defined in the same manner as my definition \def\forcequitjob#1% {\writestatus\m!systems{forcing quit: #1}% \batchmode \dorecurse\textlevel{\stoptext} \normalend} and suffers from the same problem. It does not send the program's error code to 1. After compiling \starttext \forcequitjob{bye} \stoptext the output of `echo $?` is 0, so context thinks that the program compiled sucessfully. Now add \section{one} on the first line and compile again. Context does two runs of the program (because no error signal is generated at the end of the first run). I want to avoid this second run. 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________