VM

emacs-w3m filling

Bug #912518 reported by Uday Reddy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Triaged
Low
khinsen

Bug Description

The attached html message shows the problem that, no matter what `w3m-fill-column' is set to, the message does not get filled correctly. Lines get broken like this:

    EURIM News: Government outlines our 'high tech
future'

    Yesterday, Universities and Science Minister David
Willetts
    set out a plan to help Britain become the best place in
the
   world for science and research and announced:

How can we get around this problem? Perhaps the issue is the image that is displayed in the middle of html? Is it possible to disable the image display?

Tags: 8.1 w3m
Revision history for this message
Uday Reddy (reddyuday) wrote :
Revision history for this message
khinsen (konrad-hinsen) wrote :

The real question is: what do we expect to see?

If you look at that message with some other mail reader with proper HTML support, you get a table with a right-justified image near the top of the message. If you browse to such a page with w3m-emacs, you get a page formatted for a larger width than the current frame; you have to scroll horizontally to see everything. For this particular page, it would be possible to format to a given width, as long as it's larger than the image. But my impression is that emacs-w3m cannot do it, not even in its own browser mode. So to get this particular message displayed as one would wish, it probably takes a modification to emacs-w3m.

There are other situations (which I see frequently in my inbox) where displaying the HTML part to a predefined width is not possible at all. Tables with multiple columns cannot be compressed arbitrarily. Any HTML browser will require horizontal scolling in that case.

My current workaround is the function shown below (which I have bound to C-c C-t) that toggles the value of truncate-lines in the presentation buffer. I disable truncation for reading HTML tables, and re-enable it for displaying plain text messages properly. A better solution would be to set truncate-lines when a message containing a w3m-rendered HTM part is displayed.

Independently, one could improve emacs-w3m's rendering of compressible tables such as the ones in the attached test message, but as I said this probably needs to be done in emacs-w3m.

(defun vm-toggle-line-truncation ()
  (interactive)
  (save-excursion
    (vm-select-folder-buffer-and-validate 1 (vm-interactive-p))
    (and vm-presentation-buffer
         (set-buffer vm-presentation-buffer))
    (setq truncate-lines (not truncate-lines))
    (when truncate-lines
      (setq word-wrap t))
    (force-mode-line-update)))

Revision history for this message
Uday Reddy (reddyuday) wrote : [Bug 912518] Re: emacs-w3m filling

Thanks, Konrad. Good progress there!

Yes, it is very likely an emacs-w3m problem, and they will need to fix it.
So, then, we need to file a bug report for emacs-w3m. Can we produce a
sample HTML page that they can use to reproduce the problem?

Cheers,
Uday

Revision history for this message
khinsen (konrad-hinsen) wrote :

I am working on preparing an example.

I also attach another example message, which illustrates the case where respecting an arbitrary fill column is not possible. We need to handle this as well as possible on the vm interface side.

Revision history for this message
Uday Reddy (reddyuday) wrote :

Great. I am adding you as a member of the 'VM development team' so that we
recognize your work. You will probably get viewmail-bugs traffic, but it is
not onerous.

Cheers,
Uday

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.