+2004-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * message.el (message-hidden-headers): Default to "^References:".
+ From Reiner Steib <Reiner.Steib@gmx.de>; 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 <romain@orebokech.com>
+
+ * 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 <larsi@gnus.org>
* message.el (message-strip-forbidden-properties): Bind
(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."
"Alist of header names/filler functions.")
(defvar message-header-format-alist
- `((Newsgroups)
+ `((From)
+ (Newsgroups)
(To)
(Cc)
(Subject)
"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"
(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
(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
(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)