diff options
| -rw-r--r-- | doc/lispref/syntax.texi | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/syntax.el | 4 |
2 files changed, 9 insertions, 0 deletions
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 | |||
| 882 | arrived at a top level position. | 882 | arrived at a top level position. |
| 883 | @end defun | 883 | @end defun |
| 884 | 884 | ||
| 885 | @defun syntax-ppss-context state | ||
| 886 | Return @code{string} if @var{state} is a string and @code{comment} if | ||
| 887 | it's a comment. | ||
| 888 | @end defun | ||
| 889 | |||
| 885 | @node Low-Level Parsing | 890 | @node Low-Level Parsing |
| 886 | @subsection Low-Level Parsing | 891 | @subsection Low-Level Parsing |
| 887 | 892 | ||
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." | |||
| 371 | (nth 8 ppss))) | 371 | (nth 8 ppss))) |
| 372 | 372 | ||
| 373 | (defsubst syntax-ppss-context (ppss) | 373 | (defsubst syntax-ppss-context (ppss) |
| 374 | "Say whether PPSS is a string, a comment, or something else. | ||
| 375 | If PPSS is a string, the symbol `string' is returned. If it's a | ||
| 376 | comment, the symbol `comment' is returned. If it's something | ||
| 377 | else, nil is returned." | ||
| 374 | (cond | 378 | (cond |
| 375 | ((nth 3 ppss) 'string) | 379 | ((nth 3 ppss) 'string) |
| 376 | ((nth 4 ppss) 'comment) | 380 | ((nth 4 ppss) 'comment) |