Washing html.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 6 May 2000 21:43:18 +0000 (21:43 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 6 May 2000 21:43:18 +0000 (21:43 +0000)
lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el
lisp/gnus.el

index bfbe2b0..f485789 100644 (file)
@@ -1,3 +1,12 @@
+2000-05-06 17:40:20  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-art.el (article-wash-html): New function.
+       (gnus-article-wash-html): Bind.
+       (gnus-article-make-menu-bar): Menu item.
+       * gnus-sum.el (gnus-summary-wash-map): Bind 'h'.
+       (gnus-summary-make-menu-bar): Menu item.
+       * gnus.el: Autoload.
+
 2000-05-06  Florian Weimer  <fw@deneb.cygnus.argh.org>
 
        * gnus-uu.el (gnus-uu-unshar-warning): New variable.
index 76655bc..242320e 100644 (file)
@@ -1503,9 +1503,8 @@ or not."
        (quoted-printable-decode-region (point) (point-max) charset)))))
 
 (defun article-de-base64-unreadable (&optional force)
-  "Translate a quoted-printable-encoded article.
-If FORCE, decode the article whether it is marked as quoted-printable
-or not."
+  "Translate a base64 article.
+If FORCE, decode the article whether it is marked as base64 not."
   (interactive (list 'force))
   (save-excursion
     (let ((buffer-read-only nil)
@@ -1531,6 +1530,23 @@ or not."
     (let ((buffer-read-only nil))
       (rfc1843-decode-region (point-min) (point-max)))))
 
+(defun article-wash-html ()
+  "Format an html article."
+  (interactive)
+  (save-excursion
+    (let ((buffer-read-only nil)
+         (charset gnus-newsgroup-charset))
+      (article-goto-body)
+      (save-window-excursion
+       (save-restriction
+         (narrow-to-region (point) (point-max))
+         (mm-setup-w3)
+         (let ((w3-strict-width (window-width))
+               (url-standalone-mode t))
+           (condition-case var
+               (w3-region (point-min) (point-max))
+             (error))))))))
+
 (defun article-hide-list-identifiers ()
   "Remove list identifies from the Subject header.
 The `gnus-list-identifiers' variable specifies what to do."
@@ -2464,6 +2480,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
      article-de-quoted-unreadable
      article-de-base64-unreadable
      article-decode-HZ
+     article-wash-html
      article-mime-decode-quoted-printable
      article-hide-list-identifiers
      article-hide-pgp
@@ -2549,6 +2566,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
        ["Remove carriage return" gnus-article-remove-cr t]
        ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]
        ["Remove base64" gnus-article-de-base64-unreadable t]
+       ["Treat html" gnus-article-wash-html t]
        ["Decode HZ" gnus-article-decode-HZ t]))
 
     ;; Note "Commands" menu is defined in gnus-sum.el for consistency
index 8a8fc6f..28c8778 100644 (file)
@@ -1533,6 +1533,7 @@ increase the score of each group you read."
     "q" gnus-article-de-quoted-unreadable
     "6" gnus-article-de-base64-unreadable
     "Z" gnus-article-decode-HZ
+    "h" gnus-article-wash-html
     "f" gnus-article-display-x-face
     "l" gnus-summary-stop-page-breaking
     "r" gnus-summary-caesar-message
@@ -1718,6 +1719,7 @@ increase the score of each group you read."
               ["Stop page breaking" gnus-summary-stop-page-breaking t]
               ["Verbose header" gnus-summary-verbose-headers t]
               ["Toggle header" gnus-summary-toggle-header t]
+             ["Html" gnus-article-wash-html t]
              ["HZ" gnus-article-decode-HZ t])
              ("Output"
               ["Save in default format" gnus-summary-save-article t]
index 8770955..740b363 100644 (file)
@@ -1769,6 +1769,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       gnus-article-display-x-face gnus-article-de-quoted-unreadable
       gnus-article-de-base64-unreadable
       gnus-article-decode-HZ
+      gnus-article-wash-html
       gnus-article-hide-pgp
       gnus-article-hide-pem gnus-article-hide-signature
       gnus-article-strip-leading-blank-lines gnus-article-date-local