unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Chong Yidong <cyd@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: delayed-warnings-list and delayed-warnings-hook
Date: Mon, 2 Apr 2012 16:20:22 +0200	[thread overview]
Message-ID: <CAAeL0SSs73m_UK_LqftT0Ojh0vEiY44unVhOrwcpE3COVuSKrg@mail.gmail.com> (raw)
In-Reply-To: <87iphip75q.fsf@gnu.org>

On Mon, Apr 2, 2012 at 15:58, Chong Yidong <cyd@gnu.org> wrote:

> Because of the default value (collapse-delayed-warnings
> display-delayed-warnings), in order not to deal with uncollapsed
> messages, third party code needs to append to the hook, and must not
> prepend to it.

Curious. My idea is that people who writes a filter for delayed
warnings would prefer to deal with uncollapsed messages. Collapsing is
just done to make them somewhat nicer in *Messages* (I could have just
made collapsing a part of display-delayed-warnings, but leaving it
separate allows users to remove it). Also, if you append to the hook
you will get nothing, as display-delayed-warnings display the
remaining warnings and clears the list.

>  But this makes it difficult for one third party package
> to give its function priority over other third party packages.  This
> design kind of bothers me.

Even at the point we are in the pretest, we can tweak it (or redesign
it) to our hearts' content. It does not interfere with anything else.

> To clarify the situation a little, could you explain what kind of
> functions you envision third party code adding to this hook?

The foremost one is filtering out unwanted warnings. For example,
delayed warnigns are currently used for a couple of Windows-related
situations (defaulting to C:/_emacs, for example). If someone wants to
really default to C:/_emacs and not set HOME=C:/, s/he can just filter
the warning out and be happy. Though, really, what I'd like to do in
the future is to add a defcustom to allow filtering warnings through a
predefined filter function of our own.

Other possible uses are upgrading warnings into errors, and displaying
warnings in buffers others than *Message*.

Another example, which I implemented in some bug thread (I don't
remember which one right now) is showing redisplay errors as warnings
with an idle delay, so they are not lost (currently they go straight
to *Messages* and you can be a long time without noticing them) but
they are still not so obnoxious that Emacs turns unusable.

The original reason to implement delayed warnings was having non-error
situations in low-level code, before the lisp engine could deal with
them. But I think that many warnings that we currently show
straightaway should be turned into delayed warnings, giving the user
more control over them.

    Juanma



  reply	other threads:[~2012-04-02 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20  9:56 delayed-warnings-list and delayed-warnings-hook Chong Yidong
2012-03-20 10:07 ` Juanma Barranquero
2012-04-02 13:58   ` Chong Yidong
2012-04-02 14:20     ` Juanma Barranquero [this message]
2012-04-02 14:22       ` Juanma Barranquero
2012-03-20 16:24 ` Glenn Morris

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAAeL0SSs73m_UK_LqftT0Ojh0vEiY44unVhOrwcpE3COVuSKrg@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=cyd@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).