<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -57,7 +57,7 @@
   (list
    '(&quot;^ *Feature:&quot; (0 font-lock-keyword-face) (&quot;.*&quot; nil nil (0 font-lock-type-face t)))
    '(&quot;^ *Background:$&quot; (0 font-lock-keyword-face))
-   '(&quot;^ *Scenario\\(?: Outline\\)?:&quot; (0 font-lock-keyword-face) (&quot;.*&quot; nil nil (0 font-lock-function-name-face t)))
+   '(&quot;^ *Scenarios?\\(?: Outline\\)?:&quot; (0 font-lock-keyword-face) (&quot;.*&quot; nil nil (0 font-lock-function-name-face t)))
    '(&quot;^ *Given&quot; . font-lock-keyword-face)
    '(&quot;^ *When&quot; . font-lock-keyword-face)
    '(&quot;^ *Then&quot; . font-lock-keyword-face)
@@ -99,6 +99,17 @@
 (unless feature-mode-syntax-table
   (setq feature-mode-syntax-table (make-syntax-table)))
 
+;; Constants
+
+(defconst feature-blank-line-re &quot;^[ \t]*$&quot;
+  &quot;Regexp matching a line containing only whitespace.&quot;)
+
+(defconst feature-feature-re &quot;^ *Feature:&quot;
+  &quot;Regexp matching the feature statement.&quot;)
+
+(defconst feature-scenario-re &quot;^ *Scenarios?\\(?: Outline\\)?:&quot;
+  &quot;Regexp matching the scenario statement.&quot;)
+
 ;;
 ;; Variables
 ;;
@@ -110,6 +121,43 @@
   &quot;Indentation of feature statements&quot;
   :type 'integer :group 'feature)
 
+(defcustom feature-indent-offset 2
+  &quot;*Amount of offset per level of indentation.&quot;
+  :type 'integer :group 'feature)
+
+(defun feature-compute-indentation ()
+  &quot;Calculate the maximum sensible indentation for the current line.&quot;
+  (save-excursion
+    (beginning-of-line)
+    (if (bobp) 10
+      (forward-line -1)
+      (while (and (looking-at feature-blank-line-re)
+                  (&gt; (point) (point-min)))
+        (forward-line -1))
+      (+ (current-indentation)
+         (if (or (looking-at feature-feature-re)
+                 (looking-at feature-scenario-re))
+             feature-indent-offset 0)))))
+
+(defun feature-indent-line ()
+    &quot;Indent the current line.
+The first time this command is used, the line will be indented to the
+maximum sensible indentation.  Each immediately subsequent usage will
+back-dent the line by `feature-indent-offset' spaces.  On reaching column
+0, it will cycle back to the maximum sensible indentation.&quot;
+  (interactive &quot;*&quot;)
+  (let ((ci (current-indentation))
+        (cc (current-column))
+        (need (feature-compute-indentation)))
+    (save-excursion
+      (beginning-of-line)
+      (delete-horizontal-space)
+      (if (and (equal last-command this-command) (/= ci 0))
+          (indent-to (* (/ (- ci 1) feature-indent-offset) feature-indent-offset))
+        (indent-to need)))
+      (if (&lt; (current-column) (current-indentation))
+          (forward-to-indentation 0))))
+
 (defun feature-mode-variables ()
   (set-syntax-table feature-mode-syntax-table)
   (setq require-final-newline t)
@@ -117,6 +165,8 @@
   (setq comment-start-skip &quot;#+ *&quot;)
   (setq comment-end &quot;&quot;)
   (setq parse-sexp-ignore-comments t)
+  (set (make-local-variable 'indent-tabs-mode) 'nil)
+  (set (make-local-variable 'indent-line-function) 'feature-indent-line)
   (set (make-local-variable 'font-lock-defaults) '((feature-font-lock-keywords) nil nil))
   (set (make-local-variable 'font-lock-keywords) feature-font-lock-keywords))
 </diff>
      <filename>feature-mode.el</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4bc015db7b61771dcff4ed4068d41cb8aa835c97</id>
    </parent>
  </parents>
  <author>
    <name>Dingding Ye</name>
    <email>yedingding@gmail.com</email>
  </author>
  <url>http://github.com/michaelklishin/cucumber.el/commit/3d38abe58e13c0186e34137acdf96c30eeb54908</url>
  <id>3d38abe58e13c0186e34137acdf96c30eeb54908</id>
  <committed-date>2009-10-27T08:06:29-07:00</committed-date>
  <authored-date>2009-10-27T08:06:29-07:00</authored-date>
  <message>add the indent-line-function policy for feature-mode</message>
  <tree>2921ae0c90c6962dec767dd864852efdd87070dc</tree>
  <committer>
    <name>Dingding Ye</name>
    <email>yedingding@gmail.com</email>
  </committer>
</commit>
