]> code.delx.au - gnu-emacs/commitdiff
(octave-looking-at-kw): Add doc string.
authorGlenn Morris <rgm@gnu.org>
Sat, 13 Oct 2007 20:09:14 +0000 (20:09 +0000)
committerGlenn Morris <rgm@gnu.org>
Sat, 13 Oct 2007 20:09:14 +0000 (20:09 +0000)
(octave-re-search-forward-kw, octave-re-search-backward-kw):
Add doc string, and an explicit COUNT argument.
(octave-scan-blocks, octave-beginning-of-defun): Explicitly pass
INC to search functions.

lisp/progmodes/octave-mod.el

index fe44fcaf4fe18722d8102507b282a48eb36cee65..b7084950a09a1c7d4a7726820ed6520617bd2e52 100644 (file)
@@ -582,16 +582,19 @@ to end after the end keyword."
       (< pos (point)))))
 
 (defun octave-looking-at-kw (regexp)
+  "Like `looking-at', but sets `case-fold-search' nil."
   (let ((case-fold-search nil))
     (looking-at regexp)))
 
-(defun octave-re-search-forward-kw (regexp)
+(defun octave-re-search-forward-kw (regexp count)
+  "Like `re-search-forward', but sets `case-fold-search' nil, and moves point."
   (let ((case-fold-search nil))
-    (re-search-forward regexp nil 'move inc)))
+    (re-search-forward regexp nil 'move count)))
 
-(defun octave-re-search-backward-kw (regexp)
+(defun octave-re-search-backward-kw (regexp count)
+  "Like `re-search-backward', but sets `case-fold-search' nil, and moves point."
   (let ((case-fold-search nil))
-    (re-search-backward regexp nil 'move inc)))
+    (re-search-backward regexp nil 'move count)))
 
 (defun octave-in-defun-p ()
   "Return t if point is inside an Octave function declaration.
@@ -867,7 +870,7 @@ an error is signaled."
       (while (/= count 0)
        (catch 'foo
          (while (or (octave-re-search-forward-kw
-                     octave-block-begin-or-end-regexp)
+                     octave-block-begin-or-end-regexp inc)
                     (if (/= depth 0)
                         (error "Unbalanced block")))
            (if (octave-not-in-string-or-comment-p)
@@ -1037,7 +1040,7 @@ Returns t unless search stops at the beginning or end of the buffer."
         (skip-syntax-forward "w"))
     (while (and (/= arg 0)
                (setq found
-                     (octave-re-search-backward-kw "\\<function\\>")))
+                     (octave-re-search-backward-kw "\\<function\\>" inc)))
       (if (octave-not-in-string-or-comment-p)
          (setq arg (- arg inc))))
     (if found