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

Re: show a blank page while waiting for a new page after switching back to *w3m* buffer



In [emacs-w3m : No.12428]
	On Sat, 04 Apr 2015 11:14:27 +0800, 積丹尼 wrote:
> Therefore maybe a blank page should be shown instead of X.

Is it like this? (Could you try evaluating this?)

(defadvice w3m-goto-url (before clear-display-while-reading activate)
  "Clear the current display while reading a new page."
  (let ((url (ad-get-arg 0)))
    (when (and (eq major-mode 'w3m-mode)
	       url
	       (not (equal url w3m-current-url)))
      (let ((inhibit-read-only t))
	(erase-buffer)
	(insert-char ?\n (/ (window-height) 2))
	(insert-char ?  (max 0 (/ (- (window-width) (length url) 11) 2)))
	(insert "Reading " url "...")))))