[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New hook before-region-change-functions wanted
From: |
John Wiegley |
Subject: |
Re: New hook before-region-change-functions wanted |
Date: |
Fri, 08 Sep 2017 16:07:37 +0100 |
User-agent: |
Gnus/5.130016 (Ma Gnus v0.16) Emacs/25.2.50 (darwin) |
>>>>> "AM" == Alan Mackenzie <address@hidden> writes:
AM> I would like to implement a new abnormal hook,
AM> before-change-region-functions. It would be called just before a change in
AM> the buffer's restriction (i.e., from widen and from narrow-to-region) and
AM> each function on it would take two parameters, the beginning and end of
AM> the new region being set.
I'd call it before-change-restriction-functions, if we wanted the hook. It
could have interesting uses beyond syntax-ppss too. I'm not sure, though.
AM> The reason I want it is as part of the solution to bug #22983 (syntax-ppss
AM> returns wrong result). I envisage two (or possibly more) mutually
AM> independent caches, and a switch being made to the appropriate cache when
AM> the region is changed. This switch would be made inside a function on
AM> before-change-region-functions.
I was talking to Stefan about syntax-ppss yesterday (in person!). He
acknowledged the bug in syntax-ppss, and said he would like to find a better
way to set the right stage for the fix, involving a more rational scheme for
narrowing (if I understood correctly). Perhaps I can encourage him to chime in
with what he was thinking, because I'd like to hear that before committing to
a new hook that solves one aspect of problem.
It'll likely be a few days before he's done traveling home and gets through
his backlog before we hear from him.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
Re: New hook before-region-change-functions wanted, Stefan Monnier, 2017/09/09