Gnus development mailing list
 help / color / mirror / Atom feed
From: Matt Armstrong <matta@geoworks.com>
Subject: Re: test: empty line missed
Date: 21 Sep 1998 18:48:20 -700	[thread overview]
Message-ID: <uu320ncij.fsf@ultraman.geoworks.com> (raw)
In-Reply-To: zsh@cs.rochester.edu's message of "Wed, 16 Sep 1998 11:16:05 -0400"

zsh@cs.rochester.edu writes:

> test
> 
> You should find a "test" at the top of this article body.

This fixes it for me (as a patch to pgnus-0.31).

As Vladimir Volovich mentioned, others may not be seeing this problem
if their MTA automatically decodes base64 Content-Transfer-Encoding.

article-decode-charset narrows the region to the headers, then passes
the rest to mm-decode-body.  mm-decode-body assumes the entire
narrowed region is the body, so it feels free to clobber the the first
blank line.  But the first blank line separates the headers from the
body.

The fix is to just step past the blank line before narrowing so
mm-decode-body can't mess with it.  Not as obvious as a
message-narrow-to-body function, but it works.


*** gnus-art.el.orig    Mon Sep 21 18:30:55 1998
--- gnus-art.el Mon Sep 21 18:34:15 1998
***************
*** 960,1007 ****
--- 960,1008 ----
  (defun article-decode-charset (&optional prompt)
    "Decode charset-encoded text in the article.
  If PROMPT (the prefix), prompt for a coding system to use."
    (interactive "P")
    (save-excursion
      (save-restriction
        (message-narrow-to-head)
        (let* ((inhibit-point-motion-hooks t)
             (ct (message-fetch-field "Content-Type" t))
             (cte (message-fetch-field "Content-Transfer-Encoding" t))
             (ctl (and ct (condition-case ()
                              (mail-header-parse-content-type ct)
                            (error nil))))
             (charset (cond
                       (prompt
                        (mm-read-coding-system "Charset to decode: "))
                       (ctl
                        (mail-content-type-get ctl 'charset))
                       (gnus-newsgroup-name
                        (gnus-group-find-parameter
                         gnus-newsgroup-name 'charset))))
             buffer-read-only)
        (goto-char (point-max))
        (widen)
+       (forward-line 1)
        (narrow-to-region (point) (point-max))
        (when (or (not ct)
                  (equal (car ctl) "text/plain"))
          (mm-decode-body
           charset (and cte (intern (downcase
                                     (gnus-strip-whitespace cte))))))))))

-- 
matta



      parent reply	other threads:[~1998-09-22  1:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-16 15:16 zsh
1998-09-19 12:10 ` Lars Magne Ingebrigtsen
1998-09-19 22:58   ` Matt Armstrong
1998-09-21 15:29     ` Lee Willis
1998-09-21 16:06       ` Vladimir Volovich
1998-09-22  8:12         ` Lee Willis
1998-09-22 11:03           ` François Pinard
1998-09-22  1:55       ` Matt Armstrong
1998-09-22  1:48 ` Matt Armstrong [this message]

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=uu320ncij.fsf@ultraman.geoworks.com \
    --to=matta@geoworks.com \
    /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).