From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: delayed-warnings-list and delayed-warnings-hook Date: Mon, 2 Apr 2012 16:20:22 +0200 Message-ID: References: <87r4wnoasn.fsf@gnu.org> <87iphip75q.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1333376491 16212 80.91.229.3 (2 Apr 2012 14:21:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2012 14:21:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 02 16:21:25 2012 Return-path: Envelope-to: ged-emacs-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 1SEi8I-0000HI-Tz for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2012 16:21:23 +0200 Original-Received: from localhost ([::1]:37522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEi8I-0001ml-9C for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2012 10:21:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEi8B-0001mX-0p for emacs-devel@gnu.org; Mon, 02 Apr 2012 10:21:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEi89-0007Fg-3E for emacs-devel@gnu.org; Mon, 02 Apr 2012 10:21:14 -0400 Original-Received: from mail-pz0-f52.google.com ([209.85.210.52]:55878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEi80-0007CX-WC; Mon, 02 Apr 2012 10:21:05 -0400 Original-Received: by dake40 with SMTP id e40so2123383dak.39 for ; Mon, 02 Apr 2012 07:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=GbgzF/1RDMLIUjSmYcjHLKb7iFGgMAXkDfIsun59Jug=; b=wFH5QztQUu3P3zCs0L50ioYoiYVtq8emyI2hXlWOVAcZXBOlklOL0a5MRsE5FzXwfG 1nH6ve18ESBGio2wWOsuyaf1OZDOyb24iTzw43StS7lyysIteNFPufYIyEW6OuRRJEz1 MzqeFnjO9IM8/OsnIo5FdLPeYi4tfq1JszB0qj9hQStTi0c4+9cWf+LOpVvNMNprFcPu lACbRPN0SjyURUA3+dJbwVfcn3+08KSexMXE7qopq7bUC6m1ppGMjyIHuOSNFPRtSHDC jDwp12WEkxiYSAHFwFYxVrYnnwUm1nwGlualpb5BHZKv0oNPcz3YQyVBKjN3DGTL/i6S 4tSg== Original-Received: by 10.68.225.39 with SMTP id rh7mr21467685pbc.104.1333376462328; Mon, 02 Apr 2012 07:21:02 -0700 (PDT) Original-Received: by 10.142.204.14 with HTTP; Mon, 2 Apr 2012 07:20:22 -0700 (PDT) In-Reply-To: <87iphip75q.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.52 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149290 Archived-At: On Mon, Apr 2, 2012 at 15:58, Chong Yidong 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. > =C2=A0But this makes it difficult for one third party package > to give its function priority over other third party packages. =C2=A0This > 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=3DC:/, 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. =C2=A0 =C2=A0 Juanma