unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: New hook before-region-change-functions wanted
Date: Sat, 9 Sep 2017 08:33:26 +0000	[thread overview]
Message-ID: <20170909083326.GA5194@ACM> (raw)
In-Reply-To: <E1dqRfD-0005LC-5g@fencepost.gnu.org>

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



  reply	other threads:[~2017-09-09  8:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 14:46 New hook before-region-change-functions wanted Alan Mackenzie
2017-09-08 15:07 ` John Wiegley
2017-09-08 15:10 ` Eli Zaretskii
2017-09-08 15:12   ` Alan Mackenzie
2017-09-08 20:47 ` Dmitry Gutov
2017-09-09 13:46   ` Stefan Monnier
2017-09-08 22:22 ` Richard Stallman
2017-09-09  8:33   ` Alan Mackenzie [this message]
2017-09-10  2:44     ` Richard Stallman
2017-09-10  7:37       ` Alan Mackenzie
2017-09-11  1:17         ` Richard Stallman
2017-09-11 16:45           ` Alan Mackenzie
2017-09-12 15:46       ` Andreas Röhler
2017-09-09 13:44 ` Stefan Monnier
2017-09-10 18:53   ` Alan Mackenzie
2017-09-10 22:21     ` Stefan Monnier
2017-09-10 23:02       ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170909083326.GA5194@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).