(message-check-news-header-syntax): Compute the
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 11 Jan 2003 19:34:20 +0000 (19:34 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 11 Jan 2003 19:34:20 +0000 (19:34 +0000)
header length correctly.

lisp/ChangeLog
lisp/gnus-fun.el
lisp/message.el

index efdaa6e..3060c13 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * message.el (message-check-news-header-syntax): Compute the
+       header length correctly.
+
 2002-01-10  Kevin Greiner  <kgreiner@xpediantsolutions.com>
 
        * gnus-agent.el (gnus-agent-expire): Do not remove article from
index 08b60e6..aa711da 100644 (file)
@@ -85,6 +85,7 @@ Output to the current buffer, replace text, and don't mingle error."
   (when (file-exists-p file)
     (let ((done nil)
          (attempt "")
+         (step 72)
          (quant 16))
       (while (and (not done)
                  (> quant 1))
@@ -104,10 +105,14 @@ Output to the current buffer, replace text, and don't mingle error."
            (insert attempt)
            (base64-encode-region (point-min) (point-max))
            (goto-char (point-min))
-           (forward-line 1)
-           (while (not (eobp))
-             (insert " ")
-             (forward-line 1))
+           (while (search-forward "\n" nil t)
+             (replace-match ""))
+           (goto-char (point-min))
+           (while (> (- (point-max) (point))
+                     step)
+             (forward-char step)
+             (insert "\n ")
+             (setq step 76))
            (buffer-string))
        nil))))
 
index d791b13..cb0e6f2 100644 (file)
@@ -3779,16 +3779,20 @@ Otherwise, generate and save a value for `canlock-password' first."
    ;; Check long header lines.
    (message-check 'long-header-lines
      (let ((start (point))
+          (header nil)
+          (length 0)
           found)
        (while (and (not found)
                   (re-search-forward "^\\([^ \t:]+\\): " nil t))
-        (when (> (- (point) start) 998)
-          (setq found t))
+        (if (> (- (point) (match-beginning 0)) 998)
+            (setq found t
+                  length (- (point) (match-beginning 0)))
+          (setq header (match-string-no-properties 1)))
         (setq start (match-beginning 0))
         (forward-line 1))
        (if found
-          (y-or-n-p (format "Your %s header is too long.  Really post? "
-                            (match-string 1)))
+          (y-or-n-p (format "Your %s header is too long (%d).  Really post? "
+                            header length))
         t)))
    ;; Check for multiple identical headers.
    (message-check 'multiple-headers