summaryrefslogtreecommitdiffabout
path: root/elisp
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-29 05:31:54 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2007-05-29 05:31:54 (GMT)
commit1ef49c888848d916be120761d253f120647f3923 (patch) (side-by-side diff)
treefc6976ac46bd73b2e0650b38ec8b49c19ac69a2c /elisp
parentcdff5d1bd2a10328962aff49d8d6fc7d309fe2c3 (diff)
downloadmailfromd-1ef49c888848d916be120761d253f120647f3923.tar.gz
mailfromd-1ef49c888848d916be120761d253f120647f3923.tar.bz2
Bugfixes
git-svn-id: file:///svnroot/mailfromd/trunk@1481 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'elisp') (more/less context) (ignore whitespace changes)
-rw-r--r--elisp/mfl-mode.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/elisp/mfl-mode.el b/elisp/mfl-mode.el
index aadcab0..eb0bceb 100644
--- a/elisp/mfl-mode.el
+++ b/elisp/mfl-mode.el
@@ -151,7 +151,7 @@
(mfl-next-line-indentation)))))
(defun mfl-find-line-indentation (regexp)
- "Move backwards to the line containing "REGEXP", skipping over
+ "Move backwards to the line containing REGEXP, skipping over
block constructs. Return the indentation of the line, or 0
if no matching line was found."
(catch 'found
@@ -169,7 +169,7 @@ if no matching line was found."
0))
(defun mfl-find-line-forward (regexp)
- "Move forward to the line containing "REGEXP", skipping over
+ "Move forward to the line containing REGEXP, skipping over
block constructs. Return t if the line was found, nil otherwise."
(catch 'found
(while (not (eobp))
@@ -224,9 +224,19 @@ block constructs. Return t if the line was found, nil otherwise."
(beginning-of-line))))))
(defun mfl-newline-and-indent ()
- "Indent the current line, insert a newline, and then indent again."
+ "Indent the current line, if necessary, insert a newline, and then indent again.
+
+The current line is indented if it begins with one of the following
+keywords: else, elif, fi, done, when, case.
+"
(interactive "*")
- (mfl-indent-line)
+ (if (save-excursion
+ (beginning-of-line)
+ (skip-chars-forward " \t")
+ (looking-at (regexp-opt
+ '("else" "elif" "fi" "done" "when" "case")
+ 'words)))
+ (mfl-indent-line))
(newline-and-indent))

Return to:

Send suggestions and report system problems to the System administrator.