Gnus development mailing list
 help / color / mirror / Atom feed
* mm-w3m-cid-retrieve-1 -> mm-handle-media-supertype called with nil arg
       [not found] <v94q2jmhab.fsf@marauder.physik.uni-ulm.de>
@ 2006-03-03 15:23 ` Reiner Steib
  2006-03-06  6:53   ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Reiner Steib @ 2006-03-03 15:23 UTC (permalink / raw)


Hi,

`w3m-safe-toggle-inline-image' inside a digest mime part fails because
mm-handle-media-supertype called with a nil argument.

To reproduce:

- Fetch <news:v94q2jmhab.fsf@marauder.physik.uni-ulm.de> from
  gmane.test e.g. with `^' on this posting.

  (or use: <nntp://news.gmane.org/gmane.test/2815>)

- Press `C-d' (`gnus-summary-enter-digest-group'), you'll get:

  <* alternative> html image inline cid
  <1 text>
  <2.* related>
  <2.1 html>
  <2.2 png> back.png

- Select part 2.1 with 
  (setq mm-text-html-renderer 'w3m)

- With point on "altern.", press `t'
  (w3m-safe-toggle-inline-image).
  I get:  

,----
| Debugger entered--Lisp error: (wrong-type-argument stringp nil)
|   string-match("/" nil 0)
|   split-string(nil "/")
|   mm-w3m-cid-retrieve-1("<part1.01020309.03090509@imap.cc>"
|   (#<buffer *mm*<7>> ("text/html" (charset . "iso-8859-1")) nil
|   (lambda nil (let ... ... ...)) nil nil nil nil))
|   byte-code("[...] [url w3m-current-buffer gnus-article-mime-handles
|   mm-w3m-cid-retrieve-1 "<" 0 nil ">"] 5)
|   mm-w3m-cid-retrieve("cid:part1.01020309.03090509@imap.cc" raw nil)
|   w3m-cid-retrieve("cid:part1.01020309.03090509@imap.cc" raw nil)
|   w3m-retrieve("cid:part1.01020309.03090509@imap.cc" raw nil nil nil
|   ((lambda (&rest --cl-rest--) (apply
|   ... ... ... ... ... ... ... ... ... --cl-rest--)) (lambda (&rest
|   --cl-rest--) (apply
|   ... ... ... ... ... ... ... ... ... --cl-rest--)) (lambda (&rest
|   --cl-rest--) (apply ... ... ... ... ... --cl-rest--))))
|   w3m-create-image("cid:part1.01020309.03090509@imap.cc" nil nil nil
|   ((lambda (&rest --cl-rest--) (apply
|   ... ... ... ... ... --cl-rest--))))
|   w3m-toggle-inline-image(nil nil)
|   w3m-safe-toggle-inline-image(nil)
|   call-interactively(w3m-safe-toggle-inline-image)
`----

- To get better debug output eval:
  (load "mm-view.el")
  (require 'cl)

  Repeat `w3m-safe-toggle-inline-image':

,----
| Debugger entered--Lisp error: (wrong-type-argument stringp nil)
|   string-match("/" nil 0)
|   split-string(nil "/")
|   mm-handle-media-supertype(nil)
|   (equal "multipart" (mm-handle-media-supertype elem))
`----

The problem is that `mm-handle-media-supertype' is called with a nil
`elem' argument:

(defun mm-w3m-cid-retrieve-1 (url handle)
  (dolist (elem handle)
    (when (listp elem)
      (if (equal url (mm-handle-id elem))
	  (progn
	    (mm-insert-part elem)
	    (throw 'found-handle (mm-handle-media-type elem))))
      (if (equal "multipart" (mm-handle-media-supertype elem))
	  (mm-w3m-cid-retrieve-1 url elem)))))

(defsubst mm-handle-media-supertype (handle)
  (car (split-string (mm-handle-media-type handle) "/")))

Using `w3m-safe-toggle-inline-image' without
`gnus-summary-enter-digest-group' didn't trigger the bug.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: mm-w3m-cid-retrieve-1 -> mm-handle-media-supertype called with nil arg
  2006-03-03 15:23 ` mm-w3m-cid-retrieve-1 -> mm-handle-media-supertype called with nil arg Reiner Steib
@ 2006-03-06  6:53   ` Katsumi Yamaoka
  2006-03-06 13:56     ` Reiner Steib
  0 siblings, 1 reply; 3+ messages in thread
From: Katsumi Yamaoka @ 2006-03-06  6:53 UTC (permalink / raw)


>>>>> In <v9hd6fimcn.fsf@marauder.physik.uni-ulm.de>
>>>>>	Reiner Steib wrote:

> `w3m-safe-toggle-inline-image' inside a digest mime part fails because
> mm-handle-media-supertype called with a nil argument.

[...]

> The problem is that `mm-handle-media-supertype' is called with a nil
> `elem' argument:

Thank you for analyzing the bug.  It might happen with broken
articles even in usual groups.  I've fixed it so as not to cause
an error, instead of searching the other articles in the digest
group for the related part.

* trunk and v5-10 branch *



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

* Re: mm-w3m-cid-retrieve-1 -> mm-handle-media-supertype called with nil arg
  2006-03-06  6:53   ` Katsumi Yamaoka
@ 2006-03-06 13:56     ` Reiner Steib
  0 siblings, 0 replies; 3+ messages in thread
From: Reiner Steib @ 2006-03-06 13:56 UTC (permalink / raw)


On Mon, Mar 06 2006, Katsumi Yamaoka wrote:

> Thank you for analyzing the bug.  It might happen with broken
> articles even in usual groups.  I've fixed it so as not to cause
> an error, 

Confirmed.  Thanks.

> instead of searching the other articles in the digest group for the
> related part.

This doesn't work when I select <2.1 html> (the image is <2.2 png>
inside <2.* related>) in the example I gave.  Thinking more about it,
I think it is a pilot error: I should probably pick <2.* related> if I
want to see the image.  Maybe checking other parts isn't necessary.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2006-03-06 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <v94q2jmhab.fsf@marauder.physik.uni-ulm.de>
2006-03-03 15:23 ` mm-w3m-cid-retrieve-1 -> mm-handle-media-supertype called with nil arg Reiner Steib
2006-03-06  6:53   ` Katsumi Yamaoka
2006-03-06 13:56     ` Reiner Steib

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