diff lisp/gnus/message.el @ 100993:a16e9f7c2536

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1513
author Miles Bader <miles@gnu.org>
date Fri, 09 Jan 2009 03:01:50 +0000
parents a9dc0e7c3f2b
children 97a01032d9d2
line wrap: on
line diff
--- a/lisp/gnus/message.el	Fri Jan 09 02:59:52 2009 +0000
+++ b/lisp/gnus/message.el	Fri Jan 09 03:01:50 2009 +0000
@@ -2395,6 +2395,8 @@
      (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."
@@ -4140,6 +4142,8 @@
 		  (and (mm-multibyte-p)
 		       (memq (char-charset char)
 			     '(eight-bit-control eight-bit-graphic
+						 ;; Emacs 23, Bug#1770:
+						 eight-bit
 						 control-1))
 		       (not (get-text-property
 			     (point) 'untranslated-utf-8))))
@@ -4166,10 +4170,13 @@
 		  (or (< (mm-char-int char) 128)
 		      (and (mm-multibyte-p)
 			   ;; FIXME: Wrong for Emacs 23 (unicode) and for
-			   ;; things like undecable utf-8.  Should at least
-			   ;; use find-coding-systems-region.
+			   ;; things like undecodable utf-8 (in Emacs 21?).
+			   ;; Should at least use find-coding-systems-region.
+			   ;; -- fx
 			   (memq (char-charset char)
 				 '(eight-bit-control eight-bit-graphic
+						     ;; Emacs 23, Bug#1770:
+						     eight-bit
 						     control-1))
 			   (not (get-text-property
 				 (point) 'untranslated-utf-8)))))
@@ -5119,17 +5126,24 @@
 	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))