emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please try Pmail


From: Chong Yidong
Subject: Re: Please try Pmail
Date: Wed, 21 Jan 2009 16:21:40 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Stefan Monnier <address@hidden> 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.  */);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]