auctex-devel
[Top][All Lists]
Advanced

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

Re: master 04b9a6d1: Improve shortvrb.sty support


From: Arash Esbati
Subject: Re: master 04b9a6d1: Improve shortvrb.sty support
Date: Sat, 29 Apr 2023 13:01:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Keita,

Ikumi Keita <ikumi@ikumi.que.jp> writes:

> Yes. A major obstacle is that `syntax-propertize-rules' doesn't accept
> an entry of the form
> (REGEXP-OR-FUNC (1 "\"") (2 ".") (3 "\""))


Really?  I think the docstring says that it should work the way you
describe above:

,----[ C-h f syntax-propertize-rules RET ]
| syntax-propertize-rules is a Lisp macro in ‘syntax.el’.
| 
| (syntax-propertize-rules &rest RULES)
| [...]
| Otherwise, RULE should have the form (REGEXP HIGHLIGHT1 ... HIGHLIGHTn), where
| REGEXP is an expression (evaluated at time of macro-expansion) that returns
| a regexp, and where HIGHLIGHTs have the form (NUMBER SYNTAX) which means to
| apply the property SYNTAX to the chars matched by the subgroup NUMBER
| of the regular expression, if NUMBER did match.
| SYNTAX is an expression that returns a value to apply as ‘syntax-table’
| property.  Some expressions are handled specially:
| - if SYNTAX is a string, then it is converted with ‘string-to-syntax’;
| - if SYNTAX has the form (prog1 EXP . EXPS) then the value returned by EXP
|   will be applied to the buffer before running EXPS and if EXP is a string it
|   is also converted with ‘string-to-syntax’.
| The SYNTAX expression is responsible to save the ‘match-data’ if needed
| for subsequent HIGHLIGHTs.
| Also SYNTAX is free to move point, in which case RULES may not be applied to
| some parts of the text or may be applied several times to other parts.
| 
| Note: There may be at most nine back-references in the REGEXPs of
| all RULES in total.
| 
|   Probably introduced at or before Emacs version 24.1.
| 
`----

Am I missing something?

> I think that we can rewrite all entries in AUCTeX source and introduce
> `syntax-propertize-rules', but if there are 3rd party codes using this
> form, they will fail :-(

Are you thinking about any specific application?  We can do it and wait
for complains.  I mean, we also moved tex-buf.el into tex.el and the
number of complains was low.

> Thanks, now it runs cleanly on my side, too.

Thanks, I will install that change.

Best, Arash



reply via email to

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