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-hook versus deferred-action-function Date: Sun, 5 Feb 2012 01:29:36 +0100 Message-ID: References: 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 1328401834 1576 80.91.229.3 (5 Feb 2012 00:30:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Feb 2012 00:30:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 05 01:30:33 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rtq01-0003X1-1e for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2012 01:30:33 +0100 Original-Received: from localhost ([::1]:53766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rtq00-0001IM-7U for ged-emacs-devel@m.gmane.org; Sat, 04 Feb 2012 19:30:32 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rtpzu-0001IG-S2 for emacs-devel@gnu.org; Sat, 04 Feb 2012 19:30:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rtpzq-0000RE-TO for emacs-devel@gnu.org; Sat, 04 Feb 2012 19:30:26 -0500 Original-Received: from mail-pw0-f41.google.com ([209.85.160.41]:51226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rtpzm-0000Qh-CX; Sat, 04 Feb 2012 19:30:18 -0500 Original-Received: by pbaa12 with SMTP id a12so4428910pba.0 for ; Sat, 04 Feb 2012 16:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=hCgQDhaiDCzl3WOPqOmDsc8Ykm8sQh3bGZ3gjr2L+2w=; b=wDQwW4TOIbojomJyRodTHZ2f79+q6cYWDQp/s2PPX20Oa2WCdm/AL9S0/cU4RXMzAQ dCzhUJQb2nUgu7jt5Rq8fk2y1jmz11c1rF9MkTE+V6+xlHMcEvN64Bn++hTopGostBpw prhInSNxETFWhFolqo51lE6HGGuuaVdxPNEbI= Original-Received: by 10.68.75.199 with SMTP id e7mr32149776pbw.128.1328401816143; Sat, 04 Feb 2012 16:30:16 -0800 (PST) Original-Received: by 10.143.37.9 with HTTP; Sat, 4 Feb 2012 16:29:36 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.41 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:148169 Archived-At: On Sun, Feb 5, 2012 at 01:06, Glenn Morris wrote: > In 24.1, deferred-action-function has been deprecated in favour of just > using post-command-hook. Fair enough, the former was never really used > for anything. deferred-function-action was deprecated for the two reasons you mention: it was never used (I think googling it gave just one use, and it was used just like post-command-hook), and it was poorly documented. There was not way to resolve conflicts between two applications wanting to use it for different purposes. > However, delayed-warnings-hook has been added, and, although it has a > more clearly documented purpose, seems to be functionally equivalent to > the deprecated interface. It is functionally equivalent, but the documented API of deferred-function-(action|list) was so vague that using it for delayed warnings made impossible to guarantee that someone else would not trample over the warnings. So deprecating one and adding the other is a way of documenting the delayed warnings use. For non-warnings, post-command-hook is enough. > Why couldn't an element just be > added to post-command-hook to process delayed-warnings? The idea is, some day, to add a defcustom interface to allow the user adding other warnings-processing functions. In my .emacs I have one to filter out specific warnings, for example. That could be done from post-command-hook, but it would be messier. =C2=A0 =C2=A0 Juanma