Gnus development mailing list
 help / color / mirror / Atom feed
* pgnus 0.51: multipart/alternative with no preferred subparts
@ 1998-11-21 13:02 Dale Hagglund
  1998-11-22  7:16 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Dale Hagglund @ 1998-11-21 13:02 UTC (permalink / 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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pgnus 0.51: multipart/alternative with no preferred subparts
  1998-11-21 13:02 pgnus 0.51: multipart/alternative with no preferred subparts Dale Hagglund
@ 1998-11-22  7:16 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-22  7:16 UTC (permalink / raw)


Dale Hagglund <rdh@best.com> writes:

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

I've added a different fix for this in 0.54.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-11-22  7:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-21 13:02 pgnus 0.51: multipart/alternative with no preferred subparts Dale Hagglund
1998-11-22  7:16 ` Lars Magne Ingebrigtsen

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