From a10504967652ae97117e4d2d14ee3210e066bf54 Mon Sep 17 00:00:00 2001 From: ShengHuo ZHU Date: Sun, 11 Feb 2001 15:03:44 +0000 Subject: [PATCH] 2001-02-11 09:00:00 ShengHuo ZHU * gnus-group.el (gnus-group-suspend): Offer save summaries. * gnus-art.el (gnus-treat-leading-whitespace): New. (gnus-treatment-function-alist): Use it. (article-remove-leading-whitespace): New. (gnus-article-make-menu-bar): Use it. * gnus-sum.el (gnus-summary-wash-empty-map): Add remove-leading-whitespace. (gnus-summary-wash-map): Bind strip-headers-in-body to `W a', because of conflict. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/gnus-art.el | 21 +++++++++++++++++++++ lisp/gnus-group.el | 3 ++- lisp/gnus-sum.el | 9 ++++++--- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 841fc0fdc..9e9612aa8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2001-02-11 09:00:00 ShengHuo ZHU + + * gnus-group.el (gnus-group-suspend): Offer save summaries. + + * gnus-art.el (gnus-treat-leading-whitespace): New. + (gnus-treatment-function-alist): Use it. + (article-remove-leading-whitespace): New. + (gnus-article-make-menu-bar): Use it. + + * gnus-sum.el (gnus-summary-wash-empty-map): Add + remove-leading-whitespace. + (gnus-summary-wash-map): Bind strip-headers-in-body to `W a', + because of conflict. + 2001-02-09 23:00:00 ShengHuo ZHU * Makefile.in: Hack generating gnus-load.el. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 9b8c1acc8..8c55a7a59 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -805,6 +805,13 @@ See the manual 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. +See the manual for details." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + (defcustom gnus-treat-hide-headers 'head "Hide headers. Valid values are nil, t, `head', `last', an integer or a predicate. @@ -1110,6 +1117,7 @@ It is a string, such as \"PGP\". If nil, ask user." (gnus-treat-hide-citation gnus-article-hide-citation) (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe) (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) + (gnus-treat-leading-whitespace gnus-article-remove-leading-whitespace) (gnus-treat-strip-pgp gnus-article-hide-pgp) (gnus-treat-strip-pem gnus-article-hide-pem) (gnus-treat-highlight-headers gnus-article-highlight-headers) @@ -2405,6 +2413,17 @@ This format is defined by the `gnus-article-time-format' variable." (let ((buffer-read-only nil)) (gnus-article-unhide-text (point-min) (point-max))))) +(defun article-remove-leading-whitespace () + "Remove excessive whitespace from all headers." + (interactive) + (save-excursion + (save-restriction + (let ((buffer-read-only nil)) + (article-narrow-to-head) + (goto-char (point-min)) + (while (re-search-forward "^[^ :]+: \\([ \t]+\\)" nil t) + (delete-region (match-beginning 1) (match-end 1))))))) + (defun article-emphasize (&optional arg) "Emphasize text according to `gnus-emphasis-alist'." (interactive (gnus-article-hidden-arg)) @@ -2841,6 +2860,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is article-fill-long-lines article-capitalize-sentences article-remove-cr + article-remove-leading-whitespace article-display-x-face article-de-quoted-unreadable article-de-base64-unreadable @@ -2937,6 +2957,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is ["Hide citation" gnus-article-hide-citation t] ["Treat overstrike" gnus-article-treat-overstrike t] ["Remove carriage return" gnus-article-remove-cr t] + ["Remove leading whitespace" gnus-article-remove-leading-whitespace 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] diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index f4974370b..9c69f191d 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -3623,11 +3623,12 @@ In fact, cleanup buffers except for group mode buffer. The hook gnus-suspend-gnus-hook is called before actually suspending." (interactive) (gnus-run-hooks 'gnus-suspend-gnus-hook) + (gnus-offer-save-summaries) ;; Kill Gnus buffers except for group mode buffer. (let ((group-buf (get-buffer gnus-group-buffer))) (mapcar (lambda (buf) (unless (member buf (list group-buf gnus-dribble-buffer)) - (kill-buffer buf))) + (gnus-kill-buffer buf))) (gnus-buffers)) (gnus-kill-gnus-frames) (when group-buf diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 925e7968e..0924f9afa 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -1609,7 +1609,7 @@ increase the score of each group you read." "r" gnus-summary-caesar-message "t" gnus-summary-toggle-header "v" gnus-summary-verbose-headers - "H" gnus-article-strip-headers-in-body + "a" gnus-article-strip-headers-in-body ;; mnemonic: wash archive "p" gnus-article-verify-x-pgp-sig "d" gnus-article-treat-dumbquotes) @@ -1655,7 +1655,8 @@ increase the score of each group you read." "a" gnus-article-strip-blank-lines "A" gnus-article-strip-all-blank-lines "s" gnus-article-strip-leading-space - "e" gnus-article-strip-trailing-space) + "e" gnus-article-strip-trailing-space + "w" gnus-article-remove-leading-whitespace) (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) "v" gnus-version @@ -1776,7 +1777,9 @@ increase the score of each group you read." ["All of the above" gnus-article-strip-blank-lines t] ["All" gnus-article-strip-all-blank-lines t] ["Leading space" gnus-article-strip-leading-space t] - ["Trailing space" gnus-article-strip-trailing-space t]) + ["Trailing space" gnus-article-strip-trailing-space t] + ["Leading space in headers" + gnus-article-remove-leading-whitespace t]) ["Overstrike" gnus-article-treat-overstrike t] ["Dumb quotes" gnus-article-treat-dumbquotes t] ["Emphasis" gnus-article-emphasize t] -- 2.25.1