From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20393 invoked by alias); 24 Jan 2010 00:21:11 -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: 27633 Received: (qmail 7873 invoked from network); 24 Jan 2010 00:21:09 -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.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Cc: zsh@benizi.com, schaefer@brasslantern.com, richih.mailinglist@gmail.com, ft@bewatermyfriend.org Subject: PATCH: Add `sourcetrace' option Date: Sun, 24 Jan 2010 01:18:16 +0100 Message-Id: <1264292296-5459-1-git-send-email-ft@bewatermyfriend.org> X-Mailer: git-send-email 1.6.6.rc1.31.g1a56b In-Reply-To: <87y6joz7kf.fsf@ft.bewatermyfriend.org> References: <87y6joz7kf.fsf@ft.bewatermyfriend.org> X-Df-Sender: 430444 Here's an updated patch. Thanks to everyone who reviewed the previous attempts. Regards, Frank --- Doc/Zsh/options.yo | 10 ++++++++++ Src/init.c | 5 +++++ Src/options.c | 1 + Src/zsh.h | 1 + 4 files changed, 17 insertions(+), 0 deletions(-) diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 8c11c82..3f1533f 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -1584,6 +1584,16 @@ Sequences of digits indicating a numeric base such as the `tt(08)' 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) diff --git a/Src/init.c b/Src/init.c index 123e20e..c59d632 100644 --- a/Src/init.c +++ b/Src/init.c @@ -1102,6 +1102,11 @@ source(char *s) return SOURCE_NOT_FOUND; } + if (isset(SOURCETRACE)) { + fprintf(stderr, "sourcetrace> \"%s\"\n", s); + fflush(stderr); + } + /* save the current shell state */ fd = SHIN; /* store the shell input fd */ obshin = bshin; /* store file handle for buffered shell input */ diff --git a/Src/options.c b/Src/options.c index a5f299e..7055466 100644 --- a/Src/options.c +++ b/Src/options.c @@ -233,6 +233,7 @@ static struct optname optns[] = { {{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}, diff --git a/Src/zsh.h b/Src/zsh.h index 060f8a6..f2bab06 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1999,6 +1999,7 @@ enum { SHWORDSPLIT, SINGLECOMMAND, SINGLELINEZLE, + SOURCETRACE, SUNKEYBOARDHACK, TRANSIENTRPROMPT, TRAPSASYNC, -- 1.6.6.rc1.31.g1a56b