bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#56682: feature/improved-locked-narrowing 9dee6df39c: Reworked locked


From: Gregory Heytings
Subject: bug#56682: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing.
Date: Thu, 09 Feb 2023 20:47:11 +0000


Indeed, but returning the label would defeat the purpose of the tool. If a program can by itself determine that it is in a labeled narrowing and get its label, it can escape that narrowing without much ado.

We make a point of documenting these labeled narrowings in great detail, including the labels and their effects. It makes no sense to describe them and not let programs adapt their behaviors to these situations. Without access to the label, the without-narrowing macro is not useful, so why provide such a macro at all if we really don't want Lisp programs to use it?


Why do you think it's not useful? It is meant to be used for example in a function that is called in fontification-functions to temporarily escape the narrowing set around fontification-functions, when its author has determined that it is safe to do that, like this:

(without-narrowing
  :label long-line-optimizations-in-fontification-functions
  ... some code ...)

IMO, if it becomes possible to escape the narrowing programmatically (IOW, without even checking where and why the narrowing has been set), the exercise becomes even more pointless. (Also, in that case it seems to me that there is no reason anymore to label these narrowings: their label serves no real purpose.)

(Note that I'm writing the above to "defend" a feature that I still believe should better be removed from Emacs.)

I'm not sure what to do with this remark. I'm not accusing you of anything, so you don't need to justify or defend yourself. We are discussing what should this feature include assuming that it will be in Emacs.


Don't worry, I don't feel accused at all. I was only expressing that I'm reasoning against my intuition here.






reply via email to

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