Sync up with gnus-6_10.
[elisp/gnus.git-] / lisp / gnus-art.el
index ca0a9fa..b67fa90 100644 (file)
@@ -701,9 +701,8 @@ always hide."
            ;; select which header lines is to remain visible in the
            ;; article buffer.
            (goto-char (point-min))
-           (while (memq (char-after) '(?\t ?\ ))
-             (forward-line 1))
-           (while (not (eobp))
+           (while (re-search-forward "^[^ \t]*:" nil t)
+             (beginning-of-line)
              ;; Mark the rank of the header.
              (put-text-property
               (point) (1+ (point)) 'message-rank
@@ -712,9 +711,7 @@ always hide."
                            (not (looking-at ignored))))
                   (gnus-article-header-rank)
                 (+ 2 max)))
-             (forward-line 1)
-             (while (memq (char-after) '(?\t ?\ ))
-               (forward-line 1)))
+             (forward-line 1))
            (message-sort-headers-1)
            (when (setq beg (text-property-any
                             (point-min) (point-max) 'message-rank (+ 2 max)))
@@ -749,11 +746,12 @@ always hide."
              (while (re-search-forward "^[^:]+:[ \t]*\n[^ \t]" nil t)
                (forward-line -1)
                (gnus-article-hide-text-type
-                (point)
+                (progn (beginning-of-line) (point))
                 (progn
-                  (while (and (zerop (forward-line 1))
-                              (memq (char-after) '(?\t ?\ ))))
-                  (point))
+                  (end-of-line)
+                  (if (re-search-forward "^[^ \t]" nil t)
+                      (match-beginning 0)
+                    (point-max)))
                 'boring-headers)))
             ;; Hide boring Newsgroups header.
             ((eq elem 'newsgroups)
@@ -809,9 +807,10 @@ always hide."
       (gnus-article-hide-text-type
        (progn (beginning-of-line) (point))
        (progn
-        (while (and (zerop (forward-line 1))
-                    (memq (char-after) '(?\t ?\ ))))
-        (point))
+        (end-of-line)
+        (if (re-search-forward "^[^ \t]" nil t)
+            (match-beginning 0)
+          (point-max)))
        'boring-headers))))
 
 (defun article-treat-dumbquotes ()
@@ -878,7 +877,7 @@ characters to translate to."
            (adaptive-fill-mode t))
        (while (not (eobp))
          (and (>= (current-column) (min fill-column (window-width)))
-              (not (eq (preceding-char) ?:))
+              (not (eq (char-before) ?:))
               (fill-paragraph nil))
          (end-of-line 2))))))
 
@@ -2707,7 +2706,7 @@ groups."
   "Exit the article editing without updating."
   (interactive)
   ;; We remove all text props from the article buffer.
-  (let ((buf (format "%s" (buffer-substring (point-min) (point-max))))
+  (let ((buf (format "%s" (buffer-string)))
        (curbuf (current-buffer))
        (p (point))
        (window-start (window-start)))
@@ -2816,7 +2815,7 @@ after replacing with the original article."
       (setq font-lock-defaults nil)
       (font-lock-mode 0))
     ;; We remove all text props from the article buffer.
-    (setq buf (format "%s" (buffer-substring (point-min) (point-max))))
+    (setq buf (format "%s" (buffer-string)))
     (set-buffer (get-buffer-create gnus-original-article-buffer))
     (erase-buffer)
     (insert buf)
@@ -3029,11 +3028,9 @@ do the highlighting.  See the documentation for those functions."
            (when (and field-face
                       (not (memq (setq from (point)) fpoints)))
              (push from fpoints)
-             (while (and (zerop (forward-line 1))
-                         (memq (char-after) '(?\t ?\ ))))
-             (unless (eobp)
-               ;; Go to the end of the previous line.
-               (end-of-line 0))
+             (if (re-search-forward "^[^ \t]" nil t)
+                 (forward-char -2)
+               (goto-char (point-max)))
              (gnus-put-text-property from (point) 'face field-face))))))))
 
 (defun gnus-article-highlight-signature ()
@@ -3125,9 +3122,9 @@ specified by `gnus-button-alist'."
        (while (re-search-forward (car entry) nil t)
          ;; Each header matching the entry.
          (setq beg (match-beginning 0))
-         (while (and (zerop (forward-line 1))
-                     (memq (char-after) '(?\t ?\ ))))
-         (setq end (point))
+         (setq end (or (and (re-search-forward "^[^ \t]" nil t)
+                            (match-beginning 0))
+                       (point-max)))
          (goto-char beg)
          (while (re-search-forward (nth 1 entry) end t)
            ;; Each match within a header.