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: Sun, 18 Jan 2009 21:57:27 -0500 Message-ID: <87ljt83svc.fsf@cyd.mit.edu> References: <87r6303c31.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 1232333858 14001 80.91.229.12 (19 Jan 2009 02:57:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2009 02:57:38 +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 Mon Jan 19 03:58:51 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 1LOkLS-0000WH-RR for ged-emacs-devel@m.gmane.org; Mon, 19 Jan 2009 03:58:35 +0100 Original-Received: from localhost ([127.0.0.1]:56397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOkKB-0002fz-Ls for ged-emacs-devel@m.gmane.org; Sun, 18 Jan 2009 21:57:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LOkK6-0002fi-96 for emacs-devel@gnu.org; Sun, 18 Jan 2009 21:57:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LOkK4-0002fV-Px for emacs-devel@gnu.org; Sun, 18 Jan 2009 21:57:09 -0500 Original-Received: from [199.232.76.173] (port=37850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOkK4-0002fQ-ML for emacs-devel@gnu.org; Sun, 18 Jan 2009 21:57:08 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:48305) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LOkK2-0002nK-E6; Sun, 18 Jan 2009 21:57:06 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id E761C57E197; Sun, 18 Jan 2009 21:57:27 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Sun, 18 Jan 2009 15:40:00 -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:107976 Archived-At: Stefan Monnier writes: >> Thanks. First, the swapping code in pmail should be tweaked to use >> write-region-annotate, like in Stefan's 2008-12-30 change to >> tar-mode.el. > > Sounds right. Actually, there seems to be a problem with doing this. The straightforward approach for using write-region-annotate is: (defun pmail-write-region-annotate (start end) (when (pmail-buffers-swapped-p) (set-buffer pmail-view-buffer) (widen) nil)) The `widen' is necessary because pmail-view-buffer, which contains the swapped-out buffer contents, is narrowed to the current message. Without it, only the narrowed part of pmail-view-buffer is written out, which is wrong. However, we need to re-narrow pmail-view-buffer after performing write-region, otherwise pmail screws up. It's not clear how to do so. So we must either (i) put buffer-swapped-with back in and use that, or (ii) modify annotations to somehow automatically widen and save restrictions when the current buffer is switched. Any suggestions?