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: Tue, 20 Jan 2009 09:20:38 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

After further investigation, I tracked down the problem with using
write-region-annotate-functions in pmail.  Actually, calling `widen' in
the annotation function causes the file to be saved correctly; the
reason pmail is unable to recover its state after saving is not that the
restrictions in the swapped buffer are wrong.

The problem is that swapping to a different buffer in an annotation
function causes that buffer to be killed!

The docstring to write-region-annotate-functions does not say that
swapping to a different buffer causes that buffer to be killed
afterwards.  What is the purpose of this?  Here is the relevant code
from build_annotations_unwind (fileio.c:4256):


/* If build_annotations switched buffers, switch back to BUF.
   Kill the temporary buffer that was selected in the meantime.

   Since this kill only the last temporary buffer, some buffers remain
   not killed if build_annotations switched buffers more than once.
   -- K.Handa */

static Lisp_Object
build_annotations_unwind (buf)
     Lisp_Object buf;
{
  Lisp_Object tembuf;

  if (XBUFFER (buf) == current_buffer)
    return Qnil;
  tembuf = Fcurrent_buffer ();
  Fset_buffer (buf);
  Fkill_buffer (tembuf);
  return Qnil;
}




reply via email to

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