diff options
| author | Glenn Morris | 2007-10-13 20:09:14 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-10-13 20:09:14 +0000 |
| commit | 050a4b353f423f763e8e625c49df926f14c6f0e3 (patch) | |
| tree | b3b96b1d57399757d6fd936cd36dfa14376bdf79 | |
| parent | d1b38156691ecd2825166147c8349d4752941612 (diff) | |
| download | emacs-050a4b353f423f763e8e625c49df926f14c6f0e3.tar.gz emacs-050a4b353f423f763e8e625c49df926f14c6f0e3.zip | |
(octave-looking-at-kw): Add doc string.
(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.
| -rw-r--r-- | lisp/progmodes/octave-mod.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index fe44fcaf4fe..b7084950a09 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el | |||
| @@ -582,16 +582,19 @@ to end after the end keyword." | |||
| 582 | (< pos (point))))) | 582 | (< pos (point))))) |
| 583 | 583 | ||
| 584 | (defun octave-looking-at-kw (regexp) | 584 | (defun octave-looking-at-kw (regexp) |
| 585 | "Like `looking-at', but sets `case-fold-search' nil." | ||
| 585 | (let ((case-fold-search nil)) | 586 | (let ((case-fold-search nil)) |
| 586 | (looking-at regexp))) | 587 | (looking-at regexp))) |
| 587 | 588 | ||
| 588 | (defun octave-re-search-forward-kw (regexp) | 589 | (defun octave-re-search-forward-kw (regexp count) |
| 590 | "Like `re-search-forward', but sets `case-fold-search' nil, and moves point." | ||
| 589 | (let ((case-fold-search nil)) | 591 | (let ((case-fold-search nil)) |
| 590 | (re-search-forward regexp nil 'move inc))) | 592 | (re-search-forward regexp nil 'move count))) |
| 591 | 593 | ||
| 592 | (defun octave-re-search-backward-kw (regexp) | 594 | (defun octave-re-search-backward-kw (regexp count) |
| 595 | "Like `re-search-backward', but sets `case-fold-search' nil, and moves point." | ||
| 593 | (let ((case-fold-search nil)) | 596 | (let ((case-fold-search nil)) |
| 594 | (re-search-backward regexp nil 'move inc))) | 597 | (re-search-backward regexp nil 'move count))) |
| 595 | 598 | ||
| 596 | (defun octave-in-defun-p () | 599 | (defun octave-in-defun-p () |
| 597 | "Return t if point is inside an Octave function declaration. | 600 | "Return t if point is inside an Octave function declaration. |
| @@ -867,7 +870,7 @@ an error is signaled." | |||
| 867 | (while (/= count 0) | 870 | (while (/= count 0) |
| 868 | (catch 'foo | 871 | (catch 'foo |
| 869 | (while (or (octave-re-search-forward-kw | 872 | (while (or (octave-re-search-forward-kw |
| 870 | octave-block-begin-or-end-regexp) | 873 | octave-block-begin-or-end-regexp inc) |
| 871 | (if (/= depth 0) | 874 | (if (/= depth 0) |
| 872 | (error "Unbalanced block"))) | 875 | (error "Unbalanced block"))) |
| 873 | (if (octave-not-in-string-or-comment-p) | 876 | (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." | |||
| 1037 | (skip-syntax-forward "w")) | 1040 | (skip-syntax-forward "w")) |
| 1038 | (while (and (/= arg 0) | 1041 | (while (and (/= arg 0) |
| 1039 | (setq found | 1042 | (setq found |
| 1040 | (octave-re-search-backward-kw "\\<function\\>"))) | 1043 | (octave-re-search-backward-kw "\\<function\\>" inc))) |
| 1041 | (if (octave-not-in-string-or-comment-p) | 1044 | (if (octave-not-in-string-or-comment-p) |
| 1042 | (setq arg (- arg inc)))) | 1045 | (setq arg (- arg inc)))) |
| 1043 | (if found | 1046 | (if found |