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

w3m-display-hook redisplay flashing



I tried putting some code in w3m-display-hook to lightly mangle buffer
contents (fix sentence spacing) and found it causes some flashing.  Eg.

    (require 'w3m)
    (add-hook 'w3m-display-hook
              (lambda (url)
                (save-excursion
                  (goto-char (point-min))
                  (forward-line 1)
                  (let ((inhibit-read-only t))
                    (insert "An extra line of text.\n")))))
    (w3m-browse-url "file:///some/where.html")
    ;; press R redisplay to see the flash again

On visiting a page there's redisplay with normal output, then a second
redisplay with my insertion.  Is w3m-display-hook meant for this?
Is there another place to mangle output?

With (setq w3m-use-tab nil) there's no flash.  I see in that case
`w3m-select-buffer-update' doesn't do `w3m-force-window-update' and so
doesn't (sit-for 0).  Might the sit-for go after w3m-display-hook?

Of course for simple w3m-goto-url the normal command loop redisplay is
about to run anyway.  The updating allows calls from hard loops and
stuff too does it?