[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scanning parenthesis in string/comment
From: |
Ruijie Yu |
Subject: |
Re: Scanning parenthesis in string/comment |
Date: |
Mon, 23 Jan 2023 09:49:08 +0800 |
User-agent: |
mu4e 1.8.13; emacs 29.0.60 |
Yuan Fu <casouri@gmail.com> writes:
> I’m writing an expand-region-like function, which expands region by logical
> entities, like word-at-point, list-at-point, etc. Say I have this string
>
> "Filter out invalid regions in REGIONS regarding ORIG.
> ORIG is the current position. Each region is (BEG . END).”
>
> And point is at the opening parenthesis, how do I detect this balanced
> parenthesis pair and expand the region over it? syntax-pass and forward-list
> only works with lists outside of strings and comments, IIUC.
>
> Yuan
Based on what I remember reading from the relevant info pages and
docstrings, is it possible that you start a new syntax scan that starts
*at point* and ends *before the ending quotes*? IIUC the function
`parse-partial-sexp' might be what you should look into next.
Best,
RY