]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: factor-previous-non-blank unused and adding doc
authorBjörn Lindqvist <bjourne@gmail.com>
Sun, 19 Jun 2016 01:23:35 +0000 (03:23 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sun, 19 Jun 2016 01:23:35 +0000 (03:23 +0200)
misc/fuel/factor-mode.el

index e3e8932188fbb809d44ffc59ae08d3fa6c9ad586..0fb399a85866a63967314f52902d1b2a16fe3479 100644 (file)
@@ -362,10 +362,6 @@ these lines in your .emacs:
   (format "^\\(%s:\\) " (regexp-opt (append factor-no-indent-def-starts
                                             factor-indent-def-starts))))
 
-(defconst factor-definition-end-regex
-  (format "\\(\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)\\)"
-          factor-declaration-words-regex))
-
 (defconst factor-single-liner-regex
   (regexp-opt '("ABOUT:"
                 "ALIAS:"
@@ -390,6 +386,10 @@ these lines in your .emacs:
           factor-definition-start-regex
           factor-single-liner-regex))
 
+(defconst factor-definition-end-regex
+  (format "\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)"
+          factor-declaration-words-regex))
+
 (defconst factor-end-of-def-line-regex
   (format "^.*%s" factor-definition-end-regex))
 
@@ -591,9 +591,6 @@ these lines in your .emacs:
 (defsubst factor-at-end-of-def ()
   (looking-at factor-end-of-def-regex))
 
-(defsubst factor-looking-at-emptiness ()
-  (looking-at "^[ ]*$\\|$"))
-
 (defsubst factor-is-last-char (pos)
   (save-excursion
     (goto-char (1+ pos))
@@ -605,11 +602,6 @@ these lines in your .emacs:
            (beginning-of-line)
            (point))))
 
-(defun factor-previous-non-blank ()
-  (forward-line -1)
-  (while (and (not (bobp)) (factor-looking-at-emptiness))
-    (forward-line -1)))
-
 (defsubst factor-beginning-of-defun (&optional times)
   (re-search-backward factor-begin-of-def-regex nil t times))
 
@@ -760,9 +752,10 @@ these lines in your .emacs:
     (when (factor-at-begin-of-def) 0)))
 
 (defsubst factor-previous-non-empty ()
+  "Move caret to the beginning of the last non-empty line."
   (forward-line -1)
   (while (and (not (bobp))
-              (factor-looking-at-emptiness))
+              (looking-at "^[ ]*$\\|$"))
     (forward-line -1)))
 
 (defun factor-indent-setter-line ()