GNU bug report logs -
#38406
27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes
Previous Next
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
View this message in rfc822 format
> Date: Thu, 5 Dec 2019 20:17:13 +0000
> Cc: yyoncho <at> gmail.com, 38406 <at> debbugs.gnu.org
> From: Alan Mackenzie <acm <at> muc.de>
>
> > We never provide any "safety nets" for silly hook functions, so we
> > shouldn't do that here as well. OTOH, if someone puts a function on
> > those hooks which does something legitimate, we should meet their
> > expectations and let those functions run, as the contract says.
>
> I think that, with my latest patch, that is the case.
>
> > So I think you shouldn't filter anything from the hook before you run
> > it.
>
> I thought you were urging me to do precisely that two or three posts ago.
>
> I just tried taking a particular function off of
> c--unsafe-post-self-insert-hook-functions and enabling electric-pair
> mode. On typing a brace, electric-pair-mode threw an obscure error. It
> doesn't make sense to call electric-pair-post-self-insert-function twice
> for one keypress. That is a good reason for having that function
> filtered out of the hook.
There might be a misunderstanding on my part here. Could you please
explain how come electric-pair-post-self-insert-function is called
twice if it isn't removed from the hook? where's the second (or the
first) call?
> The root of the problem is the hook post-self-insert-hook. It is a
> thoroughly bad idea. The implications of introducing it a few years ago
> weren't thought through.
That might be so, but I think it's too late for removing it now.
> Assuming that removing this hook from Emacs isn't an option, we are
> left with ugly ad-hoc workarounds, such as the patch we're currently
> discussing.
Yes.
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.