From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4544 invoked by alias); 24 Jan 2010 21:37:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27638 Received: (qmail 17004 invoked from network); 24 Jan 2010 21:37:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.31 as permitted sender) Date: Sun, 24 Jan 2010 21:12:40 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Cc: zsh@benizi.com, schaefer@brasslantern.com, richih.mailinglist@gmail.com Subject: Re: PATCH: Add `sourcetrace' option Message-ID: <20100124211240.3d84f802@pws-pc> In-Reply-To: <1264292296-5459-1-git-send-email-ft@bewatermyfriend.org> References: <87y6joz7kf.fsf@ft.bewatermyfriend.org> <1264292296-5459-1-git-send-email-ft@bewatermyfriend.org> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.16.6; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=W3tOLUehizD4qj6VhtReFuw5MKb8d+XqjIxlDsIazEA= c=1 sm=0 a=02rWKl3eAAAA:8 a=NLZqzBF-AAAA:8 a=WIYsQbjVpgT8dBWW7BIA:9 a=H9uevLRbwAwm7uIGnnsA:7 a=WY1RBD1nQeOCqcMsON22Hkr2rdAA:4 a=iVFYgQKhOj0A:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Sun, 24 Jan 2010 01:18:16 +0100 Frank Terbeck wrote: > Here's an updated patch. Thanks to everyone who reviewed the previous > attempts. I'm just toying with this variant... the difference is this moves the output down until after the script name etc. is set up, and uses PS4 (like the xtrace option), so the output is more configurable. For example, I get: +/etc/zshenv:1> +/home/pws/.zshenv:1> +/home/pws/.profile:1> +/home/pws/.zshrc:1> /home/pws/.aliasrc:1:> /home/pws/.compinstall:1:> /home/pws/.zcompdump_4.3.10-dev-1_pws:1:> (the change in the middle is because I tweak PS4 to remove the "+" in .zshrc, for no good reason I can now think of, as well as adding %_, and there's only one global file because .zshenv sets NO_GLOBAL_RCS.) I'm not particularly set on this but it seems more powerful without losing anything obvious. The documentation would need tweaking. Index: Doc/Zsh/options.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v retrieving revision 1.88 diff -u -r1.88 options.yo --- Doc/Zsh/options.yo 13 Jan 2010 12:05:48 -0000 1.88 +++ Doc/Zsh/options.yo 24 Jan 2010 21:10:31 -0000 @@ -1584,6 +1584,16 @@ component in `tt(08#77)' are always interpreted as decimal, regardless of leading zeroes. ) +pindex(SOURCE_TRACE) +pindex(NO_SOURCE_TRACE) +pindex(SOURCETRACE) +pindex(NOSOURCETRACE) +item(tt(SOURCE_TRACE))( +If set, zsh will print an informational message announcing the name of +each file it loads. A file may be loaded by the shell itself when it +starts up and shuts down (tt(Startup/Shutdown Files)) or by the use of +the `tt(source)' and `tt(dot)' builtin commands. +) pindex(TYPESET_SILENT) pindex(NO_TYPESET_SILENT) pindex(TYPESETSILENT) Index: Src/init.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/init.c,v retrieving revision 1.108 diff -u -r1.108 init.c --- Src/init.c 16 Dec 2009 18:39:07 -0000 1.108 +++ Src/init.c 24 Jan 2010 21:10:31 -0000 @@ -1126,6 +1126,11 @@ scriptname = s; scriptfilename = s; + if (isset(SOURCETRACE)) { + printprompt4(); + fprintf(xtrerr ? xtrerr : stderr, "\n"); + } + /* * The special return behaviour of traps shouldn't * trigger in files sourced from traps; the return Index: Src/options.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/options.c,v retrieving revision 1.52 diff -u -r1.52 options.c --- Src/options.c 13 Jan 2010 12:05:49 -0000 1.52 +++ Src/options.c 24 Jan 2010 21:10:31 -0000 @@ -233,6 +233,7 @@ {{NULL, "shwordsplit", OPT_EMULATE|OPT_BOURNE}, SHWORDSPLIT}, {{NULL, "singlecommand", OPT_SPECIAL}, SINGLECOMMAND}, {{NULL, "singlelinezle", OPT_KSH}, SINGLELINEZLE}, +{{NULL, "sourcetrace", 0}, SOURCETRACE}, {{NULL, "sunkeyboardhack", 0}, SUNKEYBOARDHACK}, {{NULL, "transientrprompt", 0}, TRANSIENTRPROMPT}, {{NULL, "trapsasync", 0}, TRAPSASYNC}, Index: Src/zsh.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v retrieving revision 1.161 diff -u -r1.161 zsh.h --- Src/zsh.h 19 Jul 2009 19:08:54 -0000 1.161 +++ Src/zsh.h 24 Jan 2010 21:10:32 -0000 @@ -1999,6 +1999,7 @@ SHWORDSPLIT, SINGLECOMMAND, SINGLELINEZLE, + SOURCETRACE, SUNKEYBOARDHACK, TRANSIENTRPROMPT, TRAPSASYNC, -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/