Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p

From: Noam Postavsky <[email-masked]>
Date: Fri, 24 Aug 2018 22:26:51 -0400

Alex Branham <[email-masked]> writes:

>>> Thanks, I didn't know about syntax-ppss-context. It doesn't seem to be
>>> documented anywhere.
>>
>> If it's useful, we could document it.
>
> I'm ambivalent about its usefulness - I don't see it used anywhere in
> Emacs's code and only once in the packages I have installed.

For a bit of prior art, there are some similar functions in python.el:
python-syntax-context, python-syntax-context-type,
python-syntax-comment-or-string-p, python-syntax-closing-paren-p.

Also, syntax.el has a couple of commented out "XEmacs compatibility
functions": buffer-syntactic-context, buffer-syntactic-context-depth.

I think it would make sense to provide symbolic names for all the
elements returned by syntax-ppss, maybe like this:

    (cl-defstruct (syntax-state (:constructor nil)
                                (:type list))
      depth list-start sexp-end
      string-start comment quoted
      min-depth comment-style comment-or-string-start
      open-parens syntax-sequence)