From: Lars Ingebrigtsen <larsi@gnus.org>
To: Alan Mackenzie <acm@muc.de>
Cc: 33840@debbugs.gnu.org
Subject: bug#33840: electric-pair-mode breaks self-insert-command
Date: Wed, 10 Jul 2019 13:34:26 +0200 [thread overview]
Message-ID: <m3y31615tp.fsf@gnus.org> (raw)
In-Reply-To: <20190710093956.GA4109@ACM> (Alan Mackenzie's message of "Wed, 10 Jul 2019 09:39:56 +0000")
Alan Mackenzie <acm@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
next prev parent reply other threads:[~2019-07-10 11:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-23 2:38 bug#33840: electric-pair-mode breaks self-insert-command Alan Mackenzie
2019-07-09 22:39 ` Lars Ingebrigtsen
2019-07-10 9:39 ` Alan Mackenzie
2019-07-10 11:34 ` Lars Ingebrigtsen [this message]
2019-07-10 17:08 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3y31615tp.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=33840@debbugs.gnu.org \
--cc=acm@muc.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.