From: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
To: "João Távora" <joaotavora@gmail.com>, "Eli Zaretskii" <eliz@gnu.org>
Cc: 73688@debbugs.gnu.org, marc@soda.fm, monnier@iro.umontreal.ca
Subject: bug#73688: [PATCH] electric-pair-mode - preserve balance in conservative mode
Date: Sun, 1 Dec 2024 13:25:35 +0300 [thread overview]
Message-ID: <beae92e5-5c99-4ad8-9466-ec49c9426687@gmail.com> (raw)
In-Reply-To: <CALDnm52P+PNY01rehdCHEP=p4sSv6f6SJ9i_uzMeOTAVeC9bMw@mail.gmail.com>
Well, that's your call here.
But let me try and restate why I think there's a real problem. If we go
at it from the perspective of a user who has no knowledge of
electric-pair-mode internals, but now has the idea that the he wants a
before-word predicate. A quick look through variables would allow him to
discover the existence of electric-pair-inhibit-predicate. And just by
the name alone it sounds like exactly the right thing. But unfortunately
if the user looks into electric-pair-default-inhibit he'd notice that it
wraps around either electric-pair-inhibit-if-helps-balance or
electric-pair-conservative-inhibit. So, now the user needs to know what
those functions actually do and whether anything would break if he
removes them and replaces them with his own. Or a more careless
user(like me) would roll out his own predicate and only then notice that
it broke some advanced behavior. In the end, a reasonable user who just
wants to add a simple thing is now burdened by all the cognitive load of
learning numerous functions and use cases.
Thus electric-pair-inhibit-predicate in it's current state is not
something really user-customizable, but more of an Emacs internal.
As for the add-function option, I think relying on those as the first
option goes against the Emacs philosophy of providing real
customizability wherever possible and avoiding littering the manuals(and
user inits) with dirty hacks like this as a much as possible. Also, just
from the user standpoint, in the above case the same user would probably
go for add-function only after he already noticed that the
electric-pair-inhibit-predicate is inadequate for his purposes.
next prev parent reply other threads:[~2024-12-01 10:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 3:10 bug#73688: [PATCH] electric-pair-mode - preserve balance in conservative mode Marc Soda
2024-10-12 12:21 ` Eli Zaretskii
2024-10-12 19:47 ` Marc Soda
2024-10-12 20:36 ` João Távora
2024-10-12 20:43 ` Marc Soda
2024-10-12 23:36 ` João Távora
2024-10-17 16:48 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-26 17:48 ` Marc Soda
2024-10-26 18:47 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-09 9:22 ` Eli Zaretskii
2024-11-09 10:30 ` Nikolay Kudryavtsev
2024-11-09 15:55 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-10 14:28 ` Nikolay Kudryavtsev
2024-11-23 12:22 ` Eli Zaretskii
2024-11-23 17:37 ` Nikolay Kudryavtsev
2024-11-30 10:21 ` Eli Zaretskii
2024-11-30 12:30 ` João Távora
2024-12-01 10:25 ` Nikolay Kudryavtsev [this message]
2024-12-01 12:27 ` João Távora
2024-11-23 17:29 ` Marc Soda
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=beae92e5-5c99-4ad8-9466-ec49c9426687@gmail.com \
--to=nikolay.kudryavtsev@gmail.com \
--cc=73688@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=joaotavora@gmail.com \
--cc=marc@soda.fm \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).