[Top][All Lists]

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

bug#33414: 27.0.50; inhibit-changing-match-data can be t in syntax-prope

From: Pip Cet
Subject: bug#33414: 27.0.50; inhibit-changing-match-data can be t in syntax-propertize functions, breaking backtrace and looking-at
Date: Sat, 17 Nov 2018 13:30:04 +0000

I'm debugging an issue in a custom mode that happened because my
syntax-propertize function, which is complex, assumed it could use the
match data and looking-at. However, the function itself was called
from within looking-at-p, via a regexp generated by (regexp-opt "..."
'symbols), so inhibit-changing-match-data was still bound to t,
yielding unexpected results.

This was a bit tricky to debug because (backtrace) doesn't work when
inhibit-changing-match-data is t.  (In emacs -Q, enter

(let ((inhibit-changing-match-data t)) (backtrace))

into the *scratch* buffer and evaluate with C-M-x.)

At the very least, we should document these unfortunate limitations,
though I think it would be better to remove them.

reply via email to

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