From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/43537 Path: quimby.gnus.org!not-for-mail From: ShengHuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-summary-toggle-header fails for body-less, boundary-less articles Date: Tue, 19 Feb 2002 15:25:03 -0500 Message-ID: References: NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: quimby2.netfonds.no 1014150431 4396 195.204.10.66 (19 Feb 2002 20:27:11 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 19 Feb 2002 20:27:11 GMT Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16dGr0-00018i-00; Tue, 19 Feb 2002 21:27:10 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16dGpj-0003F2-00; Tue, 19 Feb 2002 14:25:51 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 19 Feb 2002 14:25:50 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id OAA13239 for ; Tue, 19 Feb 2002 14:25:39 -0600 (CST) Original-Received: (qmail 5344 invoked by alias); 19 Feb 2002 20:25:34 -0000 Original-Received: (qmail 5339 invoked from network); 19 Feb 2002 20:25:33 -0000 Original-Received: from zsh.cs.rochester.edu (HELO zsh.2y.net) (192.5.53.126) by gnus.org with SMTP; 19 Feb 2002 20:25:33 -0000 Original-Received: (from zsh@localhost) by zsh.2y.net (8.11.6/8.11.2) id g1JKP3C09631; Tue, 19 Feb 2002 15:25:03 -0500 Original-To: ding@gnus.org X-Attribution: ZSH X-Face: #zw9`a=vHLkn+ZH8C (prj@po.cwru.edu's message of "Tue, 19 Feb 2002 14:28:02 -0500") Original-Lines: 23 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: quimby.gnus.org gmane.emacs.gnus.general:43537 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:43537 --=-=-= prj@po.cwru.edu (Paul Jarc) writes: > For an article which has no body and no empty line marking the end of > the header, gnus-summary-toggle-header fails in two ways. This line > finds the character position before the end of the buffer, instead of > the one at the end: > (setq e (1- (or (search-forward "\n\n" nil t) (point-max)))) > This is easy enough to fix: > (setq e (search-forward "\n\n" nil t) > e (if e (1- e) (point-max))) > But it also fails to delete the header, so the added header: > (when (search-forward "\n\n" nil t) > (delete-region (point-min) (1- (point)))) > This doesn't try to do anything for the no-boundary case, so I'm > wondering if that's intentional. Anyone know? Or should it just > delete all the way to (point-max) in this case? Does the attached patch fix the problem? ShengHuo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gnus-sum.el.diff --- gnus-sum.el.~6.185.~ Mon Feb 18 08:46:11 2002 +++ gnus-sum.el Tue Feb 19 15:21:54 2002 @@ -8180,13 +8180,13 @@ (article-narrow-to-head) (gnus-article-hidden-text-p 'headers)))) (goto-char (point-min)) - (when (search-forward "\n\n" nil t) - (delete-region (point-min) (1- (point)))) - (goto-char (point-min)) + (search-forward "\n\n" nil 'move) + (delete-region (point-min) (point)) (save-excursion (set-buffer gnus-original-article-buffer) (goto-char (point-min)) - (setq e (1- (or (search-forward "\n\n" nil t) (point-max))))) + (search-forward "\n\n" nil 'move) + (setq e (point))) (insert-buffer-substring gnus-original-article-buffer 1 e) (save-restriction (narrow-to-region (point-min) (point)) --=-=-=--