[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New hook before-region-change-functions wanted
From: |
Alan Mackenzie |
Subject: |
Re: New hook before-region-change-functions wanted |
Date: |
Sat, 9 Sep 2017 08:33:26 +0000 |
User-agent: |
Mutt/1.7.2 (2016-11-26) |
Hello, Richard.
On Fri, Sep 08, 2017 at 18:22:15 -0400, Richard Stallman wrote:
> [[[ To any NSA and FBI agents reading my email: please consider ]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> > I would like to implement a new abnormal hook,
> > before-change-region-functions. It would be called just before a change
> > in the buffer's restriction (i.e., from widen and from narrow-to-region)
> > and each function on it would take two parameters, the beginning and end
> > of the new region being set.
> That kind of hook is pandora's box. It is too powerful, and would
> interact in complex ways. There will be many cases that are hard to
> implement correctly, or cause trouble. To implement this probably
> means future hassles for ourselves and for package developers.
I actually implemented it, and it worked as intended. It's not often I
get criticised for proposing something too powerful.
> > The reason I want it is as part of the solution to bug #22983
> > (syntax-ppss returns wrong result). I envisage two (or possibly more)
> > mutually independent caches, and a switch being made to the appropriate
> > cache when the region is changed.
> For this, all you need to do is record, for each alternative cache,
> what buffer restrictions it corresponds to. Then use the right cache.
> That is a much safer way to do it.
OK. I will keep my new implementation under lock and key. As you
suggest, managing without it is not difficult.
Thanks for the criticism.
> --
> Dr Richard Stallman
> President, Free Software Foundation (gnu.org, fsf.org)
> Internet Hall-of-Famer (internethalloffame.org)
> Skype: No way! See stallman.org/skype.html.
--
Alan Mackenzie (Nuremberg, Germany).
- New hook before-region-change-functions wanted, Alan Mackenzie, 2017/09/08
- Re: New hook before-region-change-functions wanted, Eli Zaretskii, 2017/09/08
- Re: New hook before-region-change-functions wanted, Dmitry Gutov, 2017/09/08
- Re: New hook before-region-change-functions wanted, John Wiegley, 2017/09/08
- Re: New hook before-region-change-functions wanted, Richard Stallman, 2017/09/08
- Re: New hook before-region-change-functions wanted,
Alan Mackenzie <=
- Re: New hook before-region-change-functions wanted, Andreas Röhler, 2017/09/12
Re: New hook before-region-change-functions wanted, Stefan Monnier, 2017/09/09