* gnus-art.el (gnus-article-treat-unfold-headers): Only fold when
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 30 Dec 2001 01:17:02 +0000 (01:17 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 30 Dec 2001 01:17:02 +0000 (01:17 +0000)
lines are shorter than the window width.

* gnus-art.el (gnus-treat-unfold-lines): New variable.
(gnus-treat-unfold-headers): Remamed.
(gnus-article-treat-unfold-headers): New command and keystroke.

* rfc2047.el (rfc2047-encode-message-header): Clean up.

* gnus-int.el (gnus-open-server): Mark quit-ed server as denied.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-int.el
lisp/gnus-sum.el
lisp/message.el
lisp/rfc2047.el

index 97a3969..174f1d2 100644 (file)
@@ -1,3 +1,18 @@
+2001-12-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-art.el (gnus-article-treat-unfold-headers): Only fold when
+       lines are shorter than the window width.
+
+2001-12-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-art.el (gnus-treat-unfold-lines): New variable.
+       (gnus-treat-unfold-headers): Remamed.
+       (gnus-article-treat-unfold-headers): New command and keystroke. 
+
+       * rfc2047.el (rfc2047-encode-message-header): Clean up.
+
+       * gnus-int.el (gnus-open-server): Mark quit-ed server as denied. 
+
 2001-12-29  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * sha1-el.el (sha1-use-external): New variable.
index 91c73ce..b99d776 100644 (file)
@@ -1014,6 +1014,13 @@ See the manual for details."
   :group 'gnus-article-treat
   :type gnus-article-treat-custom)
 
+(defcustom gnus-treat-unfold-headers 'head
+  "Unfold folded header lines.
+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-overstrike t
   "Treat overstrike highlighting.
 Valid values are nil, t, `head', `last', an integer or a predicate.
@@ -1161,6 +1168,7 @@ It is a string, such as \"PGP\". If nil, ask user."
     (gnus-treat-strip-multiple-blank-lines
      gnus-article-strip-multiple-blank-lines)
     (gnus-treat-overstrike gnus-article-treat-overstrike)
+    (gnus-treat-unfold-headers gnus-article-treat-unfold-headers)
     (gnus-treat-buttonize-head gnus-article-add-buttons-to-head)
     (gnus-treat-display-smileys gnus-smiley-display)
     (gnus-treat-capitalize-sentences gnus-article-capitalize-sentences)
@@ -1540,6 +1548,32 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
              (put-text-property
               (point) (1+ (point)) 'face 'underline)))))))))
 
+(defun gnus-article-treat-unfold-headers ()
+  "Translate overstrikes into bold text."
+  (interactive)
+  (save-excursion
+    (set-buffer gnus-article-buffer)
+    (save-restriction
+      (let ((buffer-read-only nil)
+           (inhibit-point-motion-hooks t)
+           (case-fold-search t)
+           length)
+       (article-narrow-to-head)
+       (while (not (eobp))
+         (save-restriction
+           (mail-header-narrow-to-field)
+           (let ((header (buffer-substring (point-min) (point-max))))
+             (with-temp-buffer
+               (insert header)
+               (goto-char (point-min))
+               (while (re-search-forward "[\t ]*\n[\t ]+" nil t)
+                 (replace-match " " t t)))
+               (setq length (- (point-max) (point-min) 1)))
+           (when (< length (window-width))
+             (while (re-search-forward "[\t ]*\n[\t ]+" nil t)
+               (replace-match " " t t)))
+           (goto-char (point-max))))))))
+
 (defun article-fill-long-lines ()
   "Fill lines that are wider than the window width."
   (interactive)
index f95804e..fbb50db 100644 (file)
@@ -183,9 +183,13 @@ If it is down, start it up (again)."
          nil)
       ;; Open the server.
       (let ((result
-            (funcall (gnus-get-function gnus-command-method 'open-server)
-                     (nth 1 gnus-command-method)
-                     (nthcdr 2 gnus-command-method))))
+            (condition-case ()
+                (funcall (gnus-get-function gnus-command-method 'open-server)
+                         (nth 1 gnus-command-method)
+                         (nthcdr 2 gnus-command-method))
+              (quit
+               (message "Quit trying to open server")
+               nil))))
        ;; If this hasn't been opened before, we add it to the list.
        (unless elem
          (setq elem (list gnus-command-method nil)
index a89435f..10564b1 100644 (file)
@@ -1727,6 +1727,7 @@ increase the score of each group you read."
     "r" gnus-summary-caesar-message
     "t" gnus-summary-toggle-header
     "g" gnus-summary-toggle-smiley
+    "u" gnus-article-treat-unfold-headers
     "v" gnus-summary-verbose-headers
     "a" gnus-article-strip-headers-in-body ;; mnemonic: wash archive
     "p" gnus-article-verify-x-pgp-sig
@@ -1924,6 +1925,7 @@ increase the score of each group you read."
              ["Verbose header" gnus-summary-verbose-headers t]
              ["Toggle header" gnus-summary-toggle-header t]
              ["Toggle smiley" gnus-summary-toggle-smiley t]
+             ["Unfold headers" gnus-article-treat-unfold-headers t]
              ["Html" gnus-article-wash-html t]
              ["Verify X-PGP-Sig" gnus-article-verify-x-pgp-sig t]
              ["HZ" gnus-article-decode-HZ t])
index 0ab6e9a..346461c 100644 (file)
@@ -2553,7 +2553,8 @@ It should typically alter the sending method in some way or other."
                         (error "Denied posting -- multiple copies")))
                   (setq success (funcall (caddr elem) arg)))
          (setq sent t))))
-    (unless (or sent (not success)
+    (unless (or sent
+               (not success)
                (let ((fcc (message-fetch-field "Fcc"))
                      (gcc (message-fetch-field "Gcc")))
                  (when (or fcc gcc)
index 28f993a..530059e 100644 (file)
@@ -574,5 +574,3 @@ If your Emacs implementation can't decode CHARSET, return nil."
 (provide 'rfc2047)
 
 ;;; rfc2047.el ends here
-
-