[Top][All Lists]

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

Re: Major modes using `widen' is a good, even essential, programming pra

From: Gregory Heytings
Subject: Re: Major modes using `widen' is a good, even essential, programming practice.
Date: Sun, 07 Aug 2022 13:31:05 +0000

Major modes, like all Emacs Lisp programs, have, by design, access to the full range of Emacs's facilities. Should it make your task more difficult (and I don't see that it does), that's your problem, not the major modes' maintainers'.

I fear it is not my problem, no.

jit-lock-functions is an API, with a contract. CC Mode decided to break that contract. It is wrong that "arbitrary Lisp can be executed through fontification-functions", as you said earlier. A function called from fontification-functions isn't supposed to download a file, or to send an email, or to change a user option, or to remove or create a file, or to remove or insert text in the buffer, or to kill Emacs or a frame or a window or the current buffer, or to change the window layout, and so on and so forth.

So far breaching that contract has not posed major problems, except of course for CC Mode users, who had to bear its sluggishness. We now have a new feature which assumes, and rightly so, that this contract is obeyed. This breaks CC Mode.

From where I stand, there are two options here: either CC Mode disables
the new feature (which is, on purpose, 100% backward compatible), or CC Mode is fixed to obey the jit-lock-functions contract, and to become compatible with the new feature (which will likely also, by side-effect and as a bonus, fix the aforementioned sluggishness).

reply via email to

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