From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/25735 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: strange behaviour when `B c'ing an empty article Date: 07 Oct 1999 17:15:57 -0400 Organization: U of Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <5bn1tuan3m.fsf@giga.cs.rochester.edu> References: <874sg46wco.fsf@chow.mat.jhu.edu> <5b7ll03wfa.fsf@giga.cs.rochester.edu> <87g0zoc8yk.fsf@chow.mat.jhu.edu> <5bvh8jonzu.fsf@giga.cs.rochester.edu> <87so3n4v2v.fsf@chow.mat.jhu.edu> <5bd7uroh0f.fsf@giga.cs.rochester.edu> <87emf741y4.fsf@chow.mat.jhu.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035163068 15586 80.91.224.250 (21 Oct 2002 01:17:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:17:48 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id RAA06157 for ; Thu, 7 Oct 1999 17:18:35 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id QAB00632; Thu, 7 Oct 1999 16:16:59 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 07 Oct 1999 16:18:09 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id QAA10250 for ; Thu, 7 Oct 1999 16:17:58 -0500 (CDT) Original-Received: from cayuga.cs.rochester.edu (cayuga.cs.rochester.edu [192.5.53.209]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id RAA06142 for ; Thu, 7 Oct 1999 17:16:01 -0400 (EDT) Original-Received: from giga.cs.rochester.edu (giga.cs.rochester.edu [192.5.53.186]) by cayuga.cs.rochester.edu (8.9.3/Q) with ESMTP id RAA16727 for ; Thu, 7 Oct 1999 17:15:58 -0400 (EDT) Original-Received: (from zsh@localhost) by giga.cs.rochester.edu (8.9.1b+Sun/Q++) id RAA06106; Thu, 7 Oct 1999 17:15:57 -0400 (EDT) Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q In-Reply-To: Dan Christensen's message of "Thu, 07 Oct 1999 11:37:07 -0400" Original-Lines: 31 User-Agent: Gnus/5.07009701 (Pterodactyl Gnus v0.97.1) Emacs/20.4 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:25735 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:25735 --=-=-= >>>>> "Dan" == Dan Christensen writes: [...] Dan> So the test8 article still triggers a bug? Dan> /home/jdc/Gnus/Mail/test8:Xref: scratchy Inbox:10385 Dan> /home/jdc/Gnus/Mail/test9:Xref: scratchy test9:1 Dan> (The test8 one is the empty one, and both were copied with `B c'. Dan> To be honest, it seems to me that the test8 article's Xref is Dan> better than the test9 article's Xref, but I'm not really sure Dan> what's supposed to happen.) [...] It is a bug. The same about the line number. Fixed and committed. -- Shenghuo ZHU 1999-10-07 17:09:34 Shenghuo ZHU * nnmail.el (nnmail-insert-xref): Dealing with empty article. (nnmail-insert-lines): Ditto. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=97-109.diff Index: nnmail.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v retrieving revision 5.39 diff -u -r5.39 nnmail.el --- nnmail.el 1999/09/27 15:19:04 5.39 +++ nnmail.el 1999/10/07 21:12:27 @@ -999,35 +999,39 @@ (let (lines chars) (save-excursion (goto-char (point-min)) - (when (search-forward "\n\n" nil t) - (setq chars (- (point-max) (point))) - (setq lines (count-lines (point) (point-max))) - (forward-char -1) - (save-excursion - (when (re-search-backward "^Lines: " nil t) - (delete-region (point) (progn (forward-line 1) (point))))) - (beginning-of-line) - (insert (format "Lines: %d\n" (max lines 0))) - chars)))) + (unless (search-forward "\n\n" nil t) + (goto-char (point-max)) + (insert "\n")) + (setq chars (- (point-max) (point))) + (setq lines (count-lines (point) (point-max))) + (forward-char -1) + (save-excursion + (when (re-search-backward "^Lines: " nil t) + (delete-region (point) (progn (forward-line 1) (point))))) + (beginning-of-line) + (insert (format "Lines: %d\n" (max lines 0))) + chars))) (defun nnmail-insert-xref (group-alist) "Insert an Xref line based on the (group . article) alist." (save-excursion (goto-char (point-min)) - (when (search-forward "\n\n" nil t) - (forward-char -1) - (when (re-search-backward "^Xref: " nil t) - (delete-region (match-beginning 0) - (progn (forward-line 1) (point)))) - (insert (format "Xref: %s" (system-name))) - (while group-alist - (insert (format " %s:%d" - (mm-encode-coding-string - (caar group-alist) - nnmail-pathname-coding-system) - (cdar group-alist))) - (setq group-alist (cdr group-alist))) - (insert "\n")))) + (unless (search-forward "\n\n" nil t) + (goto-char (point-max)) + (insert "\n")) + (forward-char -1) + (when (re-search-backward "^Xref: " nil t) + (delete-region (match-beginning 0) + (progn (forward-line 1) (point)))) + (insert (format "Xref: %s" (system-name))) + (while group-alist + (insert (format " %s:%d" + (mm-encode-coding-string + (caar group-alist) + nnmail-pathname-coding-system) + (cdar group-alist))) + (setq group-alist (cdr group-alist))) + (insert "\n"))) ;;; Message washing functions --=-=-=--