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 | |
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
36 files changed, 977 insertions, 629 deletions
@@ -1,3 +1,18 @@ | |||
1 | 2007-05-27 Sergey Poznyakoff <gray@gnu.org.ua> | ||
2 | |||
3 | * elisp/mfl-mode.el: Initial implementation | ||
4 | * tests/shadow.at, tests/bctx00.at, tests/fctx00.at, | ||
5 | tests/macros.at, tests/etc/reject.rc, tests/etc/farg.rc, | ||
6 | tests/etc/cidr.rc, tests/etc/catch.rc, tests/etc/catch01.rc, | ||
7 | tests/etc/cond.rc, tests/etc/dns.rc, tests/etc/macros.rc, | ||
8 | tests/etc/shadow.rc, tests/etc/relayed.rc, tests/etc/var.rc, | ||
9 | tests/etc/numrcpt.rc, tests/etc/strings.rc, tests/etc/prec.rc, | ||
10 | tests/etc/ack.rc, tests/etc/accept.rc, tests/etc/switch.rc, | ||
11 | tests/etc/tempfail.rc, tests/etc/greylist.rc, tests/etc/poll-1.rc, | ||
12 | tests/etc/sa01.rc, tests/etc/sa02.rc, tests/etc/poll.rc, | ||
13 | tests/etc/sa03.rc, tests/etc/sa04.rc, tests/etc/ml.rc, | ||
14 | tests/etc/arg.rc, etc/mailfromd.rc: Use MFL Emacs mode | ||
15 | |||
1 | 2007-05-26 Sergey Poznyakoff <gray@gnu.org.ua> | 16 | 2007-05-26 Sergey Poznyakoff <gray@gnu.org.ua> |
2 | 17 | ||
3 | * doc/mailfromd.texi: Update | 18 | * doc/mailfromd.texi: Update |
@@ -1,4 +1,4 @@ | |||
1 | Mailfromd NEWS -- history of user-visible changes. 2007-05-24 | 1 | Mailfromd NEWS -- history of user-visible changes. 2007-05-27 |
2 | Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff | 2 | Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff |
3 | See the end of file for copying conditions. | 3 | See the end of file for copying conditions. |
4 | 4 | ||
@@ -19,6 +19,15 @@ language. The following functions are implemented: bindtextdomain, | |||
19 | dgettext, dngettext, textdomain, gettext, ngettext. In addition, | 19 | dgettext, dngettext, textdomain, gettext, ngettext. In addition, |
20 | macros _() and N_() are also provided. | 20 | macros _() and N_() are also provided. |
21 | 21 | ||
22 | * GNU Emacs MFL Mode | ||
23 | |||
24 | This release comes with the file `mfl-mode.el', providing MFL mode for | ||
25 | GNU Emacs. This mode facilitates editing MFL source files. By | ||
26 | default, the new mode is installed whenever configure determines the | ||
27 | presense of GNU Emacs on your machine. See the documentation, node | ||
28 | `Using MFL Mode' for the detailed discussion of this mode including | ||
29 | customization information. | ||
30 | |||
22 | * Input files are preprocessed before compilation. Default preprocessor is | 31 | * Input files are preprocessed before compilation. Default preprocessor is |
23 | M4, but this can be changed (or disabled) at configuration time (see | 32 | M4, but this can be changed (or disabled) at configuration time (see |
24 | `DEFAULT_PREPROCESSOR' variable and `--with-preprocessor' command | 33 | `DEFAULT_PREPROCESSOR' variable and `--with-preprocessor' command |
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}. | |||
97 | * Building:: Building the Package. | 97 | * Building:: Building the Package. |
98 | * Tutorial:: Mailfromd Tutorial. | 98 | * Tutorial:: Mailfromd Tutorial. |
99 | * MFL:: The Mail Filtering Language. | 99 | * MFL:: The Mail Filtering Language. |
100 | * Using MFL Mode:: Using the GNU Emacs MFL Mode. | ||
100 | * Mailfromd Configuration:: Configuring @command{mailfromd}. | 101 | * Mailfromd Configuration:: Configuring @command{mailfromd}. |
101 | * Sendmail Configuration:: Configuring Sendmail to use @command{mailfromd}. | 102 | * Sendmail Configuration:: Configuring Sendmail to use @command{mailfromd}. |
102 | * mtasim:: An @acronym{MTA} simulator. | 103 | * mtasim:: An @acronym{MTA} simulator. |
@@ -3274,7 +3275,7 @@ used as a literal, or to require the corresponding module | |||
3274 | (@pxref{Modules}) (or include the source file directly, | 3275 | (@pxref{Modules}) (or include the source file directly, |
3275 | @pxref{include}), if it is indeed a function name. | 3276 | @pxref{include}), if it is indeed a function name. |
3276 | 3277 | ||
3277 | @node MFL, Mailfromd Configuration, Tutorial, Top | 3278 | @node MFL, Using MFL Mode, Tutorial, Top |
3278 | @chapter Mail Filtering Language | 3279 | @chapter Mail Filtering Language |
3279 | @cindex MFL | 3280 | @cindex MFL |
3280 | @cindex mail filtering language | 3281 | @cindex mail filtering language |
@@ -9552,7 +9553,80 @@ are keywords in @code{on} context: | |||
9552 | @item poll | 9553 | @item poll |
9553 | @end itemize | 9554 | @end itemize |
9554 | 9555 | ||
9555 | @node Mailfromd Configuration, Sendmail Configuration, MFL, Top | 9556 | @node Using MFL Mode, Mailfromd Configuration, MFL, Top |
9557 | @chapter Using the GNU Emacs MFL Mode | ||
9558 | @UNREVISED{} | ||
9559 | @cindex Emacs, @acronym{MFL} mode | ||
9560 | @cindex GNU Emacs, @acronym{MFL} mode | ||
9561 | @cindex @acronym{MFL} mode, GNU Emacs | ||
9562 | @acronym{MFL} sources are usual @acronym{ASCII} files and you may | ||
9563 | edit them with any editor you like. However, the best choice for this | ||
9564 | job (as well as for many others) is, without doubt, GNU Emacs. To ease | ||
9565 | the work of editing script files, the @command{mailfromd} package | ||
9566 | provides a special Emacs mode, called @acronym{MFL} mode. | ||
9567 | |||
9568 | @flindex mfl-mode.el | ||
9569 | @flindex site-start.el | ||
9570 | @flindex ~/.emacs | ||
9571 | @cindex Enabling @acronym{MFL} mode | ||
9572 | @cindex @acronym{MFL} mode, enabling | ||
9573 | @cindex MFL mode, | ||
9574 | The elisp source file providing this mode, @file{mfl-mode.el}, is | ||
9575 | installed automatically, provided that GNU Emacs is present on your | ||
9576 | machine. To enable the mode, add the following to your Emacs setup | ||
9577 | file (either system-wide @file{site-start.el}, or your personal one, | ||
9578 | @file{~/.emacs}): | ||
9579 | |||
9580 | @smalllisp | ||
9581 | @group | ||
9582 | (autoload 'mfl-mode "mfl-mode") | ||
9583 | (setq auto-mode-alist (append auto-mode-alist | ||
9584 | '(("/usr/local/etc/mailfromd.rc" . mfl-mode) | ||
9585 | ("\\.mf$" . mfl-mode)))) | ||
9586 | @end group | ||
9587 | @end smalllisp | ||
9588 | |||
9589 | The first line loads the @acronym{MFL} mode, and the second one | ||
9590 | tells Emacs to apply it to the file @file{/usr/local/etc/mailfromd.rc} | ||
9591 | (of course, you should replace @file{/usr/local/etc/} with the exact | ||
9592 | location, where your main filter script file is installed), and to any | ||
9593 | file whose name ends with a @samp{.mf} suffix. | ||
9594 | |||
9595 | @acronym{MFL} mode provides automatic indentation and syntax | ||
9596 | highlighting for @acronym{MFL} sources. | ||
9597 | |||
9598 | @cindex Finding function definition | ||
9599 | @cindex Navigating through function definitions | ||
9600 | The mode provides two special commands that help navigate through | ||
9601 | the complex filter scripts: | ||
9602 | |||
9603 | @table @kbd | ||
9604 | @item C-M-a | ||
9605 | Move to the beginning of current function or handler definition. | ||
9606 | |||
9607 | @item C-M-e | ||
9608 | Move to the end of current function or handler definition. | ||
9609 | @end table | ||
9610 | |||
9611 | Here, @dfn{current function or handler} means the one within which | ||
9612 | your cursor currently stays. | ||
9613 | |||
9614 | You can use @kbd{C-M-e} repeatedly to walk through all function | ||
9615 | and handler definitions in your script files. Similarly, repeatedly | ||
9616 | pressing @kbd{C-M-a} will visit all the definitions in the opposite | ||
9617 | direction (from the last up to the very first one). | ||
9618 | |||
9619 | @cindex Verifying script syntax | ||
9620 | Another special command, @kbd{C-c C-c}, allows to to verify the | ||
9621 | syntax of your script file. This command runs @command{mailfromd} in | ||
9622 | syntax check mode (@pxref{Testing Filter Scripts}) and displays its | ||
9623 | output in a secondary window, which allows to navigate through | ||
9624 | eventual diagnostic messages and to jump to the source locations | ||
9625 | described by them. | ||
9626 | |||
9627 | |||
9628 | |||
9629 | @node Mailfromd Configuration, Sendmail Configuration, Using MFL Mode, Top | ||
9556 | @chapter Configuring @command{mailfromd} | 9630 | @chapter Configuring @command{mailfromd} |
9557 | 9631 | ||
9558 | In the simplest case you will be able to startup | 9632 | In the simplest case you will be able to startup |
diff --git a/elisp/mfl-mode.el b/elisp/mfl-mode.el index 5c66edc6..aadcab08 100644 --- a/elisp/mfl-mode.el +++ b/elisp/mfl-mode.el | |||
@@ -29,6 +29,12 @@ | |||
29 | ;; Install the file mfl-mode.elc (and, optionally, mfl-mode.el) to | 29 | ;; Install the file mfl-mode.elc (and, optionally, mfl-mode.el) to |
30 | ;; any directory in your Emacs load-path. | 30 | ;; any directory in your Emacs load-path. |
31 | 31 | ||
32 | ;; Customization: | ||
33 | ;; To your .emacs or site-start.el add: | ||