From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: parse-partial-sexp parses only Lisp?
Date: Wed, 02 Apr 2008 19:58:18 +0200 [thread overview]
Message-ID: <47F3C93A.2090009@gmail.com> (raw)
In-Reply-To: <47F3BB7C.1010608@gmx.at>
martin rudalics wrote:
> > - What variables are used when searching for comments?
>
> I don't understand: `parse-partial-sexp' uses the syntax-table to
> identify start and end sequences of comments and strings. Sometimes
> syntax-table text-properties are used. What kind of "variables" do you
> have in mind?
syntax-table? Is that the syntax table returned by (syntax-table) and
set by (set-syntax-table TABLE)? The doc string does not mention this.
I thought that perhaps the comment delimiters where involved. The syntax
tables as above seems to be able to take care of C style comments (max 2
chars in delimeters), but it can not handle html comments AFAICS.
I guess then parse-partial-sexp can not return info about html comments,
right? Can syntax-pps do that? (The doc string for syntax-ppss says the
return values are the same as for parse-partial-sexp.)
> > - What do I have to put in OLDSTATE to make it parse comments and
> > strings correctly? - assuming that I know about previous comments and
> > strings and if FROM is inside a comment or string.
>
> You know about previous comments and strings iff you are neither in a
> comment nor in a string. Strings and comments can be nested in so many
> forms that it's strongly encouraged to either use the state returned by
> a previous call of `parse-partial-sexp' or assure that you start outside
> of any comments or strings. `syntax-begin-function' if provided is a
> good choice here.
Thanks.
next prev parent reply other threads:[~2008-04-02 17:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-01 22:23 parse-partial-sexp parses only Lisp? Lennart Borgman (gmail)
2008-04-02 8:46 ` martin rudalics
2008-04-02 14:59 ` Lennart Borgman (gmail)
2008-04-02 16:59 ` martin rudalics
2008-04-02 17:58 ` Lennart Borgman (gmail) [this message]
2008-04-05 20:42 ` David Hansen
2008-04-02 17:38 ` Stefan Monnier
2008-04-02 17:59 ` Lennart Borgman (gmail)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47F3C93A.2090009@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.