diff options
author | Stefan Monnier <[email protected]> | 2006-12-12 02:36:38 +0000 |
---|---|---|
committer | Stefan Monnier <[email protected]> | 2006-12-12 02:36:38 +0000 |
commit | 0e6c966c96290f53f281016c6e40c7404daf759b (patch) | |
tree | fee23a62f8d1e8284fe82719229884218e5f9250 /lisp/emacs-lisp/syntax.el | |
parent | 53d45a176b430c806b821ce93872f2f1ef6cf38f (diff) |
(syntax-ppss-toplevel-pos): New fun.
Diffstat (limited to 'lisp/emacs-lisp/syntax.el')
-rw-r--r-- | lisp/emacs-lisp/syntax.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 695d7877b3..f290db42c0 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -52,6 +52,14 @@ (defsubst syntax-ppss-depth (ppss) (nth 0 ppss)) +(defun syntax-ppss-toplevel-pos (ppss) + "Return the last preceding position at toplevel. +\"At toplevel\" means that it is outside of any syntactic entity: +outside of any parentheses, or comments, or strings. +Returns nil iff PPSS itself corresponds to a toplevel position." + (or (car (nth 9 ppss)) + (nth 8 ppss))) + (defsubst syntax-ppss-context (ppss) (cond ((nth 3 ppss) 'string) |