2001-02-11 09:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sun, 11 Feb 2001 15:03:44 +0000 (15:03 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sun, 11 Feb 2001 15:03:44 +0000 (15:03 +0000)
* 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
lisp/gnus-art.el
lisp/gnus-group.el
lisp/gnus-sum.el

index 841fc0f..9e9612a 100644 (file)
@@ -1,3 +1,17 @@
+2001-02-11 09:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * 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  <zsh@cs.rochester.edu>
 
        * Makefile.in: Hack generating gnus-load.el.
index 9b8c1ac..8c55a7a 100644 (file)
@@ -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]
index f497437..9c69f19 100644 (file)
@@ -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
index 925e796..0924f9a 100644 (file)
@@ -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]