X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmessage.el;h=ac8e25166bf38527b6425e593d37a7717bfe7a09;hb=a8ee92ba66284aa600ccd866e9a85fcbe35ea116;hp=11149e625765d1bf2c5ae5111a2fc84a8751092e;hpb=a909359ac59a0b3346fc41a5946b9cd437a85ef3;p=gnus diff --git a/lisp/message.el b/lisp/message.el index 11149e625..ac8e25166 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -189,11 +189,11 @@ Checks include `subject-cmsg', `multiple-headers', `sendsys', `approved', `sender', `empty', `empty-headers', `message-id', `from', `subject', `shorten-followup-to', `existing-newsgroups', `buffer-file-name', `unchanged', `newsgroups', `reply-to', -'continuation-headers'." +'continuation-headers', and `long-header-lines'." :group 'message-news :type '(repeat sexp)) ; Fixme: improve this -(defcustom message-required-headers '((optional . References)) +(defcustom message-required-headers '((optional . References) From) "*Headers to be generated or promted for when sending a message. Also see `message-required-news-headers' and 1message-required-mail-headers'." @@ -201,7 +201,7 @@ Also see `message-required-news-headers' and :group 'message-headers :type '(repeat sexp)) -(defcustom message-draft-headers '(References) +(defcustom message-draft-headers '(References From) "*Headers to be generated when saving a draft message." :group 'message-news :group 'message-headers @@ -2009,7 +2009,7 @@ Point is left at the beginning of the narrowed-to region." (define-key message-mode-map "\C-c\C-i" 'message-goto-signature) (define-key message-mode-map "\C-c\C-t" 'message-insert-to) - (define-key message-mode-map "\C-c\C-p" 'message-insert-wide-reply) + (define-key message-mode-map "\C-c\M-t" 'message-insert-wide-reply) (define-key message-mode-map "\C-c\C-n" 'message-insert-newsgroups) (define-key message-mode-map "\C-c\C-l" 'message-to-list-only) @@ -2066,7 +2066,7 @@ Point is left at the beginning of the narrowed-to region." ["Request Receipt" message-insert-disposition-notification-to ,@(if (featurep 'xemacs) '(t) - '(:help "Request a Disposition Notification of this article"))] + '(:help "Request a receipt notification"))] ["Spellcheck" ispell-message ,@(if (featurep 'xemacs) '(t) '(:help "Spellcheck this message"))] @@ -3771,6 +3771,20 @@ Otherwise, generate and save a value for `canlock-password' first." (y-or-n-p "The control code \"cmsg\" is in the subject. Really post? ") t)) + ;; Check long header lines. + (message-check 'long-header-lines + (let ((start (point)) + found) + (while (and (not found) + (re-search-forward "^\\([^ \t:]+\\): " nil t)) + (when (> (- (point) start) 998) + (setq found t)) + (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))) + t))) ;; Check for multiple identical headers. (message-check 'multiple-headers (let (found) @@ -4626,13 +4640,18 @@ Headers already prepared in the buffer are not modified." (progn ;; This header didn't exist, so we insert it. (goto-char (point-max)) - (insert (if (stringp header) header (symbol-name header)) - ": " value) - ;; We check whether the value was ended by a - ;; newline. If now, we insert one. - (unless (bolp) - (insert "\n")) - (forward-line -1)) + (let ((formatter + (cdr (assq header message-header-format-alist)))) + (if formatter + (funcall formatter header value) + (insert (if (stringp header) + header (symbol-name header)) + ": " value)) + ;; We check whether the value was ended by a + ;; newline. If now, we insert one. + (unless (bolp) + (insert "\n")) + (forward-line -1))) ;; The value of this header was empty, so we clear ;; totally and insert the new value. (delete-region (point) (gnus-point-at-eol))