guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add command line option to quiet compiler messages


From: Andy Wingo
Subject: Re: add command line option to quiet compiler messages
Date: Thu, 14 Jul 2016 12:01:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hi :)

Thanks for the patch!

On Wed 13 Jul 2016 06:08, Tobin Harding <address@hidden> writes:

> While working on this I discovered that compile messages are output from two
> separate places (load.c and boot-9.scm). Each file contains identical strings
> for the messages. This goes against the rule of SPOT.

Sadly it has to be like this for now.  I do not have suggestions to fix
it; it's gnarly.

> -      scm_puts (";;; note: source file ", scm_current_warning_port ());
> -      scm_display (full_filename, scm_current_warning_port ());
> -      scm_puts ("\n;;;       newer than compiled ", scm_current_warning_port 
> ());
> -      scm_display (compiled_filename, scm_current_warning_port ());
> -      scm_puts ("\n", scm_current_warning_port ());
> +      if (scm_is_false (*scm_loc_quiet)) {
> +     scm_puts (";;; note: source file ", scm_current_warning_port ());
> +     scm_display (full_filename, scm_current_warning_port ());
> +     scm_puts ("\n;;;       newer than compiled ", scm_current_warning_port 
> ());
> +     scm_display (compiled_filename, scm_current_warning_port ());
> +     scm_puts ("\n", scm_current_warning_port ());
> +      }
>      }

Please resend without tabs, please.  Thanks :)

>  
>  
> +;;; Don't know where to put these:
> +(define (cond_warn_compiling file)
> +  (unless %quiet
> +    (format (current-warning-port) ";;; compiling ~a\n" file)))
> +
> +(define (cond_warn_compiled file)
> +  (unless %quiet
> +    (format (current-warning-port) ";;; compiled ~a\n" file)))
> +
> +(define (cond_warn_newer new old)
> +  (unless %quiet
> +    (format (current-warning-port)
> +            ";;; note: source file ~a\n;;;       newer than compiled ~a\n"
> +            name go-file-name)))

These definitions are inappropriate for being at the top-level of
boot-9.scm -- they would become automatically a part of all
environments.  I would leave out this change.

Note also that the Guile convention is hyphen-case not snake_case.

> diff --git a/module/ice-9/command-line.scm b/module/ice-9/command-line.scm
> index 98d3855..9a3f7e1 100644
> --- a/module/ice-9/command-line.scm
> +++ b/module/ice-9/command-line.scm
> @@ -136,6 +136,7 @@ If FILE begins with `-' the -s switch is mandatory.
>    --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
> +  --quiet        inhibit compile and load messages
>    --use-srfi=LS  load SRFI modules for the SRFIs in LS,
>                   which is a list of numbers like \"2,13,14\"
>    -h, --help     display this help and exit

What do people think about the name of this command line option?

To me "inhibit compile and load messages" does not quite capture what it
does.  But maybe it is good enough.

Incidentally this change will need a documentation update as well.  I
often find that adding documentation makes it more clear how things
should be named -- that the process of explaining things makes it
apparent what things should be changed :)

> +           ((string=? arg "--quiet")
> +            (set! %quiet #t)
> +            (parse args out))
> +

Probably %quiet should be a parameter, and unless we plan on using it
for other purposes it should have a more specific name
(%verbose-auto-compilation-messages or so; no idea).

Or, you could always just (current-warning-port (%make-void-port "w"));
then the patch is super simple, no conditions needed.  That is what I
was originally thinking, but it has the disadvantage that you lose other
uses of the current warning port, but maybe that's an advantage too.

WDYT?

Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]