From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Does anyone run Emacs/w3 ? Date: 28 Nov 2003 10:12:14 +0100 Organization: [posted via Easynet Spain] Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <877k1k3lht.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070010995 14250 80.91.224.253 (28 Nov 2003 09:16:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2003 09:16:35 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 28 10:16:32 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1APejo-00011B-00 for ; Fri, 28 Nov 2003 10:16:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1APffN-0007I9-0O for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Nov 2003 05:16:01 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!easynet-monga!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 90 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=9<0>8NfGYM=e1oS[HU^EF3N[]a?6B>:P3bBd4DjF1d]1 Original-Xref: shelby.stanford.edu gnu.emacs.help:118743 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14684 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14684 Steven Woody writes: > I'm running Emacs/w3. My Emacs was set as black background, this make > most pages look ugly. Has any made a decent configuration for w3 > running in this situation? > > And, I found in w3, most pages do not wrap its long lines properly. Is > this a bug? How do I resolv it? I'm using this ugly hook. It started with only removing font size tags, but as you can see, I added a number of ad-hoc pre-processing of the html buffers. A more general and stronger filter could be implemented in this hook. Or you may use an online filter such as: http://kangzhuang.ucam.org/cgi-bin/access/access.cgi http://www.cl.cam.ac.uk/~ssb22/access.html#download http://www.cus.cam.ac.uk/~ssb22/help.htm (add-hook 'w3-parse-hooks 'pjb-w3-remove-sizes) (defun pjb-w3-remove-sizes () (interactive) ;; reseauvoltaire;shark tank;rigoler (goto-char (point-min)) (when (re-search-forward "http://www.reseauvoltaire.net\\|newsletter de Rigoler.com\\|CONTENT=\"Shark Tank\"\\|http://i.imdb.com" nil t) (goto-char (point-min)) (while (re-search-forward "]*>" nil t) (replace-match "

")) ) ;;when ;; remove absolute width: (goto-char (point-min)) (while (re-search-forward "\\(<[^>]*\\)\\]*>\\)" nil t) (replace-match "\\1\\3")) ;; remove absolute height: (goto-char (point-min)) (while (re-search-forward "\\(<[^>]*\\)\\]*>\\)" nil t) (replace-match "\\1\\3")) ;; remove long lines of dots: (goto-char (point-min)) (while (re-search-forward "\\.\\{40,\\}" nil t) (replace-match "


" t t)) ;; cut long space-less lines: (goto-char (point-min)) (while (re-search-forward "\\([^<> \n\r]\\{60,\\}\\)" nil t) (replace-match (unsplit-string (cut-string (match-string 0) 20) " \n") t t)) ;; remove and tags: (goto-char (point-min)) (while (re-search-forward "\\(]*>\\)" nil t) (replace-match "" t t)) ;; Text alternative instead of pictures. (goto-char (point-min)) (while (re-search-forward "]*\"\\[\\(XANALYS\\|Common Lisp HyperSpec (TM)\\)\\]\"[^>]*>" nil t) (replace-match "[X]")) (goto-char (point-min)) (while (re-search-forward "]*\"\\[\\(Previous\\|Up\\|Next\\)\\]\"[^>]*>" nil t) (replace-match "[\\1]")) ;;
(goto-char (point-min)) (while (re-search-forward "
" nil t) (replace-match "
------------------------------------------------------------
") ) ;; Convert all hN to h6. (goto-char (point-min)) (while (re-search-forward "\\(]*>\\)" nil t) (replace-match "\\16\\3")) ;; end (goto-char (point-min)) ;;; (let ((w (buffer-string))) ;;; (save-excursion ;;; (find-file "/tmp/w") ;;; (erase-buffer) ;;; (insert w) ;;; (save-buffer 0) ;;; (kill-buffer (current-buffer)))) );;pjb-w3-remove-sizes -- __Pascal_Bourguignon__ http://www.informatimago.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Living free in Alaska or in Siberia, a grizzli's life expectancy is 35 years, but no more than 8 years in captivity. http://www.theadvocates.org/