+2001-11-07 Simon Josefsson <jas@extundo.com>
+
+ * gnus-sieve.el (gnus-sieve-generate): Don't invoke sieve-mode.
+
+ * sieve-mode.el (sieve-control-commands-face)
+ (sieve-control-commands-face, sieve-action-commands-face)
+ (sieve-test-commands-face, sieve-tagged-arguments-face): New
+ faces.
+ (sieve-font-lock-keywords): Use them.
+ (sieve-mode): Only set font-lock-defaults in emacs.
+
+ * gnus-art.el (gnus-default-article-saver): Add
+ gnus-summary-save-body-in-file.
+ (gnus-summary-write-to-file): Fix doc.
+
+2001-11-07 Simon Josefsson <jas@extundo.com>
+
+ * gnus-art.el (gnus-treat-highlight-signature): Add cross
+ reference to the correct chapter in the manual.
+
+ * mml.el (mml-mode): Add cross reference to Emacs MIME manual.
+ Suggested by "Golubev I. N." <gin@mo.msk.ru>.
+
2001-11-07 06:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* mml.el (mml-preview): Bind mail-header-separator.
* gnus-summary-save-in-mail (Unix mail format)
* gnus-summary-save-in-folder (MH folder)
* gnus-summary-save-in-file (article format)
+* gnus-summary-save-body-in-file (article body)
* gnus-summary-save-in-vm (use VM's folder format)
* gnus-summary-write-to-file (article format -- overwrite)."
:group 'gnus-article-saving
(function-item gnus-summary-save-in-mail)
(function-item gnus-summary-save-in-folder)
(function-item gnus-summary-save-in-file)
+ (function-item gnus-summary-save-body-in-file)
(function-item gnus-summary-save-in-vm)
(function-item gnus-summary-write-to-file)))
(defcustom gnus-treat-highlight-signature '(or last (typep "text/x-vcard"))
"Highlight the signature.
Valid values are nil, t, `head', `last', an integer or a predicate.
-See the manual for details."
+See Info node `(gnus)Customizing Articles'."
:group 'gnus-article-treat
:type gnus-article-treat-custom)
(put 'gnus-treat-highlight-signature 'highlight t)
filename)
(defun gnus-summary-write-to-file (&optional filename)
- "Write this article to a file.
+ "Write this article to a file, overwriting it if the file exists.
Optional argument FILENAME specifies file name.
The directory to save in defaults to `gnus-article-save-directory'."
(gnus-summary-save-in-file nil t))
(insert sieve-template))
(insert gnus-sieve-region-start
(gnus-sieve-script gnus-sieve-select-method gnus-sieve-crosspost)
- gnus-sieve-region-end)
- (sieve-mode))
+ gnus-sieve-region-end))
(defun gnus-sieve-guess-rule-for-article ()
"Guess a sieve rule based on RFC822 article in buffer.
(defun mml-mode (&optional arg)
"Minor mode for editing MML.
+MML is the MIME Meta Language, a minor mode for composing MIME articles.
+See Info node `(emacs-mime)Composing'.
\\{mml-mode-map}"
(interactive "P")
;; added keymap and menubar to hook into sieve-manage
;; 2001-10-31 version 1.2 committed to Oort Gnus
;;
-;; $Id: sieve-mode.el,v 1.1.2.1 2001-11-01 08:25:40 yamaoka Exp $
+;; $Id: sieve-mode.el,v 1.1.2.2 2001-11-08 00:10:42 yamaoka Exp $
;;; Code:
;; Font-lock
+(defvar sieve-control-commands-face 'sieve-control-commands-face
+ "Face name used for Sieve Control Commands.")
+
+(defface sieve-control-commands-face
+ '((((type tty) (class color)) (:foreground "blue" :weight light))
+ (((class grayscale) (background light)) (:foreground "LightGray" :bold t))
+ (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
+ (((class color) (background light)) (:foreground "Orchid"))
+ (((class color) (background dark)) (:foreground "LightSteelBlue"))
+ (t (:bold t)))
+ "Face used for Sieve Control Commands.")
+
+(defvar sieve-action-commands-face 'sieve-action-commands-face
+ "Face name used for Sieve Action Commands.")
+
+(defface sieve-action-commands-face
+ '((((type tty) (class color)) (:foreground "blue" :weight bold))
+ (((class color) (background light)) (:foreground "Blue"))
+ (((class color) (background dark)) (:foreground "LightSkyBlue"))
+ (t (:inverse-video t :bold t)))
+ "Face used for Sieve Action Commands.")
+
+(defvar sieve-test-commands-face 'sieve-test-commands-face
+ "Face name used for Sieve Test Commands.")
+
+(defface sieve-test-commands-face
+ '((((type tty) (class color)) (:foreground "magenta"))
+ (((class grayscale) (background light))
+ (:foreground "LightGray" :bold t :underline t))
+ (((class grayscale) (background dark))
+ (:foreground "Gray50" :bold t :underline t))
+ (((class color) (background light)) (:foreground "CadetBlue"))
+ (((class color) (background dark)) (:foreground "Aquamarine"))
+ (t (:bold t :underline t)))
+ "Face used for Sieve Test Commands.")
+
+(defvar sieve-tagged-arguments-face 'sieve-tagged-arguments-face
+ "Face name used for Sieve Tagged Arguments.")
+
+(defface sieve-tagged-arguments-face
+ '((((type tty) (class color)) (:foreground "cyan" :weight bold))
+ (((class grayscale) (background light)) (:foreground "LightGray" :bold t))
+ (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
+ (((class color) (background light)) (:foreground "Purple"))
+ (((class color) (background dark)) (:foreground "Cyan"))
+ (t (:bold t)))
+ "Face used for Sieve Tagged Arguments.")
+
+
(defconst sieve-font-lock-keywords
(eval-when-compile
(list
;; control commands
(cons (regexp-opt '("require" "if" "else" "elsif" "stop"))
- 'font-lock-keyword-face)
+ 'sieve-control-commands-face)
;; action commands
(cons (regexp-opt '("fileinto" "redirect" "reject" "keep" "discard"))
- 'font-lock-keyword-face)
+ 'sieve-action-commands-face)
;; test commands
(cons (regexp-opt '("address" "allof" "anyof" "exists" "false"
"true" "header" "not" "size" "envelope"))
- 'font-lock-builtin-face)
- (cons "\\Sw+:\\sw+" 'font-lock-constant-face))))
+ 'sieve-test-commands-face)
+ (cons "\\Sw+:\\sw+"
+ 'sieve-tagged-arguments-face))))
;; Syntax table
(set (make-local-variable 'comment-end) "")
;;(set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
(set (make-local-variable 'comment-start-skip) "#+ *")
- (set (make-local-variable 'font-lock-defaults)
- '(sieve-font-lock-keywords nil nil ((?_ . "w"))))
+ (unless (featurep 'xemacs)
+ (set (make-local-variable 'font-lock-defaults)
+ '(sieve-font-lock-keywords nil nil ((?_ . "w")))))
(easy-menu-add-item nil nil sieve-mode-menu))
;; Menu
+2001-11-07 Simon Josefsson <jas@extundo.com>
+
+ * sieve.texi (Examples): Add.
+ (Top): Add.
+
+ * gnus.texi (Saving Articles): Add gnus-summary-write-to-file.
+
+2001-11-07 Simon Josefsson <jas@extundo.com>
+
+ * gnus.texi (Misc Group Stuff): Add cross reference to Composing
+ Messages. Suggested by "Golubev I. N." <gin@mo.msk.ru>.
+
2001-11-04 09:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus.texi: Use C-M- instead of M-C-.
@findex gnus-group-post-news
\e$B$"$k%0%k!<%W$K5-;v$rEj9F$9$k\e(B (@code{gnus-group-post-news})\e$B!#%W%l%U%#%C%/\e(B
\e$B%9$rM?$($k$H!"8=:_$N%0%k!<%WL>$,=i4|CM$H$7$F;HMQ$5$l$^$9!#\e(B
+@xref{Composing Messages}\e$B!#\e(B
@item m
@kindex m (Group)
@findex gnus-group-mail
-\e$B%a!<%k$r$I$3$+$KAw$k\e(B (@code{gnus-group-mail})\e$B!#\e(B
+\e$B%a!<%k$r$I$3$+$KAw$k\e(B (@code{gnus-group-mail})\e$B!#\e(B@xref{Composing Messages}\e$B!#\e(B
@end table
\e$B0J2<$O%0%k!<%W%P%C%U%!$N$?$a$NJQ?t$G$9\e(B:
\e$BF~$C$F$$$k4X?t$r!"5-;v$rJ]B8$9$k$?$a$N%U%!%$%kL>$r<hF@$9$k$?$a$K;HMQ$7$^\e(B
\e$B$9!#%G%#%U%)%k%H$O\e(B @code{gnus-numeric-save-name} \e$B$G$9!#\e(B
+@item gnus-summary-write-to-file
+@findex gnus-summary-write-to-file
+\e$B5-;v$r%9%H%l!<%H$KDL>o$N%U%!%$%k$KJ]B8$7$^$9!#$=$N%U%!%$%k$,B8:_$7$F$$$?\e(B
+\e$B$i>e=q$-$5$l$^$9!#JQ?t\e(B @code{gnus-file-save-name} \e$B$KF~$C$F$$$k4X?t$r!"5-\e(B
+\e$B;v$rJ]B8$9$k$?$a$N%U%!%$%kL>$r<hF@$9$k$?$a$K;HMQ$7$^$9!#%G%#%U%)%k%H\e(B
+\e$B$O\e(B @code{gnus-numeric-save-name} \e$B$G$9!#\e(B
+
@item gnus-summary-save-body-in-file
@findex gnus-summary-save-body-in-file
\e$B5-;v$NK\BN$rDL>o$N%U%!%$%k$N8e$KDI2C$7$^$9!#JQ\e(B
@findex gnus-group-post-news
Post an article to a group (@code{gnus-group-post-news}). If given a
prefix, the current group name will be used as the default.
+@xref{Composing Messages}.
@item m
@kindex m (Group)
@findex gnus-group-mail
-Mail a message somewhere (@code{gnus-group-mail}).
+Mail a message somewhere (@code{gnus-group-mail}). @xref{Composing Messages}.
@end table
the @code{gnus-file-save-name} variable to get a file name to save the
article in. The default is @code{gnus-numeric-save-name}.
+@item gnus-summary-write-to-file
+@findex gnus-summary-write-to-file
+Write the article straight to an ordinary file. The file is
+overwritten if it exists. Uses the function in the
+@code{gnus-file-save-name} variable to get a file name to save the
+article in. The default is @code{gnus-numeric-save-name}.
+
@item gnus-summary-save-body-in-file
@findex gnus-summary-save-body-in-file
Append the article body to an ordinary file. Uses the function in the
is documented in RFC 3028. This manual does not attempt to document
the language, so keep RFC 3028 around.
+A good online Sieve resources is @uref{http://www.cyrusoft.com/sieve/}.
+
@menu
* Installation:: Getting ready to use the package.
* Sieve Mode:: Editing Sieve scripts.
* Managing Sieve:: Managing Sieve scripts on a remote server.
+* Examples :: A few Sieve code snippets.
* Manage Sieve API :: Interfacing to the Manage Sieve Protocol API.
* Standards:: A summary of RFCs and working documents used.
* Index:: Function and variable index.
@end table
+@node Examples
+@chapter Examples
+
+If you are not familiar with Sieve, this chapter contains a few simple
+code snippets that you can cut'n'paste and modify at will, until you
+feel more comfortable with the Sieve language to write the rules from
+scratch.
+
+The following complete Sieve script places all messages with a matching
+@samp{Sender:} header into the given mailbox. Many mailing lists uses
+this format. The first line makes sure your Sieve server understands
+the @code{fileinto} command.
+
+@example
+require "fileinto";
+
+if address "sender" "owner-w3-beta@@xemacs.org" @{
+ fileinto "INBOX.w3-beta";
+@}
+@end example
+
+A few mailing lists do not use the @samp{Sender:} header, but does
+contain some unique identifier in some other header. The following is
+not a complete script, it assumes that @code{fileinto} has already been
+required.
+
+@example
+if header :contains "Delivered-To" "auc-tex@@sunsite.dk" @{
+ fileinto "INBOX.auc-tex";
+@}
+@end example
+
+At last, we have the hopeless mailing lists that does not have any
+unique identifier and you are forced to match on the @samp{To:} and
+@samp{Cc} headers. As before, this snippet assumes that @code{fileinto}
+has been required.
+
+@example
+if address ["to", "cc"] "kerberos@@mit.edu" @{
+ fileinto "INBOX.kerberos";
+@}
+@end example
+
@node Manage Sieve API
@chapter Manage Sieve API