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

Re: when a line goes off the screen

From: jidanni@xxxxxxxxxxx said
Subject: [emacs-w3m:10934] when a line goes off the screen
Message-ID: <87k52u3jp4.fsf@xxxxxxxxxxx>
Date: Tue, 30 Jun 2009 03:48:23 +0800

> http://lists.gsdi.org/pipermail/sdi-asiapacific/2009-May/000550.html has
> one line that goes very far off the screen. What do you recommend a
> emacs-w3m user do, just keep hitting '>' (w3m-scroll-left)?
> I wish there was something like gnus'
> W Q runs the command gnus-article-fill-long-lines
> W h runs the command gnus-article-wash-html

I am usually using this command. Your hoping that it pushes "L"
twice continuously will result. 

(add-hook 'w3m-mode-hook
	  (lambda ()
	    (define-key w3m-mode-map "L" 'w3m-page-fill)))

(defun w3m-page-fill ()
  (let ((w3m-fill-column (min (cond
			       ((boundp 'mew-summary-wrap-lines-column)
			       ((boundp 'message-fill-column)
			      (- (window-width) 5))))
    (if (eq last-command this-command)
	(let ((pos (point-marker))
	      (buffer-read-only nil)
	      (inhibit-read-only t)
	      (after-change-functions nil)
	      (inhibit-point-motion-hooks t)
	    (goto-char (point-min))
	    (when (memq 'w3m-header-line-location-title
			(get-text-property (point) 'face))
	      (forward-line 1))
	    (if (fboundp 'mew-wrap-lines)
		(mew-wrap-lines (point) (point-max))
	      (fill-region (point) (point-max))))
	  (goto-char pos))

Hideyuki SHIRAI (mailto:shirai@xxxxxxxxxxx)