emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f3b1b5f: Document syntax-ppss-context


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master f3b1b5f: Document syntax-ppss-context
Date: Sun, 23 Jun 2019 18:05:32 -0400 (EDT)

branch: master
commit f3b1b5fb5034de026adc41cf2403cff42f4a0b67
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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).
---
 doc/lispref/syntax.texi   | 5 +++++
 lisp/emacs-lisp/syntax.el | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index b0c04ef..63d534d 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 60ed531..6464e2a 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]