aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-29 12:31:42 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-05-29 12:31:42 +0000
commit181d72e3e2643a32b4a9754a6fac439a61a6a1e0 (patch)
treeb35113b724fcf4f8845b2e39c7aa02401d9322f5
parent1ef49c888848d916be120761d253f120647f3923 (diff)
downloadmailfromd-181d72e3e2643a32b4a9754a6fac439a61a6a1e0.tar.gz
mailfromd-181d72e3e2643a32b4a9754a6fac439a61a6a1e0.tar.bz2
Update
git-svn-id: file:///svnroot/mailfromd/trunk@1482 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--doc/mailfromd.texi98
-rw-r--r--elisp/mfl-mode.el2
2 files changed, 90 insertions, 10 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi
index bc76dbe9..503dcf7f 100644
--- a/doc/mailfromd.texi
+++ b/doc/mailfromd.texi
@@ -9653,19 +9653,40 @@ file (either system-wide @file{site-start.el}, or your personal one,
9653@group 9653@group
9654(autoload 'mfl-mode "mfl-mode") 9654(autoload 'mfl-mode "mfl-mode")
9655(setq auto-mode-alist (append auto-mode-alist 9655(setq auto-mode-alist (append auto-mode-alist
9656 '(("/usr/local/etc/mailfromd.rc" . mfl-mode) 9656 '(("/etc/mailfromd.rc" . mfl-mode)
9657 ("\\.mf$" . mfl-mode)))) 9657 ("\\.mf$" . mfl-mode))))
9658@end group 9658@end group
9659@end smalllisp 9659@end smalllisp
9660 9660
9661 The first line loads the @acronym{MFL} mode, and the second one 9661 The first line loads the @acronym{MFL} mode, and the second one
9662tells Emacs to apply it to the file @file{/usr/local/etc/mailfromd.rc} 9662tells Emacs to apply it to any file whose name ends in
9663(of course, you should replace @file{/usr/local/etc/} with the exact 9663@file{/etc/mailfromd.rc}@footnote{This will match most existing
9664location, where your main filter script file is installed), and to any 9664installations. In the unlikely case that your @code{$sysconfdir} does
9665file whose name ends with a @samp{.mf} suffix. 9665not end in @file{/etc}, you will have to edit the first line
9666accordingly.} or in a @samp{.mf} suffix.
9666 9667
9668@cindex indentation, @acronym{MFL}, default
9667 @acronym{MFL} mode provides automatic indentation and syntax 9669 @acronym{MFL} mode provides automatic indentation and syntax
9668highlighting for @acronym{MFL} sources. 9670highlighting for @acronym{MFL} sources. The default indentation setup
9671is the same as the one used throughout this book:
9672
9673@itemize @bullet
9674@item Handler and function definitions start at column 1;
9675@item A block statement, i.e. @samp{do}, @samp{done}, @samp{if},
9676@samp{else}, @samp{elif} and @samp{fi}, occupies a line by itself,
9677with the only exception that @samp{do} after an @samp{on} statement is
9678located on the same line with it;
9679@item A @samp{do} statement that follows function or handler
9680definition is placed in column 1.
9681@item Each subsequent level of nesting is indented two columns to the
9682right (@pxref{mfl-basic-offset}).
9683@item A closing statement (@samp{done}, @samp{else}, @samp{elif},
9684@samp{fi}) is placed at the same column as the corresponding opening
9685statement;
9686@item Branch statements (@samp{case} and @samp{when}) are placed in
9687the same column as their controlling keyword (@samp{switch} and
9688@samp{on}, correspondingly (@pxref{mfl-case-line-offset}).
9689@end itemize
9669 9690
9670@cindex Finding function definition 9691@cindex Finding function definition
9671@cindex Navigating through function definitions 9692@cindex Navigating through function definitions
@@ -9689,14 +9710,73 @@ pressing @kbd{C-M-a} will visit all the definitions in the opposite
9689direction (from the last up to the very first one). 9710direction (from the last up to the very first one).
9690 9711
9691@cindex Verifying script syntax 9712@cindex Verifying script syntax
9692 Another special command, @kbd{C-c C-c}, allows to to verify the 9713 Another special command, @kbd{C-c C-c}, allows to verify the
9693syntax of your script file. This command runs @command{mailfromd} in 9714syntax of your script file. This command runs @command{mailfromd} in
9694syntax check mode (@pxref{Testing Filter Scripts}) and displays its 9715syntax check mode (@pxref{Testing Filter Scripts}) and displays its
9695output in a secondary window, which allows to navigate through 9716output in a secondary window, which allows to navigate through
9696eventual diagnostic messages and to jump to the source locations 9717eventual diagnostic messages and to jump to source locations
9697described by them. 9718described by them.
9698 9719
9699 9720@cindex customization, Emacs
9721@cindex customization, @acronym{MFL} mode
9722 All @acronym{MFL} mode settings are customizable. To change any of
9723them, press @kbd{M-x customize} and visit @samp{Environment/Unix/Mfl}
9724customization group. This group offers two subgroups: @samp{Mfl Lint
9725group} and @samp{Mfl Indentation group}.
9726
9727@samp{Mfl Lint group} controls invocation of mailfromd by @kbd{C-c
9728C-c}. This group contains two variables:
9729
9730@defvr {MFL-mode setting} mfl-mailfromd-command
9731The @command{mailfromd} to be invoked. By default, it is
9732@samp{mailfromd}. You will have to change it, if @command{mailfromd}
9733cannot be found using @env{PATH} environment variable, or if you wish
9734to pass it some special options. However, do not include
9735@option{--lint} or @option{-I} options in this variable. The
9736@option{--lint} option is given automatically, and include paths are
9737controlled by @code{mfl-include-path} variable (see below).
9738@end defvr
9739
9740@defvr {MFL-mode setting} mfl-include-path
9741A list of directories to be appended to @command{mailfromd} include
9742search path (@pxref{include search path}). By default it is empty.
9743@end defvr
9744
9745@samp{Mfl Indentation group} controls automatic indentation of
9746@acronym{MFL} scripts. This group contains the following settings:
9747
9748@anchor{mfl-basic-offset}
9749@defvr {MFL-mode setting} mfl-basic-offset
9750This variable sets the basic indentation increment. It is set to 2,
9751by default, which corresponds to the following indentation style:
9752
9753@smallexample
9754prog envfrom
9755do
9756 if $f = ""
9757 accept
9758 else
9759 @dots{}
9760 fi
9761done
9762@end smallexample
9763@end defvr
9764
9765@anchor{mfl-case-line-offset}
9766@defvr {MFL-mode setting} mfl-case-line-offset
9767Indentation offset for @code{case} and @code{when} lines, relative to
9768the column of their controlling keyword. The default is 0, i.e.:
9769
9770@smallexample
9771switch %x
9772do
9773case 0:
9774 @dots{}
9775default:
9776 @dots{}
9777done
9778@end smallexample
9779@end defvr
9700 9780
9701@node Mailfromd Configuration, Sendmail Configuration, Using MFL Mode, Top 9781@node Mailfromd Configuration, Sendmail Configuration, Using MFL Mode, Top
9702@chapter Configuring @command{mailfromd} 9782@chapter Configuring @command{mailfromd}
diff --git a/elisp/mfl-mode.el b/elisp/mfl-mode.el
index eb0bceb1..e9488001 100644
--- a/elisp/mfl-mode.el
+++ b/elisp/mfl-mode.el
@@ -234,7 +234,7 @@ keywords: else, elif, fi, done, when, case.
234 (beginning-of-line) 234 (beginning-of-line)
235 (skip-chars-forward " \t") 235 (skip-chars-forward " \t")
236 (looking-at (regexp-opt 236 (looking-at (regexp-opt
237 '("else" "elif" "fi" "done" "when" "case") 237 '("else" "elif" "fi" "done" "when" "case" "default")
238 'words))) 238 'words)))
239 (mfl-indent-line)) 239 (mfl-indent-line))
240 (newline-and-indent)) 240 (newline-and-indent))

Return to:

Send suggestions and report system problems to the System administrator.