(message-check-news-body-syntax): Fix signature check if there's an
authorReiner Steib <Reiner.Steib@gmx.de>
Mon, 22 Dec 2008 21:25:20 +0000 (21:25 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Mon, 22 Dec 2008 21:25:20 +0000 (21:25 +0000)
attachment.

lisp/ChangeLog
lisp/message.el

index b37c77f..6c37e59 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-22  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * message.el (message-check-news-body-syntax): Fix signature check if
+       there's an attachment.
+
 2008-12-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * mm-util.el: Add comments to the mm- emulating functions.
index 019fb62..9f77e9c 100644 (file)
@@ -2395,6 +2395,8 @@ Return the number of headers removed."
      (point-max)))
   (goto-char (point-min)))
 
+;; FIXME: clarify diffference: message-narrow-to-head,
+;; message-narrow-to-headers-or-head, message-narrow-to-headers
 (defun message-narrow-to-head ()
   "Narrow the buffer to the head of the message.
 Point is left at the beginning of the narrowed-to region."
@@ -5119,17 +5121,24 @@ Otherwise, generate and save a value for `canlock-password' first."
        nil)))
    ;; Check the length of the signature.
    (message-check 'signature
-     (goto-char (point-max))
-     (if (not (re-search-backward message-signature-separator nil t))
-        t
-       (if (>= (count-lines (1+ (point-at-eol)) (point-max)) 5)
-          (if (message-gnksa-enable-p 'signature)
-              (y-or-n-p
-               (format "Signature is excessively long (%d lines).  Really post? "
-                       (count-lines (1+ (point-at-eol)) (point-max))))
-            (message "Denied posting -- Excessive signature.")
-            nil)
-        t)))
+     (let (sig-start sig-end)
+       (goto-char (point-max))
+       (if (not (re-search-backward message-signature-separator nil t))
+          t
+        (setq sig-start (1+ (point-at-eol)))
+        (setq sig-end
+              (if (re-search-forward
+                   "<#/?\\(multipart\\|part\\|external\\|mml\\)" nil t)
+                  (- (point-at-bol) 1)
+                (point-max)))
+        (if (>= (count-lines sig-start sig-end) 5)
+            (if (message-gnksa-enable-p 'signature)
+                (y-or-n-p
+                 (format "Signature is excessively long (%d lines).  Really post? "
+                         (count-lines sig-start sig-end)))
+              (message "Denied posting -- Excessive signature.")
+              nil)
+          t))))
    ;; Ensure that text follows last quoted portion.
    (message-check 'quoting-style
      (goto-char (point-max))