diff options
| author | Simon Marshall | 1999-02-17 09:46:28 +0000 |
|---|---|---|
| committer | Simon Marshall | 1999-02-17 09:46:28 +0000 |
| commit | abb7e5cfc32f1895ebe99ca5ee1b157cf74312d0 (patch) | |
| tree | 2445089140e537618bc3198d2763a01910126ed0 | |
| parent | c22554ac395d5ec99b44575d8e3f3a109df6f921 (diff) | |
| download | emacs-abb7e5cfc32f1895ebe99ca5ee1b157cf74312d0.tar.gz emacs-abb7e5cfc32f1895ebe99ca5ee1b157cf74312d0.zip | |
Added c-at-toplevel-p for font-lock.el.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 8df67dd33ba..1111e071800 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -766,6 +766,23 @@ | |||
| 766 | (point)) | 766 | (point)) |
| 767 | )) | 767 | )) |
| 768 | 768 | ||
| 769 | (defun c-at-toplevel-p () | ||
| 770 | "Return a determination as to whether point is at the `top-level'. | ||
| 771 | Being at the top-level means that point is either outside any | ||
| 772 | enclosing block (such function definition), or inside a class | ||
| 773 | definition, but outside any method blocks. | ||
| 774 | |||
| 775 | If point is not at the top-level (e.g. it is inside a method | ||
| 776 | definition), then nil is returned. Otherwise, if point is at a | ||
| 777 | top-level not enclosed within a class definition, t is returned. | ||
| 778 | Otherwise, a 2-vector is returned where the zeroth element is the | ||
| 779 | buffer position of the start of the class declaration, and the first | ||
| 780 | element is the buffer position of the enclosing class's opening | ||
| 781 | brace." | ||
| 782 | (let ((state (c-parse-state))) | ||
| 783 | (or (not (c-most-enclosing-brace state)) | ||
| 784 | (c-search-uplist-for-classkey state)))) | ||
| 785 | |||
| 769 | (defun c-just-after-func-arglist-p (&optional containing) | 786 | (defun c-just-after-func-arglist-p (&optional containing) |
| 770 | ;; Return t if we are between a function's argument list closing | 787 | ;; Return t if we are between a function's argument list closing |
| 771 | ;; paren and its opening brace. Note that the list close brace | 788 | ;; paren and its opening brace. Note that the list close brace |