From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: New hook before-region-change-functions wanted Date: Fri, 08 Sep 2017 16:07:37 +0100 Message-ID: References: <20170908144657.GA3463@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1504907974 27379 195.159.176.226 (8 Sep 2017 21:59:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Sep 2017 21:59:34 +0000 (UTC) User-Agent: Gnus/5.130016 (Ma Gnus v0.16) Emacs/25.2.50 (darwin) Cc: Stefan Monnier , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 08 23:59:29 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqRJ5-0006Xo-0w for ged-emacs-devel@m.gmane.org; Fri, 08 Sep 2017 23:59:23 +0200 Original-Received: from localhost ([::1]:47444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqRJC-0007tV-65 for ged-emacs-devel@m.gmane.org; Fri, 08 Sep 2017 17:59:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqRJ3-0007sz-6a for emacs-devel@gnu.org; Fri, 08 Sep 2017 17:59:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqRJ0-0002pU-4O for emacs-devel@gnu.org; Fri, 08 Sep 2017 17:59:21 -0400 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:44680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqRIz-0002mg-TP for emacs-devel@gnu.org; Fri, 08 Sep 2017 17:59:18 -0400 Original-Received: by mail-wm0-x232.google.com with SMTP id 137so8926065wmj.1 for ; Fri, 08 Sep 2017 14:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version; bh=H/hiyA0+nYwGLwQ7J/iPQcmYsQ6BIe4dGLzVZjBEtF0=; b=FNQ0LBzy4uJwODfKOcHiEcxW7T5uOaCUZI2fMaMz/CYuqPgcTeavbpbf2TGCZnSNJD PO1VfjSggUwHNPrPxpdFsPRUrrPviEfn7KzwBTA58RuCuyrzvRmXR1ixwoDTSkxetPi2 W1+3QA9YCECbGwY72qqCK830K+5ys9TG3fzo4G6/ChPFtH6jDAzgLR0sClAPq5RGasQj vg2uOIf6zGARHgf6ZS/f8ieFTR9Aw7jQZx1MC0q+Qy77MlDUpuQzXxeUwHcnvjNMUs9k NuQwnIR8DhVdsYUnYxs4QnOgBObXRmzLCl9nJNRqqUZ9hVhrVYlxnju+aUVx+5vA/P6s UnkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mail-followup-to:mime-version; bh=H/hiyA0+nYwGLwQ7J/iPQcmYsQ6BIe4dGLzVZjBEtF0=; b=dAyL1+AavV4JS5QsinBvFucXUY5XTVtqdQR+uexD0EMFK5jMa0EPa6tm03tvWFDLGb f66JR//mRwA9PBC/A5kPaw/htCvJ4ityRBE2MwNcfWimWs8Ib59kSlnXBBSOhANfjfDk eTKC1eELOGVUPPLeWZVKEcKqgJ2rwm2H6znUi6Nk6pMPBPheMKCa0g8rxGAtOaD6KUac /Ll2Sqoed07OWEPtT1jn2MfUxona8MTgmsJns/H88KkajGh1RSCCPTNxL+pT/Veu0AqK CJKQltuckPZtJGVLRLHVcIFyODIXso6cTD8DnARffrV6/Jfg3BBK9p/uO1gNSUwsvkjp VNrg== X-Gm-Message-State: AHPjjUiXRwOkLCUblotDvcEm7ZqDKJyAaWlolxB8wKgFhtRbCFWqKVXr NZsgbJDW7HodEWd4CkO0b70+J43u X-Google-Smtp-Source: AOwi7QBFWdJNypiI+oWA2B0bNya93LxJpxnAgFi55L1D2fB3yCsUxUSWNTxQbk4ZZWnE/bKLh3EiVQ== X-Received: by 10.28.211.66 with SMTP id k63mr2973172wmg.85.1504907955144; Fri, 08 Sep 2017 14:59:15 -0700 (PDT) Original-Received: from Hermes.local (client-7-154.visitor-network.oxuni.org.uk. [192.76.7.154]) by smtp.gmail.com with ESMTPSA id v1sm1589322wre.12.2017.09.08.14.59.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 14:59:13 -0700 (PDT) X-Google-Original-From: "John Wiegley" Original-Received: by Hermes.local (Postfix, from userid 501) id 473172F122EF; Fri, 8 Sep 2017 16:07:40 +0100 (BST) In-Reply-To: <20170908144657.GA3463@ACM> (Alan Mackenzie's message of "Fri, 8 Sep 2017 14:46:57 +0000") Mail-Followup-To: Alan Mackenzie , emacs-devel@gnu.org, Stefan Monnier X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218035 Archived-At: >>>>> "AM" == Alan Mackenzie 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