unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Does anyone run Emacs/w3 ?
@ 2003-11-28  3:45 Steven Woody
  2003-11-28 19:46 ` Harry Putnam
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Woody @ 2003-11-28  3:45 UTC (permalink / raw)



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?

Thanks in advance.

-- 
Steven Woody
anti-spam.steven@lczmsoft.com.dont-post-to

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Does anyone run Emacs/w3 ?
       [not found] <mailman.740.1069995776.399.help-gnu-emacs@gnu.org>
@ 2003-11-28  8:14 ` Marc Girod
  2003-11-28  9:12 ` Pascal Bourguignon
  2003-12-17 20:38 ` Kai Grossjohann
  2 siblings, 0 replies; 6+ messages in thread
From: Marc Girod @ 2003-11-28  8:14 UTC (permalink / raw)


>>>>> "SW" == Steven Woody <steven@lczmsoft.com> writes:

SW> I'm running Emacs/w3.

So am I.

For the rest of your question, I'm afraid you'd have to be more
specific if you really want useful answers.
W3 is far from perfect for me too. I use it mostly for pages I have
written myself. For the big world, I use Mozilla nowadays.

-- 
Marc Girod        P.O. Box 323        Voice:  +358-71 80 25581
Nokia NBI         00045 NOKIA Group   Mobile: +358-50 38 78415
Valimo 21 / B616  Finland             Fax:    +358-71 80 61604

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Does anyone run Emacs/w3 ?
       [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
  2003-12-17 20:38 ` Kai Grossjohann
  2 siblings, 1 reply; 6+ messages in thread
From: Pascal Bourguignon @ 2003-11-28  9:12 UTC (permalink / raw)


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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Does anyone run Emacs/w3 ?
  2003-11-28  9:12 ` Pascal Bourguignon
@ 2003-11-28  9:32   ` Steven Woody
  0 siblings, 0 replies; 6+ messages in thread
From: Steven Woody @ 2003-11-28  9:32 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Does anyone run Emacs/w3 ?
  2003-11-28  3:45 Steven Woody
@ 2003-11-28 19:46 ` Harry Putnam
  0 siblings, 0 replies; 6+ messages in thread
From: Harry Putnam @ 2003-11-28 19:46 UTC (permalink / raw)


> 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 run emacs/gnus in black background too:

Some code I snagged on gnus `ding' a few years ago when w3 was the
preferred html rendering engine for gnus.  Not sure if it might be
helpfull.  I no longer use w3 for that.

;; tame w3 displays
 (setq 
  w3-user-fonts-take-precedence t
  w3-user-colors-take-precedence t
  w3-honor-stylesheets nil
  w3-use-terminal-characters nil
  w3-use-terminal-characters-on-tty nil
  w3-horizontal-rule-char 45
  w3-display-frames nil
  url-be-asynchronous t
  w3-do-incremental-display t
  url-honor-refresh-requests nil
  w3-delay-image-loads t)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Does anyone run Emacs/w3 ?
       [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-12-17 20:38 ` Kai Grossjohann
  2 siblings, 0 replies; 6+ messages in thread
From: Kai Grossjohann @ 2003-12-17 20:38 UTC (permalink / raw)


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?

You could tell w3 to always prefer the user's colors.

> And, I found in w3, most pages do not wrap its long lines properly.  Is
> this a bug? How do I resolv it?

Maybe frobbing truncate-lines or truncate-partial-width-windows will
help.  But I haven't used w3 in ages now.

Kai

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-17 20:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2003-12-17 20:38 ` Kai Grossjohann
2003-11-28  3:45 Steven Woody
2003-11-28 19:46 ` Harry Putnam

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).