emacs-devel
[Top][All Lists]
Advanced

[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: Alan Mackenzie
Subject: Re: Major modes using `widen' is a good, even essential, programming practice.
Date: Sun, 7 Aug 2022 20:46:17 +0000

Hello, Gregory.

On Sun, Aug 07, 2022 at 20:17:26 +0000, Gregory Heytings wrote:

> >> It is wrong that "arbitrary Lisp can be executed through 
> >> fontification-functions", as you said earlier.

> > It is not wrong. [...]

> >> 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.

> > That doesn't deserve a reply, so won't be getting one.


> Yet the above are all perfectly legitimate examples of "arbitrary Lisp". 
> So I take it that in fact you agree that it is wrong that "arbitrary Lisp 
> can be executed through fontification-functions".

You can take no such thing.

> Neither the deliberately extreme examples above, nor anything else
> that is outside of the scope of the API contract.

I challenged you to state what you think this API contract consists of.
You seem unable to meet this challenge.  So I take it that in fact you
agree there is no such thing as this "API contract".

> Code executed through fontification-functions should do what it was
> designed to do, and only that, otherwise it breaks the API contract.

Yet you are unable to state precisely what this "designed to do" is.
This "API contract" is a mythological creature.  We've already
established, in conversation with Eli, that widening is routinely done
by functions on fontification-functions, and arbitrary buffer positions
are accessed.

If you look closely at CC Mode's use of font locking you'll see that it
font locks, and nothing else.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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