From f948cfcc5b57851cdcc67c4bcbea43e0b5ba8e0c Mon Sep 17 00:00:00 2001 From: ShengHuo ZHU Date: Fri, 8 Feb 2002 15:08:29 +0000 Subject: [PATCH] * 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 --- lisp/ChangeLog | 10 ++++++++++ lisp/gnus-art.el | 20 ++++++++++++++++++++ lisp/gnus-sum.el | 2 ++ lisp/gnus.el | 1 + 4 files changed, 33 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea712e152..de1cd06b3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2002-02-08 ShengHuo ZHU + + * 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 + 2002-02-08 ShengHuo ZHU * gnus-agent.el (gnus-agent-braid-nov): Find the first article to diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index f97e519a0..5de5d42a4 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -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 diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 9222e5422..6f1c523ef 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -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" diff --git a/lisp/gnus.el b/lisp/gnus.el index 10fc3bac5..fd6d8bec7 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -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 -- 2.34.1