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

Re: possible changes to w3m



>>>>> In [emacs-w3m : No.08616] Robert D. Crawford wrote:

> Katsumi Yamaoka <yamaoka@xxxxxxx> writes:

>> I believe the first thing we should do is to appeal to the w3m (not
>> emacs-w3m) developers to improve w3m so as not to ignore <i>...</i>
>> tags.

> I am not sure that I understand the source of emacs-w3m, but it looked
> to me like it is searching out the tags and applying whatever
> fontification is necessary.  Is this not the case?

You have complete understanding if you know the data in which
emacs-w3m searches out tags is an intermediate product of w3m,
which is called `halfdump', not an original html source.  You
can get a halfdump by passing an html source to w3m, specifying
some options.  For example:

echo '<b>Bold text.</b>'| w3m -halfdump -T text/html

In the case of more complicated html source, w3m returns data
which can be displayed in the Emacs window only by fontifying
tags.  And this is why emacs-w3m is faster than Emacs/W3.

> I know that, as far
> as w3m goes, the italic tag is a no-op, but I do not understand how that
> affects what is done by emacs-w3m.  Please help me to understand.  Is it
> the case that if w3m does not render a tag that emacs-w3m cannot do
> anything with it?

The problem is that w3m simply removes <i>...</i> tags in
halfdump.  You can see how w3m works by the following:

echo '<i>Italic text.</i>'| w3m -halfdump -T text/html

I guess the w3m developers determined to abandon displaying of
italic text since most of terminal emulators don't have an
ability to do that.

>>> and preformatted text.
>>
>> Hm, what is what we should do for preformatted text?

> I would change the color.  My personal preference would be to handle it
> the same way as font-lock-comment-face.  That way one could see that
> there is something going on there, and when it is spoken by emacspeak I
> can hear the difference.  The pre tag is rendered by w3m, so I think
> this might not be a problem.

I see.  I think using a different face on preformatted text is a
good idea, except for the case where the whole contents are
surrounded by <pre>...</pre> tags (I used to use such ones ;-).
However, oops, it cannot be done for the same reason:

echo '<pre>Preformatted text.</pre>' | w3m -halfdump -T text/html

Probably what we should ask the w3m developers is to prevent w3m
from removing all tags in halfdump.

Regards,