* gnus-msg.el (gnus-posting-styles): Add new format of header.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Thu, 31 Jan 2002 15:17:28 +0000 (15:17 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Thu, 31 Jan 2002 15:17:28 +0000 (15:17 +0000)
(gnus-configure-posting-styles): Support the new format.

* mail-source.el (mail-source-bind, mail-source-bind-common): Set
edebug-form-spec to (sexp body).
Suggested by Joe Wells <jbw@izanami.cee.hw.ac.uk>.

lisp/ChangeLog
lisp/gnus-msg.el
lisp/mail-source.el

index 0a6ffa5..841529c 100644 (file)
@@ -1,5 +1,12 @@
 2002-01-31  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
+       * gnus-msg.el (gnus-posting-styles): Add new format of header.
+       (gnus-configure-posting-styles): Support the new format.
+
+       * mail-source.el (mail-source-bind, mail-source-bind-common): Set
+       edebug-form-spec to (sexp body).
+       Suggested by Joe Wells <jbw@izanami.cee.hw.ac.uk>.
+
        * message.el (message-reply-headers): Add doc.
 
 2002-01-30  ShengHuo ZHU  <zsh@cs.rochester.edu>
index 8b6b7ff..01675ce 100644 (file)
@@ -116,8 +116,11 @@ the second with the current group name."
 See Info node `(gnus)Posting Styles'."
   :group 'gnus-message
   :type '(repeat (cons (choice (regexp)
-                              (function)
                               (variable)
+                              (list (const header)
+                                    (string :tag "Header")
+                                    (regexp :tag "Regexp"))
+                              (function)
                               (sexp))
                       (repeat (list
                                (choice (const signature)
@@ -126,6 +129,7 @@ See Info node `(gnus)Posting Styles'."
                                        (const address)
                                        (const name)
                                        (const body)
+                                       (symbol)
                                        (string :tag "Header"))
                                (choice (string)
                                        (function)
@@ -134,6 +138,7 @@ See Info node `(gnus)Posting Styles'."
 
 (defcustom gnus-gcc-mark-as-read nil
   "If non-nil, automatically mark Gcc articles as read."
+  :version "21.1"
   :group 'gnus-message
   :type 'boolean)
 
@@ -148,6 +153,7 @@ See Info node `(gnus)Posting Styles'."
 If it is `all', attach files as external parts;
 if a regexp and matches the Gcc group name, attach files as external parts;
 If nil, attach files as normal parts."
+  :version "21.1"
   :group 'gnus-message
   :type '(choice (const nil :tag "None")
                 (const all :tag "Any")
@@ -1577,6 +1583,7 @@ this is a reply."
                ;; Regexp string match on the group name.
                (string-match match group))
               ((eq match 'header)
+               ;; Obsolete format of header match.
                (and (gnus-buffer-live-p gnus-article-copy)
                     (with-current-buffer gnus-article-copy
                       (let ((header (message-fetch-field (pop style))))
@@ -1592,8 +1599,17 @@ this is a reply."
                  ;; Variable to be checked.
                  (symbol-value match))))
               ((listp match)
-               ;; This is a form to be evaled.
-               (eval match)))
+               (cond
+                ((eq (car match) 'header)
+                 ;; New format of header match.
+                 (and (gnus-buffer-live-p gnus-article-copy)
+                      (with-current-buffer gnus-article-copy
+                        (let ((header (message-fetch-field (nth 1 match))))
+                          (and header
+                               (string-match (nth 2 match) header))))))
+                (t
+                 ;; This is a form to be evaled.
+                 (eval match)))))
          ;; We have a match, so we set the variables.
          (dolist (attribute style)
            (setq element (pop attribute)
index 982db42..d780286 100644 (file)
@@ -378,7 +378,7 @@ the `mail-source-keyword-map' variable."
      ,@body))
 
 (put 'mail-source-bind 'lisp-indent-function 1)
-(put 'mail-source-bind 'edebug-form-spec '(form body))
+(put 'mail-source-bind 'edebug-form-spec '(sexp body))
 
 (defun mail-source-set-1 (source)
   (let* ((type (pop source))
@@ -421,7 +421,7 @@ See `mail-source-bind'."
      ,@body))
 
 (put 'mail-source-bind-common 'lisp-indent-function 1)
-(put 'mail-source-bind-common 'edebug-form-spec '(form body))
+(put 'mail-source-bind-common 'edebug-form-spec '(sexp body))
 
 (defun mail-source-value (value)
   "Return the value of VALUE."