[Top][All Lists]

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

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

From: Noam Postavsky
Subject: bug#32504: [PATCH] syntax-is-{comment|string}-p
Date: Fri, 24 Aug 2018 22:26:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Alex Branham <address@hidden> 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)

reply via email to

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