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

Re: Patch to emacs-w3m


Thanks for the patch to the w3m-decode-entities-string function.
I've installed it in the emacs-w3m CVS repository.  FYI, the way
to check it out is mentioned in the later part of:


>>>>> In [emacs-w3m : No.05909]
>>>>>	Paul Kinnucan <paulk@mathworks.com> wrote:

> Hi Katsumi

> I've discovered the cause of the problem. The JDEE installs a
> kill-buffer-hook function that performs a string-match operation
> without saving and restoring existing match data.  This hook function
> is called every time w3m-decode-entities-string is called because
> w3m-decode-entities-string creates and kills a temporary buffer. This
> in turn resets the match data used by emacs-w3m to search for HTML
> elements through a rendered buffer, causing an infinite loop. I think
> this is the cause of the infinite loop problem that Jose
> Ruiz encountered and that started this thread.

I see.  My doubt was solved.

> I have updated the JDEE's kill-buffer-hook function to save and
> restore existing match data and this solves the infinite loop problem
> with emacs-w3m. Nevertheless, I include a version of
> w3m-decode-entities-string that decodes entities in a string without
> creating a temporary buffer. The replacement should be faster than the
> existing version because it does not create and destroy buffers and
> should avoid similar problems in the future with kill-buffer-hook
> functions inadvertently destroying match data used by emacs-w3m.

> Paul

Regardless of the kill-buffer-hook problem, the new code is
clearly excellent!
Katsumi Yamaoka <yamaoka@jpl.org>