From 669117c1a716b201995a535e37c92f09e5b2da46 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 25 Nov 2004 12:46:14 +0000 Subject: [PATCH] Synch to No Gnus 200411251245. --- lisp/ChangeLog | 18 ++++++++++++++++++ lisp/message.el | 54 +++++++++++++++++++++++++++++++++--------------------- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 127dbe8..9806112 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,21 @@ +2004-11-25 Katsumi Yamaoka + + * message.el (message-hidden-headers): Default to "^References:". + From Reiner Steib ; improve customization type. + (message-strip-forbidden-properties): Remove check for obsolete + `message-hidden' text property, hidden headers are not accessible + in the buffer anymore. From Romain Francoise on January 11, 2004. + +2004-11-22 Romain Francoise + + * message.el (message-header-format-alist): Add `From' in list + so that it can be sorted. + (message-fix-before-sending): Widen and sort headers before + sending. + (message-hide-headers): Use narrowing to hide headers by moving + them to the top of the buffer and narrowing to the region + underneath. + 2004-11-23 Lars Magne Ingebrigtsen * message.el (message-strip-forbidden-properties): Bind diff --git a/lisp/message.el b/lisp/message.el index e3d2f18..4748b52 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1306,14 +1306,21 @@ candidates: (or (not (listp message-shoot-gnksa-feet)) (memq feature message-shoot-gnksa-feet))) -(defcustom message-hidden-headers nil +(defcustom message-hidden-headers "^References:" "Regexp of headers to be hidden when composing new messages. This can also be a list of regexps to match headers. Or a list starting with `not' and followed by regexps." :version "21.4" :group 'message :link '(custom-manual "(message)Message Headers") - :type '(repeat regexp)) + :type '(choice + (regexp :tag "regexp" :format "%t\nRegexp: %v" :size 1) + (group :tag "(regexp ...)" :format "(regexp ...)\n%v" :inline t + (repeat :format "%v%i" (regexp :format "%t: %v\n" :size 1))) + (cons :tag "(not regexp ...)" + (const not) + (repeat :format "%v%i" + (regexp :format "%t: %v\n" :size 1))))) (defcustom message-cite-articles-with-x-no-archive t "If non-nil, cite text from articles that has X-No-Archive set." @@ -1756,7 +1763,8 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." "Alist of header names/filler functions.") (defvar message-header-format-alist - `((Newsgroups) + `((From) + (Newsgroups) (To) (Cc) (Subject) @@ -2674,16 +2682,13 @@ These properties are essential to work, so we should never strip them." "Strip forbidden properties between BEGIN and END, ignoring the third arg. This function is intended to be called from `after-change-functions'. See also `message-forbidden-properties'." - (let ((buffer-read-only nil) - (inhibit-read-only t)) - (when (and message-strip-special-text-properties - (message-tamago-not-in-use-p begin) - ;; Check whether the invisible MIME part is not inserted. - (not (text-property-any begin end 'mime-edit-invisible t))) - (dolist (from-to (message-text-with-property 'message-hidden - begin end t)) - (remove-text-properties (car from-to) (cdr from-to) - message-forbidden-properties))))) + (when (and message-strip-special-text-properties + (message-tamago-not-in-use-p begin) + ;; Check whether the invisible MIME part is not inserted. + (not (text-property-any begin end 'mime-edit-invisible t))) + (let ((buffer-read-only nil) + (inhibit-read-only t)) + (remove-text-properties begin end message-forbidden-properties)))) ;;;###autoload (define-derived-mode message-mode text-mode "Message" @@ -4009,9 +4014,9 @@ not have PROP." (unless (bolp) (insert "\n")) ;; Make the hidden headers visible. - (dolist (from-to (message-text-with-property 'message-hidden)) - (add-text-properties (car from-to) (cdr from-to) - '(invisible nil intangible nil))) + (widen) + ;; Sort headers before sending the message. + (message-sort-headers) ;; Make invisible text visible except for mime parts which may be ;; inserted by the MIME-Edit. ;; It doesn't seem as if this is useful, since the invisible property @@ -7694,7 +7699,8 @@ regexp VARSTR." (list message-hidden-headers) message-hidden-headers)) (inhibit-point-motion-hooks t) - (after-change-functions nil)) + (after-change-functions nil) + (end-of-headers 0)) (when regexps (save-excursion (save-restriction @@ -7703,11 +7709,17 @@ regexp VARSTR." (while (not (eobp)) (if (not (message-hide-header-p regexps)) (message-next-header) - (let ((begin (point))) + (let ((begin (point)) + header header-len) (message-next-header) - (add-text-properties - begin (point) - '(invisible t message-hidden t)))))))))) + (setq header (buffer-substring begin (point)) + header-len (- (point) begin)) + (delete-region begin (point)) + (goto-char (1+ end-of-headers)) + (insert header) + (setq end-of-headers + (+ end-of-headers header-len)))))))) + (narrow-to-region (1+ end-of-headers) (point-max)))) (defun message-hide-header-p (regexps) (let ((result nil) -- 1.7.10.4