diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-27 20:00:10 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-27 20:00:10 +0000 |
commit | 6bb637f647598002be3c8acfaf3b396966d3e581 (patch) | |
tree | ead65d2b207e8874684c558d4127e93a346ddc7d /doc | |
parent | e3b13bbba66a92a75ac73d3ab50bca45d69c7c0d (diff) | |
download | mailfromd-6bb637f647598002be3c8acfaf3b396966d3e581.tar.gz mailfromd-6bb637f647598002be3c8acfaf3b396966d3e581.tar.bz2 |
Improve mfl-mode
git-svn-id: file:///svnroot/mailfromd/trunk@1479 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'doc')
-rw-r--r-- | doc/mailfromd.texi | 78 |
1 files changed, 76 insertions, 2 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 4b2f14ac..30f542c3 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -97,6 +97,7 @@ documents @command{mailfromd} Version @value{VERSION}. * Building:: Building the Package. * Tutorial:: Mailfromd Tutorial. * MFL:: The Mail Filtering Language. +* Using MFL Mode:: Using the GNU Emacs MFL Mode. * Mailfromd Configuration:: Configuring @command{mailfromd}. * Sendmail Configuration:: Configuring Sendmail to use @command{mailfromd}. * mtasim:: An @acronym{MTA} simulator. @@ -3274,7 +3275,7 @@ used as a literal, or to require the corresponding module (@pxref{Modules}) (or include the source file directly, @pxref{include}), if it is indeed a function name. -@node MFL, Mailfromd Configuration, Tutorial, Top +@node MFL, Using MFL Mode, Tutorial, Top @chapter Mail Filtering Language @cindex MFL @cindex mail filtering language @@ -9552,7 +9553,80 @@ are keywords in @code{on} context: @item poll @end itemize -@node Mailfromd Configuration, Sendmail Configuration, MFL, Top +@node Using MFL Mode, Mailfromd Configuration, MFL, Top +@chapter Using the GNU Emacs MFL Mode +@UNREVISED{} +@cindex Emacs, @acronym{MFL} mode +@cindex GNU Emacs, @acronym{MFL} mode +@cindex @acronym{MFL} mode, GNU Emacs + @acronym{MFL} sources are usual @acronym{ASCII} files and you may +edit them with any editor you like. However, the best choice for this +job (as well as for many others) is, without doubt, GNU Emacs. To ease +the work of editing script files, the @command{mailfromd} package +provides a special Emacs mode, called @acronym{MFL} mode. + +@flindex mfl-mode.el +@flindex site-start.el +@flindex ~/.emacs +@cindex Enabling @acronym{MFL} mode +@cindex @acronym{MFL} mode, enabling +@cindex MFL mode, + The elisp source file providing this mode, @file{mfl-mode.el}, is +installed automatically, provided that GNU Emacs is present on your +machine. To enable the mode, add the following to your Emacs setup +file (either system-wide @file{site-start.el}, or your personal one, +@file{~/.emacs}): + +@smalllisp +@group +(autoload 'mfl-mode "mfl-mode") +(setq auto-mode-alist (append auto-mode-alist + '(("/usr/local/etc/mailfromd.rc" . mfl-mode) + ("\\.mf$" . mfl-mode)))) +@end group +@end smalllisp + + The first line loads the @acronym{MFL} mode, and the second one +tells Emacs to apply it to the file @file{/usr/local/etc/mailfromd.rc} +(of course, you should replace @file{/usr/local/etc/} with the exact +location, where your main filter script file is installed), and to any +file whose name ends with a @samp{.mf} suffix. + + @acronym{MFL} mode provides automatic indentation and syntax +highlighting for @acronym{MFL} sources. + +@cindex Finding function definition +@cindex Navigating through function definitions + The mode provides two special commands that help navigate through +the complex filter scripts: + +@table @kbd +@item C-M-a +Move to the beginning of current function or handler definition. + +@item C-M-e +Move to the end of current function or handler definition. +@end table + + Here, @dfn{current function or handler} means the one within which +your cursor currently stays. + + You can use @kbd{C-M-e} repeatedly to walk through all function +and handler definitions in your script files. Similarly, repeatedly +pressing @kbd{C-M-a} will visit all the definitions in the opposite +direction (from the last up to the very first one). + +@cindex Verifying script syntax + Another special command, @kbd{C-c C-c}, allows to to verify the +syntax of your script file. This command runs @command{mailfromd} in +syntax check mode (@pxref{Testing Filter Scripts}) and displays its +output in a secondary window, which allows to navigate through +eventual diagnostic messages and to jump to the source locations +described by them. + + + +@node Mailfromd Configuration, Sendmail Configuration, Using MFL Mode, Top @chapter Configuring @command{mailfromd} In the simplest case you will be able to startup |