From: Lars Ingebrigtsen Date: Sun, 23 Jun 2019 22:04:04 +0000 (+0200) Subject: Document syntax-ppss-context X-Git-Tag: emacs-27.0.90~2290 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f3b1b5fb5034de026adc41cf2403cff42f4a0b67;p=emacs.git Document syntax-ppss-context * doc/lispref/syntax.texi (Parser State): Document it. * lisp/emacs-lisp/syntax.el (syntax-ppss-context): Add a doc string (bug#32504). --- diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index b0c04ef9c25..63d534dd134 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -882,6 +882,11 @@ The value is @code{nil} if @var{state} represents a parse which has arrived at a top level position. @end defun +@defun syntax-ppss-context state +Return @code{string} if @var{state} is a string and @code{comment} if +it's a comment. +@end defun + @node Low-Level Parsing @subsection Low-Level Parsing diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 60ed531e63d..6464e2a52db 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -371,6 +371,10 @@ itself at the outermost level), return nil." (nth 8 ppss))) (defsubst syntax-ppss-context (ppss) + "Say whether PPSS is a string, a comment, or something else. +If PPSS is a string, the symbol `string' is returned. If it's a +comment, the symbol `comment' is returned. If it's something +else, nil is returned." (cond ((nth 3 ppss) 'string) ((nth 4 ppss) 'comment)