Add de-base64-unreadable.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 5 May 2000 16:32:24 +0000 (16:32 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 5 May 2000 16:32:24 +0000 (16:32 +0000)
lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el
lisp/gnus.el

index b06d054..f04d660 100644 (file)
@@ -1,3 +1,12 @@
+2000-05-05 12:27:53  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-art.el (article-de-base64-unreadable): New function.
+       (gnus-article-de-base64-unreadable): Bind.
+       (gnus-article-make-menu-bar): Menu item.
+       * gnus-sum.el (gnus-summary-wash-map): Bind '6' and 'Z'.
+       (gnus-summary-make-menu-bar): Menu item.
+       * gnus.el: Autoload.
+
 2000-05-05 10:32:27  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-sum.el (gnus-summary-show-article): Remove en/disable multibyte.
index 94d97e5..76655bc 100644 (file)
@@ -1502,6 +1502,24 @@ or not."
        (article-goto-body)
        (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."
+  (interactive (list 'force))
+  (save-excursion
+    (let ((buffer-read-only nil)
+         (type (gnus-fetch-field "content-transfer-encoding"))
+         (charset gnus-newsgroup-charset))
+      (when (or force
+               (and type (string-match "quoted-printable" (downcase type))))
+       (article-goto-body)
+       (save-restriction
+         (narrow-to-region (point) (point-max))
+         (base64-decode-region (point-min) (point-max))
+         (if (mm-coding-system-p charset)
+             (mm-decode-coding-region (point-min) (point-max) charset)))))))
+
 (eval-when-compile
   (require 'rfc1843))
 
@@ -2444,6 +2462,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
      article-remove-cr
      article-display-x-face
      article-de-quoted-unreadable
+     article-de-base64-unreadable
      article-decode-HZ
      article-mime-decode-quoted-printable
      article-hide-list-identifiers
@@ -2529,6 +2548,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
        ["Treat overstrike" gnus-article-treat-overstrike t]
        ["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]
        ["Decode HZ" gnus-article-decode-HZ t]))
 
     ;; Note "Commands" menu is defined in gnus-sum.el for consistency
index 970cbdf..8a8fc6f 100644 (file)
@@ -1531,6 +1531,8 @@ increase the score of each group you read."
     "C" gnus-article-capitalize-sentences
     "c" gnus-article-remove-cr
     "q" gnus-article-de-quoted-unreadable
+    "6" gnus-article-de-base64-unreadable
+    "Z" gnus-article-decode-HZ
     "f" gnus-article-display-x-face
     "l" gnus-summary-stop-page-breaking
     "r" gnus-summary-caesar-message
@@ -1681,6 +1683,7 @@ increase the score of each group you read."
              ["Words" gnus-article-decode-mime-words t]
              ["Charset" gnus-article-decode-charset t]
              ["QP" gnus-article-de-quoted-unreadable t]
+             ["Base64" gnus-article-de-base64-unreadable t]
              ["View all" gnus-mime-view-all-parts t])
              ("Date"
               ["Local" gnus-article-date-local t]
@@ -1707,6 +1710,7 @@ increase the score of each group you read."
               ["CR" gnus-article-remove-cr t]
               ["Show X-Face" gnus-article-display-x-face t]
               ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
+              ["Base64" gnus-article-de-base64-unreadable t]
               ["Rot 13" gnus-summary-caesar-message t]
               ["Unix pipe" gnus-summary-pipe-message t]
               ["Add buttons" gnus-article-add-buttons t]
index 2269b07..8770955 100644 (file)
@@ -1767,6 +1767,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       gnus-article-treat-overstrike 
       gnus-article-remove-cr gnus-article-remove-trailing-blank-lines
       gnus-article-display-x-face gnus-article-de-quoted-unreadable
+      gnus-article-de-base64-unreadable
       gnus-article-decode-HZ
       gnus-article-hide-pgp
       gnus-article-hide-pem gnus-article-hide-signature