Gnus development mailing list
 help / color / mirror / Atom feed
From: Dale Hagglund <rdh@best.com>
Subject: pgnus 0.51: multipart/alternative with no preferred subparts
Date: 21 Nov 1998 05:02:30 -0800	[thread overview]
Message-ID: <86emqxtd09.fsf@ponoka.battleriver.com> (raw)

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

I get mail from an ietf mailing list that uses multipart/alternative
to wrap two message/external-body subparts.  This type doesn't show up
in `mm-alternative-precedence'.  The message displays ok, with neither
of the alternative parts marked with an asterisk.

However, if I try to toggle the button, either by, say `N b' in the
summary buffer, or by `RET' in the article buffer, I get

	Wrong type argument: integer-or-marker-p, nil

After poking around a bit, I believe the problem is due to the 

	(when preferred
	   ...
	   (setcdr begend (point-max)))

block near the end of gnus-mime-display-alternative.  Because none of
the alternatives was chosen to display, this is not executed.  Because
the setcdr doesn't happen, when gnus-mime-display-alternative is
invoked from the gnus-callback property, narrow-to-region fails in 

	(when ibegend ...)

just inside the save-restriction.  I've attached a traceback at the
end of this message.  Below is an example multipart alternative that
should exhibit the problem.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.1: Type: text/unknown, Size: 13 bytes --]


blah blah 1

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.2: Type: text/unknown, Size: 13 bytes --]


blah blah 2

[-- Attachment #3: Type: text/plain, Size: 407 bytes --]


I tried the following patch, which just moves the setcdr above outside
the `(when preferred ...)'.  The error stops happening, and other
multipart/alternative stuff seems to keep working fine, but I don't
grok the internals of gnus-art.el well enough to say if it's the right
way to fix the problem, and, of course, it may not be relevant any
more with the various button changes that have been underway.


[-- Attachment #4: Type: text/plain, Size: 589 bytes --]


*** gnus-art.el.orig	Sat Nov 21 04:26:30 1998
--- gnus-art.el	Sat Nov 21 04:47:43 1998
***************
*** 2547,2554 ****
  	(if (stringp (car preferred))
  	    (gnus-display-mime preferred)
  	  (mm-display-part preferred)
! 	  (goto-char (point-max)))
! 	(setcdr begend (point-marker))))
      (when ibegend
        (goto-char point))))
  
--- 2547,2554 ----
  	(if (stringp (car preferred))
  	    (gnus-display-mime preferred)
  	  (mm-display-part preferred)
! 	  (goto-char (point-max))))
!       (setcdr begend (point-marker)))
      (when ibegend
        (goto-char point))))
  

[-- Attachment #5: Type: text/plain, Size: 55 bytes --]


Below is the traceback from the unaltered 0.51 code.


[-- Attachment #6: Type: text/plain, Size: 1959 bytes --]


Signaling: (wrong-type-argument integer-or-marker-p nil)
  narrow-to-region(#<marker at 492 in *Article*> nil)
  (progn (narrow-to-region (car ibegend) (cdr ibegend)) (delete-region (point-min) (point-max)) (mm-remove-parts handles))
  (if ibegend (progn (narrow-to-region ... ...) (delete-region ... ...) (mm-remove-parts handles)))
  (when ibegend (narrow-to-region (car ibegend) (cdr ibegend)) (delete-region (point-min) (point-max)) (mm-remove-parts handles))
  (save-restriction (when ibegend (narrow-to-region ... ...) (delete-region ... ...) (mm-remove-parts handles)) (setq begend (list ...)) (unless (setq not-pref ...) (setq not-pref ...)) (gnus-add-text-properties (setq from ...) (progn ... ...) (\` ...)) (widget-convert-button (quote link) from (point) :action (quote gnus-widget-press-button) :button-keymap gnus-widget-button-keymap) (while (setq handle ...) (gnus-add-text-properties ... ... ...) (widget-convert-button ... from ... :action ... :button-keymap gnus-widget-button-keymap) (insert "  ")) (insert "\n\n") (when preferred (if ... ... ... ...) (setcdr begend ...)))
  (let* ((preferred ...) (ihandles handles) (point ...) handle buffer-read-only from props begend not-pref) (save-restriction (when ibegend ... ... ...) (setq begend ...) (unless ... ...) (gnus-add-text-properties ... ... ...) (widget-convert-button ... from ... :action ... :button-keymap gnus-widget-button-keymap) (while ... ... ... ...) (insert "\n\n") (when preferred ... ...)) (when ibegend (goto-char point)))
  gnus-mime-display-alternative(((#<buffer  *mm*> ("text/unknown") nil nil nil nil) (#<buffer  *mm*<2>> ("text/unknown") nil nil nil nil)) (#<buffer  *mm*> ("text/unknown") nil nil nil nil) (#<marker at 492 in *Article*>) 1)
  (lambda (handles) (gnus-mime-display-alternative (quote ...) (quote ...) (quote ...) 1))((#<buffer  *mm*> ("text/unknown") nil nil nil nil))
  gnus-article-press-button()
* call-interactively(gnus-article-press-button)


             reply	other threads:[~1998-11-21 13:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-21 13:02 Dale Hagglund [this message]
1998-11-22  7:16 ` Lars Magne Ingebrigtsen

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=86emqxtd09.fsf@ponoka.battleriver.com \
    --to=rdh@best.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).