From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83588 Path: news.gmane.org!not-for-mail From: =?utf-8?B?S2FuLVJ1IENoZW4gKOmZs+S+g+Wmgik=?= Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Fix expiring for nnmbox backend Date: Fri, 02 Aug 2013 01:23:17 +0800 Message-ID: <87pptxl3zu.fsf@kanru.info> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1375377888 8671 80.91.229.3 (1 Aug 2013 17:24:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Aug 2013 17:24:48 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M31846@lists.math.uh.edu Thu Aug 01 19:24:48 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V4wcI-00039l-J0 for ding-account@gmane.org; Thu, 01 Aug 2013 19:24:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1V4wb6-0002w1-71; Thu, 01 Aug 2013 12:23:32 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1V4wb4-0002vq-K6 for ding@lists.math.uh.edu; Thu, 01 Aug 2013 12:23:30 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1V4wb3-0005AK-9N for ding@lists.math.uh.edu; Thu, 01 Aug 2013 12:23:30 -0500 Original-Received: from byebi.wara.tw ([106.187.43.138]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1V4wb0-0006ET-PJ for ding@gnus.org; Thu, 01 Aug 2013 19:23:27 +0200 Original-Received: from 114-42-31-201.dynamic.hinet.net ([114.42.31.201] helo=isil.kanru.info) by byebi.wara.tw with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1V4wav-0000T1-9E for ding@gnus.org; Fri, 02 Aug 2013 01:23:21 +0800 Original-Received: from [127.0.0.1] (helo=isil) by isil.kanru.info with esmtp (Exim 4.80) (envelope-from ) id 1V4war-0007Hs-1S for ding@gnus.org; Fri, 02 Aug 2013 01:23:17 +0800 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83588 Archived-At: (This message does not show up in the group so I posted again.) The nnmbox-request-article function should not alter the point position of the mbox buffer as it's usually used in a temporary buffer. --- lisp/nnmbox.el | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/lisp/nnmbox.el b/lisp/nnmbox.el index 3228eac..87ca908 100644 --- a/lisp/nnmbox.el +++ b/lisp/nnmbox.el @@ -148,28 +148,29 @@ (deffoo nnmbox-request-article (article &optional newsgroup server buffer) (nnmbox-possibly-change-newsgroup newsgroup server) (with-current-buffer nnmbox-mbox-buffer - (when (nnmbox-find-article article) - (let (start stop) - (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) - (setq start (point)) - (forward-line 1) - (setq stop (if (re-search-forward (concat "^" - message-unix-mail-delimiter) - nil 'move) - (match-beginning 0) - (point))) - (let ((nntp-server-buffer (or buffer nntp-server-buffer))) - (set-buffer nntp-server-buffer) - (erase-buffer) - (insert-buffer-substring nnmbox-mbox-buffer start stop) - (goto-char (point-min)) - (while (looking-at "From ") - (delete-char 5) - (insert "X-From-Line: ") - (forward-line 1)) - (if (numberp article) - (cons nnmbox-current-group article) - (nnmbox-article-group-number nil))))))) + (save-excursion + (when (nnmbox-find-article article) + (let (start stop) + (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) + (setq start (point)) + (forward-line 1) + (setq stop (if (re-search-forward (concat "^" + message-unix-mail-delimiter) + nil 'move) + (match-beginning 0) + (point))) + (let ((nntp-server-buffer (or buffer nntp-server-buffer))) + (set-buffer nntp-server-buffer) + (erase-buffer) + (insert-buffer-substring nnmbox-mbox-buffer start stop) + (goto-char (point-min)) + (while (looking-at "From ") + (delete-char 5) + (insert "X-From-Line: ") + (forward-line 1)) + (if (numberp article) + (cons nnmbox-current-group article) + (nnmbox-article-group-number nil)))))))) (deffoo nnmbox-request-group (group &optional server dont-check info) (nnmbox-possibly-change-newsgroup nil server) @@ -255,8 +256,9 @@ (if (setq is-old (nnmail-expired-article-p newsgroup - (buffer-substring - (point) (progn (end-of-line) (point))) force)) + (save-excursion + (buffer-substring + (point) (progn (end-of-line) (point)))) force)) (progn (unless (eq nnmail-expiry-target 'delete) (with-temp-buffer -- 1.7.10.4