[emacs-w3m:13269] Re: oneline patch to ~/.emacs.d/elpa/w3m-20190222.738/w3m-favicon.el

Katsumi Yamaoka <[email protected]>
Newsgroups gmane.emacs.w3m
Organization Emacsen advocacy group
Message-ID <[email protected]>
In [emacs-w3m:13266]
On Mon, 25 Feb 2019 15:28:35 +0000, [email protected] wrote:
> Recently. I have added this line to my dotemacs w3m setup.

> (setq
> w3m-use-favicon t
> )

> Then on some sites I am getting an "out of range" error.

Could you let me know some of such sites?  A guard for such
breakage already exists as follows:

(defun w3m-favicon-retrieve (url type target)
[...]
	    (if (and ok
		     ;; Some broken servers provide empty content.
		     (>= (buffer-size) 4))

But this criterion would probably be not enough to detect it and
have to be improved.  I should do it.

> so I have added this line to the function

> (defun w3m-favicon-convert (data type)
>   "Convert the favicon DATA in TYPE to the favicon image and return it."
> +  (when (> (length data) 0)
>   (when (or (not (eq type 'ico))

Thanks.  But this change will propagate an invalid nil image to
the other programs that use it.  So, I think it would be better
to shut it out in the upper stream, i.e., `w3m-favicon-retrieve'.

Regards,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.