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


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 33840 <at> debbugs.gnu.org
Subject: Re: bug#33840: electric-pair-mode breaks self-insert-command
Date: Wed, 10 Jul 2019 13:34:26 +0200
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:

---

(self-insert-command N &optional C)

  Probably introduced at or before Emacs version 22.1.

Insert the character you type.
Whichever character C you type to run this command is inserted.
The numeric prefix argument N says how many times to repeat the insertion.
Before insertion, ‘expand-abbrev’ is executed if the inserted character does
not have word syntax and the previous character in the buffer does.
After insertion, ‘internal-auto-fill’ is called if
‘auto-fill-function’ is non-nil and if the ‘auto-fill-chars’ table has
a non-nil value for the inserted character.  At the end, it runs
‘post-self-insert-hook’.

---

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.  But if you are going to close it, please mark it as
> "won't fix" and _not_ "not a bug".

Will do.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

Previous Next


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