GNU bug report logs - #33840
electric-pair-mode breaks self-insert-command

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sun, 23 Dec 2018 02:46:01 UTC

Severity: normal

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Alan Mackenzie <acm <at> muc.de>, 33840 <at> debbugs.gnu.org
Subject: bug#33840: electric-pair-mode breaks self-insert-command
Date: Wed, 10 Jul 2019 13:08:24 -0400
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Alan Mackenzie <acm <at> muc.de> writes:
>
>> self-insert-command is a primitive, and it shouldn't be modified to do
>> other things.  Instead these other things should be done alongside the
>> primitive, or after it.
>>
>> Similarly, you would not modify + such that (+ 2 3) => 6, even if you had
>> a use case where you wanted this strange arithmetic.
>
> I agree that modifying primitives is really confusing and should be
> avoided, but I don't think self-insert-command is ... very primitive.
> :-)  I mean, look at the doc string:
[...]
> There's a lot of stuff going on there!  It sounds more like a "don't use
> this function from code unless you want unpredictable things to happen"
> thing to me...
>
>> Being realistic, I now don't really expect this bug to be fixed.  It
>> would cost too much.

FWIW, I don't think using a documented hook should be considered
"modifying" the primitive which calls it (unlike say, using advice).
But electric-pair-mode's current implementation seems to involve a
complicated dance of inserting and deleting and inserting characters
again, so I think there is some room for improvement.  Perhaps by using
something other than post-self-insert-hook.




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

Previous Next


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