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

Re: Patch to emacs-w3m




hi,

i have found the cause of the bug today, before reading your mails
(but thank you very much to paul and katsumi, of course), and have
'fixed' it with this redefinition:

(defun w3m-decode-entities-string (str)
  "Decode entities in the string STR. -- redefinition"
  (save-match-data
    (with-temp-buffer
      (insert str)
      (w3m-decode-entities)
      (buffer-string))))

i.e., if just moved the 'save-match-data' form to the body's top. so
far it's working like a charm here, and i got:

(w3m-decode-entities-string "&amp;&lt;&gt;") => "&<>"

which is, i think, the expected result. although i agree with katsumi
in that the cause of the bug should be fixed at its origin, the above
workaround may make some users (as myself) happy in the meantime :)

cheers,
jao

Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>>> In [emacs-w3m : No.05911] Katsumi Yamaoka wrote:
>
>> Thanks for the patch to the w3m-decode-entities-string function.
>> I've installed it in the emacs-w3m CVS repository.
>
> I'm sorry to inform you that I've canceled the last change to
> w3m.el.  TSUCHIYA Masatoshi, the chief maintainer said that the
> change causes the following fault:
>
> (w3m-decode-entities-string "&amp;&lt;&gt;")
>  => "&"
>
> It should be:
>
> (with-temp-buffer
>   (insert "&amp;&lt;&gt;")
>   (w3m-decode-entities)
>   (buffer-string))
>  => "&<>"
>
> I think the cause by which the with-temp-buffer macro doesn't
> work properly should be solved by the origin rather than
> emacs-w3m.  So, I withdrew the last change in CVS.  Please don't
> think badly of me.
> -- 
> Katsumi Yamaoka <yamaoka@jpl.org>
>

-- 
"Knowledge is proud that he has learned so much;
Wisdom is humble that he knows no more." -- William Cowper