unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Please try Pmail
Date: Tue, 20 Jan 2009 09:20:38 -0500	[thread overview]
Message-ID: <87eiyyvz2h.fsf@cyd.mit.edu> (raw)
In-Reply-To: <jwviqoah92u.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 19 Jan 2009 23:57:08 -0500")

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	other threads:[~2009-01-20 14:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-18  3:43 Please try Pmail Richard M Stallman
2009-01-18 14:47 ` Chong Yidong
2009-01-18 15:06   ` Alfred M. Szmidt
2009-01-18 20:40   ` Stefan Monnier
2009-01-19  1:41     ` Chong Yidong
2009-01-19  2:57     ` Chong Yidong
2009-01-20  4:57       ` Stefan Monnier
2009-01-20 14:20         ` Chong Yidong [this message]
2009-01-21  2:37           ` Stefan Monnier
2009-01-21  4:11             ` Chong Yidong
2009-01-21  4:18               ` Stefan Monnier
2009-01-21 15:06                 ` Chong Yidong
2009-01-21 20:38                   ` Stefan Monnier
2009-01-21 21:21                     ` Chong Yidong
2009-01-22  4:12                       ` Stefan Monnier
2009-01-22  4:55                         ` Chong Yidong
2009-01-23  1:52                           ` Richard M Stallman
2009-01-23  2:35                             ` Chong Yidong
2009-01-21 20:32               ` Richard M Stallman
2009-01-21 21:07                 ` Chong Yidong
2009-01-20 23:00         ` Richard M Stallman
2009-01-21  5:56           ` Eli Zaretskii
2009-01-20  1:00     ` Richard M Stallman
2009-01-19  4:31   ` Richard M Stallman
2009-01-19 14:39     ` Chong Yidong
2009-01-19  1:59 ` Glenn Morris
2009-01-20  0:59   ` Richard M Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eiyyvz2h.fsf@cyd.mit.edu \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).