* gnus.el: Add article-unsplit-urls.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 8 Feb 2002 15:08:29 +0000 (15:08 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 8 Feb 2002 15:08:29 +0000 (15:08 +0000)
* gnus-sum.el: Ditto.
* gnus-art.el (gnus-treat-strip-cr): New variable.
(gnus-treatment-function-alist): Use it.
(article-unsplit-urls): New function.
(gnus-article-make-menu-bar): Use it.
From: Michael Cook <michael.cook@cisco.com>

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el
lisp/gnus.el

index ea712e1..de1cd06 100644 (file)
@@ -1,3 +1,13 @@
+2002-02-08  ShengHuo ZHU  <zsh@cs.rochester.edu>
+       
+       * gnus.el: Add article-unsplit-urls.
+       * gnus-sum.el: Ditto.
+       * gnus-art.el (gnus-treat-strip-cr): New variable.
+       (gnus-treatment-function-alist): Use it.
+       (article-unsplit-urls): New function.
+       (gnus-article-make-menu-bar): Use it.
+       From: Michael Cook <michael.cook@cisco.com>
+
 2002-02-08  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-agent.el (gnus-agent-braid-nov): Find the first article to
index f97e519..5de5d42 100644 (file)
@@ -858,6 +858,13 @@ See Info node `(gnus)Customizing Articles' for details."
   :group 'gnus-article-treat
   :type gnus-article-treat-custom)
 
+(defcustom gnus-treat-unsplit-urls nil
+  "Remove newlines from within URLs.
+Valid values are nil, t, `head', `last', an integer or a predicate.
+See Info node `(gnus)Customizing Articles' for details."
+  :group 'gnus-article-treat
+  :type gnus-article-treat-custom)
+
 (defcustom gnus-treat-leading-whitespace nil
   "Remove leading whitespace in headers.
 Valid values are nil, t, `head', `last', an integer or a predicate.
@@ -1223,6 +1230,7 @@ It is a string, such as \"PGP\". If nil, ask user."
     (gnus-treat-fill-article gnus-article-fill-cited-article)
     (gnus-treat-fill-long-lines gnus-article-fill-long-lines)
     (gnus-treat-strip-cr gnus-article-remove-cr)
+    (gnus-treat-unsplit-urls gnus-article-unsplit-urls)
     (gnus-treat-date-ut gnus-article-date-ut)
     (gnus-treat-date-local gnus-article-date-local)
     (gnus-treat-date-english gnus-article-date-english)
@@ -2049,6 +2057,16 @@ If READ-CHARSET, ask for a coding system."
     (let ((buffer-read-only nil))
       (rfc1843-decode-region (point-min) (point-max)))))
 
+(defun article-unsplit-urls ()
+  "Remove the newlines that some other mailers insert into URLs."
+  (interactive)
+  (save-excursion
+    (let ((buffer-read-only nil))
+      (goto-char (point-min))
+      (while (re-search-forward
+             "^\\(\\(https?\\|ftp\\)://\\S-+\\)\n\\(\\S-+\\)" nil t)
+       (replace-match "\\1\\3" t)))))
+
 (defun article-wash-html (&optional read-charset)
   "Format an html article.
 If READ-CHARSET, ask for a coding system."
@@ -3174,6 +3192,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
      article-de-base64-unreadable
      article-decode-HZ
      article-wash-html
+     article-unsplit-urls
      article-hide-list-identifiers
      article-hide-pgp
      article-strip-banner
@@ -3270,6 +3289,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
        ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]
        ["Remove base64" gnus-article-de-base64-unreadable t]
        ["Treat html" gnus-article-wash-html t]
+       ["Remove newlines from within URLs" gnus-article-unsplit-urls t]
        ["Decode HZ" gnus-article-decode-HZ t]))
 
     ;; Note "Commands" menu is defined in gnus-sum.el for consistency
index 9222e54..6f1c523 100644 (file)
@@ -1740,6 +1740,7 @@ increase the score of each group you read."
     "6" gnus-article-de-base64-unreadable
     "Z" gnus-article-decode-HZ
     "h" gnus-article-wash-html
+    "u" gnus-article-unsplit-urls
     "s" gnus-summary-force-verify-and-decrypt
     "f" gnus-article-display-x-face
     "l" gnus-summary-stop-page-breaking
@@ -1964,6 +1965,7 @@ increase the score of each group you read."
              ["Unfold headers" gnus-article-treat-unfold-headers t]
              ["Fold newsgroups" gnus-article-treat-fold-newsgroups t]
              ["Html" gnus-article-wash-html t]
+             ["URLs" gnus-article-unsplit-urls t]
              ["Verify X-PGP-Sig" gnus-article-verify-x-pgp-sig t]
              ["HZ" gnus-article-decode-HZ t])
             ("Output"
index 10fc3ba..fd6d8be 100644 (file)
@@ -2111,6 +2111,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       gnus-article-de-base64-unreadable
       gnus-article-decode-HZ
       gnus-article-wash-html
+      gnus-article-unsplit-urls
       gnus-article-hide-pgp
       gnus-article-hide-pem gnus-article-hide-signature
       gnus-article-strip-leading-blank-lines gnus-article-date-local