From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tobin Harding Newsgroups: gmane.lisp.guile.devel Subject: Re: compiler messages Date: Thu, 7 Jul 2016 22:52:14 +1000 Message-ID: <20160707125214.GA29385@eros.local> References: <20160630105700.GB10380@eros.local> <87h9c168zk.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1467895984 22424 80.91.229.3 (7 Jul 2016 12:53:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2016 12:53:04 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jul 07 14:52:54 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bL8nW-0001r1-Ju for guile-devel@m.gmane.org; Thu, 07 Jul 2016 14:52:54 +0200 Original-Received: from localhost ([::1]:39678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL8nV-0007ol-LF for guile-devel@m.gmane.org; Thu, 07 Jul 2016 08:52:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL8nE-0007od-Rx for guile-devel@gnu.org; Thu, 07 Jul 2016 08:52:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL8nA-0006AS-L2 for guile-devel@gnu.org; Thu, 07 Jul 2016 08:52:35 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:53227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL8n8-00068L-6k for guile-devel@gnu.org; Thu, 07 Jul 2016 08:52:32 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 0B29C20411; Thu, 7 Jul 2016 08:52:18 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 07 Jul 2016 08:52:18 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=tobin.cc; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=b+vSN +AKnA58mdjkKbhyRhK5nW8=; b=aZDFr1ro5A4AgRba/QRpqymO5hCTqBGh1qkje A5w6uXIL4DKkR6HuR+Z9B3zi9VV+ykEZvOkFWNZ8tvOMLhyKgO9yZLcnvrfBkPDw m+YSw3ZpBhAXoIXJhF4g2tOWTmztYAAH38z9UySi/X4L9eu0TiMZPAPK7w+UfGdZ ZMykDQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=b+vSN+AKnA58mdjkKbhyRhK5nW8=; b=cQMyO P9p5sRdgKz+a82mBIh3DON9X11X8Nc125ZUzS2mH7tRq8zEPJDlvSH0ufRoXW8ad QKWS93Gd8tb2VhdgA05bd3ukX+4kdVpOWnc1eCsGHPkcmhQZ5G9cUx2HSlnrc0et XNVYw+LJWi46fwTYrF7rBr6LO5zEVfBv5CbxHM= X-Sasl-enc: rTwAqlhFwmQ87+fHmlJm9LvoQEesEU87n/RSv4CRV7pC 1467895936 Original-Received: from eros.local (ppp121-44-15-3.lns20.syd4.internode.on.net [121.44.15.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E0B2CCDB9; Thu, 7 Jul 2016 08:52:15 -0400 (EDT) Content-Disposition: inline In-Reply-To: <87h9c168zk.fsf@pobox.com> X-Mailer: Mutt 1.6.1 (2016-04-27) User-Agent: Mutt/1.6.1 (2016-04-27) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18473 Archived-At: On Thu, Jul 07, 2016 at 12:25:03PM +0200, Andy Wingo wrote: > On Thu 30 Jun 2016 12:57, Tobin Harding writes: > > > Request for advice as to whether to submit patch? > > Sure, please do. I guess --quiet is the name that is most often asked > for. I've left the option name as I originally wrote it, not to ignore you Andy but simply to get any other feed back on the patch then I will re-submit it. The option --with-compiler-messages is redundant (since its the default behaviour). I added it to be inline with --auto-compile/--no-auto-compile. I have two issues with this patch after developing with a patched Guile for a week or so. First is that I have not been able to pass command line options to Guile while using Geiser, my workaround has been setting the variable %quiet-compiler directly with (set! %quiet-compiler #t) from within ~/.guile. The second, and bigger problem, is that messages are suppressed only for the file that is directly named in the load statement i.e (load "file.scm"). If file.scm has any load statements then when these files are loaded/compiled messages are still output. thanks, Tobin. commit f680d7ca5bfc5c1c88f0789f418fbdc1c84e2ae6 Author: Tobin Harding Date: Thu Jul 7 22:38:16 2016 +1000 Add command line option to quiet compiler messages diff --git a/libguile/load.c b/libguile/load.c index 7ad9a75..901ffe4 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -226,6 +226,9 @@ static SCM *scm_loc_fresh_auto_compile; /* The fallback path for auto-compilation */ static SCM *scm_loc_compile_fallback_path; +/* Whether we output compiler informational messages */ +static SCM *scm_loc_quiet_compiler; + /* Ellipsis: "..." */ static SCM scm_ellipsis; @@ -1349,7 +1352,9 @@ scm_init_load () = SCM_VARIABLE_LOC (scm_c_define ("%load-should-auto-compile", SCM_BOOL_F)); scm_loc_fresh_auto_compile = SCM_VARIABLE_LOC (scm_c_define ("%fresh-auto-compile", SCM_BOOL_F)); - + scm_loc_quiet_compiler + = SCM_VARIABLE_LOC (scm_c_define ("%quiet-compiler", SCM_BOOL_F)); + scm_ellipsis = scm_from_latin1_string ("..."); the_reader = scm_make_fluid_with_default (SCM_BOOL_F); diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index 6eae844..034bc72 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -3755,17 +3755,20 @@ when none is available, reading FILE-NAME with READER." (load-thunk-from-file go-file-name) (begin (when gostat - (format (current-warning-port) - ";;; note: source file ~a\n;;; newer than compiled ~a\n" - name go-file-name)) + (or %quiet-compiler + (format (current-warning-port) + ";;; note: source file ~a\n;;; newer than compiled ~a\n" + name go-file-name))) (cond (%load-should-auto-compile (%warn-auto-compilation-enabled) - (format (current-warning-port) ";;; compiling ~a\n" name) + (or %quiet-compiler + (format (current-warning-port) ";;; compiling ~a\n" name)) (let ((cfn (compile name))) - (format (current-warning-port) ";;; compiled ~a\n" cfn) + (or %quiet-compiler + (format (current-warning-port) ";;; compiled ~a\n" cfn)) (load-thunk-from-file cfn))) - (else #f))))) + (else #f))))) #:warning "WARNING: compilation of ~a failed:\n" name)) (define (sans-extension file) diff --git a/module/ice-9/command-line.scm b/module/ice-9/command-line.scm index 98d3855..77ecf71 100644 --- a/module/ice-9/command-line.scm +++ b/module/ice-9/command-line.scm @@ -133,6 +133,9 @@ If FILE begins with `-' the -s switch is mandatory. --no-auto-compile disable automatic source file compilation; default is to enable auto-compilation of source files. + --with-compiler-messages show informational messages when compiling. + --without-compiler-messages do not show informational messages when + compiling. --listen[=P] listen on a local port or a path for REPL clients; if P is not given, the default is local port 37146 -q inhibit loading of user init file @@ -358,6 +361,14 @@ If FILE begins with `-' the -s switch is mandatory. (set! inhibit-user-init? #t) (parse args out)) + ((string=? arg "--with-compiler-messages") + (set! %quiet-compiler #f) + (parse args out)) + + ((string=? arg "--without-compiler-messages") + (set! %quiet-compiler #t) + (parse args out)) + ((string-prefix? "--use-srfi=" arg) (let ((srfis (map (lambda (x) (let ((n (string->number x))) @@ -407,7 +418,7 @@ If FILE begins with `-' the -s switch is mandatory. (exit 0)) (else - (error "unrecognized switch ~a" arg))))))) + (error "EDIT: unrecognized switch ~a" arg))))))) (define (finish args out) ;; Check to make sure the -ds got a -s.