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
@@ -9650,25 +9650,46 @@ 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)
+ '(("/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.
+tells Emacs to apply it to any file whose name ends in
+@file{/etc/mailfromd.rc}@footnote{This will match most existing
+installations. In the unlikely case that your @code{$sysconfdir} does
+not end in @file{/etc}, you will have to edit the first line
+accordingly.} or in a @samp{.mf} suffix.
+@cindex indentation, @acronym{MFL}, default
@acronym{MFL} mode provides automatic indentation and syntax
-highlighting for @acronym{MFL} sources.
+highlighting for @acronym{MFL} sources. The default indentation setup
+is the same as the one used throughout this book:
+
+@itemize @bullet
+@item Handler and function definitions start at column 1;
+@item A block statement, i.e. @samp{do}, @samp{done}, @samp{if},
+@samp{else}, @samp{elif} and @samp{fi}, occupies a line by itself,
+with the only exception that @samp{do} after an @samp{on} statement is
+located on the same line with it;
+@item A @samp{do} statement that follows function or handler
+definition is placed in column 1.
+@item Each subsequent level of nesting is indented two columns to the
+right (@pxref{mfl-basic-offset}).
+@item A closing statement (@samp{done}, @samp{else}, @samp{elif},
+@samp{fi}) is placed at the same column as the corresponding opening
+statement;
+@item Branch statements (@samp{case} and @samp{when}) are placed in
+the same column as their controlling keyword (@samp{switch} and
+@samp{on}, correspondingly (@pxref{mfl-case-line-offset}).
+@end itemize
@cindex Finding function definition
@cindex Navigating through function definitions
The mode provides two special commands that help navigate through
the complex filter scripts:
@@ -9686,20 +9707,79 @@ 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
+ Another special command, @kbd{C-c C-c}, allows 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
+eventual diagnostic messages and to jump to source locations
described by them.
-
+@cindex customization, Emacs
+@cindex customization, @acronym{MFL} mode
+ All @acronym{MFL} mode settings are customizable. To change any of
+them, press @kbd{M-x customize} and visit @samp{Environment/Unix/Mfl}
+customization group. This group offers two subgroups: @samp{Mfl Lint
+group} and @samp{Mfl Indentation group}.
+
+@samp{Mfl Lint group} controls invocation of mailfromd by @kbd{C-c
+C-c}. This group contains two variables:
+
+@defvr {MFL-mode setting} mfl-mailfromd-command
+The @command{mailfromd} to be invoked. By default, it is
+@samp{mailfromd}. You will have to change it, if @command{mailfromd}
+cannot be found using @env{PATH} environment variable, or if you wish
+to pass it some special options. However, do not include
+@option{--lint} or @option{-I} options in this variable. The
+@option{--lint} option is given automatically, and include paths are
+controlled by @code{mfl-include-path} variable (see below).
+@end defvr
+
+@defvr {MFL-mode setting} mfl-include-path
+A list of directories to be appended to @command{mailfromd} include
+search path (@pxref{include search path}). By default it is empty.
+@end defvr
+
+@samp{Mfl Indentation group} controls automatic indentation of
+@acronym{MFL} scripts. This group contains the following settings:
+
+@anchor{mfl-basic-offset}
+@defvr {MFL-mode setting} mfl-basic-offset
+This variable sets the basic indentation increment. It is set to 2,
+by default, which corresponds to the following indentation style:
+
+@smallexample
+prog envfrom
+do
+ if $f = ""
+ accept
+ else
+ @dots{}
+ fi
+done
+@end smallexample
+@end defvr
+
+@anchor{mfl-case-line-offset}
+@defvr {MFL-mode setting} mfl-case-line-offset
+Indentation offset for @code{case} and @code{when} lines, relative to
+the column of their controlling keyword. The default is 0, i.e.:
+
+@smallexample
+switch %x
+do
+case 0:
+ @dots{}
+default:
+ @dots{}
+done
+@end smallexample
+@end defvr
@node Mailfromd Configuration, Sendmail Configuration, Using MFL Mode, Top
@chapter Configuring @command{mailfromd}
In the simplest case you will be able to startup
@command{mailfromd} without any additional command line options: the
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
@@ -231,13 +231,13 @@ keywords: else, elif, fi, done, when, case.
"
(interactive "*")
(if (save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(looking-at (regexp-opt
- '("else" "elif" "fi" "done" "when" "case")
+ '("else" "elif" "fi" "done" "when" "case" "default")
'words)))
(mfl-indent-line))
(newline-and-indent))
(defun mfl-check-syntax ()

Return to:

Send suggestions and report system problems to the System administrator.