all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: David Reitter <david.reitter@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: General variable for verbosity level. (was: saveplace: don't ask for coding system)
Date: Sun, 02 Dec 2007 17:04:27 -0800	[thread overview]
Message-ID: <877ijwlhb8.fsf_-_@red-bean.com> (raw)
In-Reply-To: <6C0C2889-2C17-4E5C-BDB3-CB4F51BE163A@gmail.com> (David Reitter's message of "Thu\, 29 Nov 2007 00\:25\:29 +0000")

David Reitter <david.reitter@gmail.com> writes:
> I wonder if this hasn't come up before: could we not have a global
> verbosity level? If it is well-defined, all parts including modes
> could respect it.
>
> One could have an optional argument to `message', indicating the level
> of the particular message.

In this change:

   http://cvs.savannah.gnu.org/viewvc/emacs/lisp/saveplace.el?root=emacs&r1=1.38&r2=1.39

...I added a boolean that tells saveplace.el whether or not to print
loading/saving messages.  David Reitter rightly points out that it
would make more sense to have this be a generic variable that many
packages in Emacs could use.  For example, it could subsume these two:

  gmm-message
  Function: If LEVEL is lower than `gmm-verbose' print ARGS using `message'.

  gnus-message
  Function: If LEVEL is lower than `gnus-verbose' print ARGS using `message'.

(No doubt there are other examples elsewhere in Emacs.)

The purpose of this email is to figure out whether/how we should
implement such a system.  Proposal: a new function and new variable:

   maybe-message LEVEL FORMAT_STRING &optional FORMAT_ARGS
   Function: Print FORMAT_STRING formatted with FORMAT_ARGS iff LEVEL
             is equal to or higher than `message-verbosity-level'.

   message-verbosity-level
   Variable: Say which messages are printed by `maybe-message' (which see)
             in non-interactive contexts.

For interactive functions, `maybe-message' should behave just like
`message' does today.  But should `message-verbosity-level' be a
number, or something else?  It could be, for example, a symbol:

   message-verbosity-level:
     `none'       ==>  print no messages (except errors)
     `important'  ==>  print only important messages
     `regular'    ==>  ...

This has the advantages of being clearer to users, and of allowing us
to cleanly insert new verbosity levels in the future.

I'm avoiding proposing a system of overlapping categories; that is,
where you'd set the variable to a list of symbols, and maybe-message
would print iff the level specified by the code matched any of them.
While that would be the most flexible system, I'm not sure we really
need that level of complexity here.

Please comment.  Feel free to trash this system in favor of something
entirely different -- I'm not wedded to it, I'm just trying to get the
conversation started.

-Karl

  reply	other threads:[~2007-12-03  1:04 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28 14:46 saveplace: don't ask for coding system David Reitter
2007-11-28 21:47 ` Eli Zaretskii
2007-11-29  0:25   ` David Reitter
2007-12-03  1:04     ` Karl Fogel [this message]
2007-12-03 20:22       ` General variable for verbosity level. (was: saveplace: don't ask for coding system) David Reitter
2007-12-03 21:44         ` General variable for verbosity level Karl Fogel
2007-12-03 22:34       ` Reiner Steib
2007-11-29  9:04   ` saveplace: don't ask for coding system Juanma Barranquero
2007-11-29 21:04     ` Eli Zaretskii
2007-11-30  9:17       ` Juanma Barranquero
2007-11-29  9:05 ` Juanma Barranquero
2007-12-02 16:51   ` David Reitter
2007-12-02 21:26     ` Karl Fogel
2007-12-02 21:31       ` David Reitter
2007-12-02 23:23         ` Karl Fogel
2007-12-03  4:18           ` Eli Zaretskii
2007-12-03 10:59             ` Karl Fogel
2007-12-03 11:06               ` Juanma Barranquero
2007-12-03 21:02                 ` Stephen J. Turnbull
2007-12-03 20:48               ` Eli Zaretskii
2007-12-03 21:32                 ` Karl Fogel
2007-12-04  4:20                   ` Eli Zaretskii
2007-12-04  6:17                     ` Karl Fogel
2007-12-04 20:57                       ` Eli Zaretskii
2007-12-04 16:40                     ` Juanma Barranquero
2007-12-04 21:32                       ` Eli Zaretskii
2007-12-04 22:24                         ` Stefan Monnier
2007-12-05  4:52                           ` Eli Zaretskii
2007-12-05  8:49                             ` Juanma Barranquero
2007-12-05 18:25                               ` Eli Zaretskii
2007-12-05 20:05                                 ` Juanma Barranquero
2007-12-06  4:21                                   ` Eli Zaretskii
2007-12-06 12:38                                     ` Juanma Barranquero
2007-12-04 22:51                         ` Juanma Barranquero
2007-12-04 16:55                   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ijwlhb8.fsf_-_@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=david.reitter@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.