From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Please try Pmail Date: Wed, 21 Jan 2009 16:21:40 -0500 Message-ID: <87bpu0uzh7.fsf@cyd.mit.edu> References: <87r6303c31.fsf@cyd.mit.edu> <87ljt83svc.fsf@cyd.mit.edu> <87eiyyvz2h.fsf@cyd.mit.edu> <873afdti10.fsf@cyd.mit.edu> <87zlhkitpv.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1232572908 8256 80.91.229.12 (21 Jan 2009 21:21:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2009 21:21:48 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 21 22:23:00 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LPkXK-0002cx-8D for ged-emacs-devel@m.gmane.org; Wed, 21 Jan 2009 22:22:59 +0100 Original-Received: from localhost ([127.0.0.1]:40787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPkW2-0005vi-Vp for ged-emacs-devel@m.gmane.org; Wed, 21 Jan 2009 16:21:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPkVl-0005o7-B5 for emacs-devel@gnu.org; Wed, 21 Jan 2009 16:21:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPkVk-0005nf-JI for emacs-devel@gnu.org; Wed, 21 Jan 2009 16:21:20 -0500 Original-Received: from [199.232.76.173] (port=44084 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPkVk-0005nV-2y for emacs-devel@gnu.org; Wed, 21 Jan 2009 16:21:20 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:49440) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPkVg-0005ls-0N; Wed, 21 Jan 2009 16:21:16 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 5F81B57E225; Wed, 21 Jan 2009 16:21:40 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Wed, 21 Jan 2009 15:38:59 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108053 Archived-At: Stefan Monnier writes: > I don't propose a hook, but a buffer-local *-function (as opposed to > *-functions or *-hook). I.e. a single function, just like your > proposal, except it's stored in the final "returned" buffer, rather than > returned explicitly. You mean something like this? DEFVAR_LISP ("write-region-annotate-functions", &Vwrite_region_annotate_functions, doc: /* A list of functions to be called at the start of `write-region'. Each is passed two arguments, START and END as for `write-region'. These are usually two numbers but not always; see the documentation for `write-region'. The function should return a list of pairs of the form (POSITION . STRING), consisting of strings to be effectively inserted at the specified positions of the file being written (1 means to insert before the first byte written). The POSITIONs must be sorted into increasing order. If there are several annotation functions, the lists returned by the annotation functions are merged destructively. As each annotation function runs, the variable `write-region-annotations-so-far' contains a list of all annotations returned by previous annotation functions. An annotation function can return with a different buffer current. Doing so removes the annotations returned by previous functions. After `write-region' completes, Emacs calls the function stored in `write-region-post-annotation-function', once for each buffer that was current when building the annotations (i.e., at least once if `write-region-annotate-functions' is non-nil). This function is called with no arguments, and with that buffer current. */);