From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: replacing process sentinels and filters with hooks Date: Tue, 13 Nov 2012 17:58:54 +0000 (UTC) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352829562 25197 80.91.229.3 (13 Nov 2012 17:59:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Nov 2012 17:59:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 13 18:59:33 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 1TYKln-0005RL-9r for ged-emacs-devel@m.gmane.org; Tue, 13 Nov 2012 18:59:31 +0100 Original-Received: from localhost ([::1]:59992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYKld-0005vM-PB for ged-emacs-devel@m.gmane.org; Tue, 13 Nov 2012 12:59:21 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYKlZ-0005v8-Ac for emacs-devel@gnu.org; Tue, 13 Nov 2012 12:59:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYKlW-0006Qp-8N for emacs-devel@gnu.org; Tue, 13 Nov 2012 12:59:17 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:33064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYKlW-0006Qb-1d for emacs-devel@gnu.org; Tue, 13 Nov 2012 12:59:14 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TYKla-0005L4-Kk for emacs-devel@gnu.org; Tue, 13 Nov 2012 18:59:19 +0100 Original-Received: from lechon.iro.umontreal.ca ([132.204.27.242]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Nov 2012 18:59:18 +0100 Original-Received: from monnier by lechon.iro.umontreal.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Nov 2012 18:59:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 15 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 132.204.27.242 (Mozilla/5.0 (X11; Linux i686; rv:10.0.9) Gecko/20100101 Firefox/10.0.9 Iceweasel/10.0.9) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:154852 Archived-At: > I think something along the lines of what with-wrapper-hook does is > a good model (i.e. (add-function (process-filter proc) fun) would take > a `fun' which expects 3 args: the proc, the string, and a > "keep-running-the-hook" function which expects 2 args (the proc and the > string)). This is now implemented on the Emacs trunk. It's called `add-function' and takes an additional argument, for convenience, which says whether to add the function before, after, or around the existing function. It's the basis of the new advice mechanism (whose main entry point is `advice-add'). Stefan