Gnus development mailing list
 help / color / mirror / Atom feed
From: ShengHuo ZHU <zsh@cs.rochester.edu>
Subject: Re: gnus-summary-toggle-header fails for body-less, boundary-less articles
Date: Tue, 19 Feb 2002 15:25:03 -0500	[thread overview]
Message-ID: <a4ucev$49c$1@quimby2.netfonds.no> (raw)
In-Reply-To: <m3pu31i84n.fsf@multivac.cwru.edu> (prj@po.cwru.edu's message of "Tue, 19 Feb 2002 14:28:02 -0500")

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-sum.el.diff --]
[-- Type: text/x-patch, Size: 743 bytes --]

--- 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))

  parent reply	other threads:[~2002-02-19 20:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-19 19:28 Paul Jarc
2002-02-19 20:25 ` ShengHuo ZHU
2002-02-19 20:33   ` Paul Jarc
2002-02-19 20:33   ` Paul Jarc
2002-02-19 20:25 ` ShengHuo ZHU [this message]
2002-02-19 19:28 Paul Jarc

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

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

  git send-email \
    --in-reply-to='a4ucev$49c$1@quimby2.netfonds.no' \
    --to=zsh@cs.rochester.edu \
    /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.
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 NNTP newsgroup(s).