From: Steven Woody <steven@lczmsoft.com>
Subject: Re: Does anyone run Emacs/w3 ?
Date: Fri, 28 Nov 2003 17:32:59 +0800 [thread overview]
Message-ID: <bq74nn$f1e$1@sea.gmane.org> (raw)
In-Reply-To: 877k1k3lht.fsf@thalassa.informatimago.com
Pascal Bourguignon <spam@thalassa.informatimago.com> writes:
'cause i am not a lisp guy, so what i can do is to copy and paste your
code :-). i'm going to do it now ...
Thank you!
> Steven Woody <steven@lczmsoft.com> 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 "</?\\(center\\|table\\|tr\\|td\\|img\\|div align=\"center\"\\)[^>]*>" nil t)
> (replace-match "<p>"))
> ) ;;when
> ;; remove absolute width:
> (goto-char (point-min))
> (while (re-search-forward "\\(<[^>]*\\)\\<width=\\(['\"]*\\)[0-9][0-9]*\\2\\([^>]*>\\)" nil t)
> (replace-match "\\1\\3"))
> ;; remove absolute height:
> (goto-char (point-min))
> (while (re-search-forward "\\(<[^>]*\\)\\<height=\\(['\"]*\\)[0-9][0-9]*\\2\\([^>]*>\\)" nil t)
> (replace-match "\\1\\3"))
> ;; remove long lines of dots:
> (goto-char (point-min))
> (while (re-search-forward "\\.\\{40,\\}" nil t)
> (replace-match "<hr>" 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 <st1:xxx> and </st1:xxx> tags:
> (goto-char (point-min))
> (while (re-search-forward "\\(</?st1:[^>]*>\\)" nil t)
> (replace-match "" t t))
> ;; Text alternative instead of pictures.
> (goto-char (point-min))
> (while (re-search-forward "<IMG[^>]*\"\\[\\(XANALYS\\|Common Lisp HyperSpec (TM)\\)\\]\"[^>]*>" nil t)
> (replace-match "[X]"))
> (goto-char (point-min))
> (while (re-search-forward "<IMG[^>]*\"\\[\\(Previous\\|Up\\|Next\\)\\]\"[^>]*>" nil t)
> (replace-match "[\\1]"))
> ;; <hr>
> (goto-char (point-min))
> (while (re-search-forward "<hr>" nil t)
> (replace-match
> "<br>------------------------------------------------------------<br>")
> )
> ;; Convert all hN to h6.
> (goto-char (point-min))
> (while (re-search-forward "\\(</?h\\)\\([1-5]\\)\\([^>]*>\\)" 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/
--
Steven Woody
anti-spam.steven@lczmsoft.com.dont-post-to
next prev parent reply other threads:[~2003-11-28 9:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.740.1069995776.399.help-gnu-emacs@gnu.org>
2003-11-28 8:14 ` Does anyone run Emacs/w3 ? Marc Girod
2003-11-28 9:12 ` Pascal Bourguignon
2003-11-28 9:32 ` Steven Woody [this message]
2003-12-17 20:38 ` Kai Grossjohann
2003-11-28 3:45 Steven Woody
2003-11-28 19:46 ` Harry Putnam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='bq74nn$f1e$1@sea.gmane.org' \
--to=steven@lczmsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).