GNU bug report logs - #38406
27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes

Previous Next

Package: emacs;

Reported by: yyoncho <yyoncho <at> gmail.com>

Date: Wed, 27 Nov 2019 20:01:01 UTC

Severity: normal

Found in version 27.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 38406 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Eli Zaretskii <eliz <at> gnu.org>, yyoncho <at> gmail.com, 38406 <at> debbugs.gnu.org
Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its
 contract in cc-mode derived modes
Date: Thu, 5 Dec 2019 19:14:59 +0000
Hello, Dmitry.

On Wed, Dec 04, 2019 at 23:04:27 +0200, Dmitry Gutov wrote:
> On 04.12.2019 22:41, Alan Mackenzie wrote:
> > +(defvar c--unsafe-post-self-insert-hook-functions
> > +  '(smie-blink-matching-open
> > +    electric-pair-post-self-insert-function
> > +    blink-paren-post-self-insert-function
> > +    electric-indent-post-self-insert-function
> > +    electric-layout-post-self-insert-function
> > +    electric-quote-post-self-insert-function)
> > +    "Known unsafe functions when members of `post-self-insert-hook' in CC Mode")

> I don't see how filtering out a bunch of popular consumers of 
> post-self-insert-hook can make it "act as per its contract again".

Think of it more as "filtering in" all functions on
post-self-insert-hook _except_ the ones mentioned, which are harmful in
CC Mode.

> More surprisingly, what did smie-blink-matching-open and 
> blink-paren-post-self-insert-function ever do so wrong? Neither of them 
> modifies the buffer's contents.

No, but if allowed to run, they would probably double the blink time on
the paren match, which would be a Bad Thing.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 5 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.