[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: Problem with sb-rss-hash (bug in luna?)



>>>>> In [emacs-w3m : No.10752] David Engster wrote:
> The general RSS shimbun rss-hash (for feeds with full content) throws
> an error in the following lines in sb-rss.el (lines 224 f.):

> (if (and ignored-subject subject)
>     (not (string-match ignored-subject subject))

> The problem is that "ignored-subject" contains bogus data. Of course,
> you can circumvent this problems by using

> (if (and (stringp ignored-subject) subject)

> but this does not really solve the problem.

> The sb-rss-hash shimbun inherits from sb-rss and from sb-hash:

>   (luna-define-class shimbun-rss-hash (shimbun-hash shimbun-rss) ())

> The problem is that only the constructor of shimbun-hash is called, not
> the one from shimbun-rss (by 'constructor' I mean the
> initialize-instance method). If I reverse the order of those two, it's
> the other way round, so it seems it is always the first one.

> Since the shimbun-rss constructor is not called,
> 'shimbun-rss-initialize-ignored-subject' is never used and so the
> 'ignored-subject' slot is not properly initialized.

> I'm inclined to say that this is a bug in luna.el, but I'm not familiar
> with that package, so I may very well be wrong. I'm hoping that someone
> around here more familiar with luna can say how this problem can be
> fixed properly.

> Regards,
> David

This issue was discussed in:

http://news.gmane.org/group/gmane.emacs.w3m/thread=7974/force_load=t

But we seem to have no smart solution so far, except for a workaround.
That is, Arisawa-san provided the `shimbun-rss-initialize-ignored-subject'
function and modified sb-itmedia.el and sb-opentechpress-jp.el so as to
use it in the `initialize-instance' method as follows:

;; sb-itmedia.el
(defvar shimbun-itmedia-ignored-subject "^PR:")

(luna-define-method initialize-instance :after ((shimbun shimbun-itmedia)
						&rest init-args)
  (shimbun-rss-initialize-ignored-subject shimbun))

;; sb-opentechpress-jp.el
(defvar shimbun-opentechpress-jp-ignored-subject "^PR:")

(luna-define-method initialize-instance :after ((shimbun
						 shimbun-opentechpress-jp)
						&rest init-args)
  (shimbun-rss-initialize-ignored-subject shimbun))

Regards,