Subject: Re: bug#68477: 29.1; bibtex-braced-string-syntax-table should handle non-ASCII parentheses

From: Roland Winkler <[email-masked]>
Date: Thu, 02 Jan 2025 13:09:41 -0600

On Mon, Jan 15 2024, Joost Kremers wrote:
> Consider the following BibTeX entry:
>
> ```
> @article{Title,
>   title = {{Title}},
>   author = {Author},
>   year = 1970,
>   abstract = {（},
>   journal = {Journal},
> }
> ```
>
> Note that the `abstract` field has a single opening FULLWIDTH OPENING
> PARENTHESIS (code point #xff08), not the (ASCII) LEFT
> PARENTHESIS. bibtex-mode cannot parse this entry correctly. (Do, e.g.,
> `C-c C-c` on the entry, bound to `bibtex-clean-entry` and you'll get a
> user error "Syntactically incorrect BibTeX entry starts here".)
>
> If the field contains an unmatched LEFT PARENTHESIS (code point #x28),
> bibtex-mode has no trouble parsing the entry.
>
> This is ultimately due to the fact that
> `bibtex-braced-string-syntax-table` contains an entry for the ASCII
> parentheses, setting them to 'punctuation', but there is no similar
> entry for non-ASCII parentheses.

I only discovered this bug report now.  I believe utf-8 defines lots of
pairs of parentheses to which this bug report applies.  Is there a
generic way to modify the syntax of "all" pairs of parentheses (except
the curly brackets "{" and "}") to punctuation so that parsing will
ignore such unpaired parentheses?

(Though, I do not know how common a problem are such unpaired non-ascii
parentheses in BibTeX files.)