From: Alan Mackenzie <acm@muc.de>
To: "João Távora" <joaotavora@gmail.com>
Cc: Beatrix Klebe <beeuhtricks@gmail.com>,
bea@klebe.blog, Stefan Monnier <monnier@iro.umontreal.ca>,
33794@debbugs.gnu.org
Subject: bug#33794: 26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode
Date: Sun, 23 Dec 2018 20:21:43 +0000 [thread overview]
Message-ID: <20181223202143.GA6658__24271.0002385595$1545600388$gmane$org@ACM> (raw)
In-Reply-To: <87sgypmasb.fsf@gmail.com>
Hello, João.
On Sat, Dec 22, 2018 at 22:55:32 +0000, João Távora wrote:
> Alan Mackenzie <acm@muc.de> writes:
> > Right now, João's direction of travel seems to be to cement
> > electric-pair-mode's unusability in modes like CC Mode, of which there
> > are quite a few. I hope I've misunderstood this and I'm mistaken.
> You are. In fact, I'm coming up with alternatives so that
> electric-pair-mode works with CC-Mode, even if the user or some other
> mode customizes it to not use c-electric-{brace,paren}.
CC Mode is not customisable in this way, any more than any other major
mode. Ripping out and replacing the innards of Lisp code is called
"hacking", not "customisation".
At the moment, electric-pair-mode does not work with c-electric-brace
and c-electric-paren. This is the bug reported by Beatrix, the OP. You
are telling me you are not working on fixing the part of this problem
which is in e-p-m. Please understand me being somewhat frustrated by
this. If I were to dig in to e-p-m, make fixes, and commit them, I
suspect you would be somewhat annoyed.
> You may say that I am not working actively to make e-p-m work with
> c-toggle-auto-newline, which *in my opinion* is a part of CC-mode that
> could and should someday be fulfilled by electric-layout-mode.
I think you really mean c-electric-{brace,paren} here, not
c-toggle-auto-newline. electric-layout-mode won't be superseding those
functions any time soon.
> That is 100% true. But I am not preventing anyone from taking on that
> task, or even suggesting it's trivial or very hard. I just don't
> know, and I have no interest in studying this alternative.
But you're posting in the thread for bug #33794. I'm disappointed
you're not cooperating with me to fix this bug.
> That is quite different from "cementing an unusability".Have a look at
> my recent commits in scratch/fix-33794-extend-electric-layout-mode and
> you will see that I have done 0 changes to e-p-m.
I'm not interested in that branch, I'm afraid. electric-layout-mode has
no relevance to CC Mode. I'm more interested in bug #33794.
> Also, can you once and for all describe the "unusabilities" in other
> modes you keep talking about???
Yes. These other modes call self-insert-command. self-insert-command,
because of the way post-self-insert-hook is (ab)used, has no definite
function. Sometimes it does what the doc says (inserting N copies of
the last character typed), other times it does other things.
The only safe way for a mode to call self-insert-command is by binding
post-self-insert-hook to a known value, usually nil. This prevents all
electric-pair-mode processing.
I would very much like c-electric-brace, etc., to be able to use e-p-m
functionality, rather than partially duplicating it inside cc-cmds.el,
as I did in the patch I sent to Beatrix, Cc: to yourself, earlier on
today.
> >> Yes, Alan disagrees with this. In his view, electric- modes are
> >> abusing the semantics of post-self-insert-hook. Well, at least in
> >> my view of his views :-)
> > Please don't misrepresent me like that.
> Really, I didn't. But OK, I will think thrice before writing "Alan
> thinks" sentences.
Sorry, you didn't really, that's true. But you did put the emphasis on
the wrong point.
> > The point is that the electric-... modes abuse not so much the
> > post-self-insert-hook (although they do),
> So, in reality I didn't misrepresent you.
> > but they totally break self-insert-command. You have had several
> > hours to contest this, but by your silence appear to have accepted it.
> How can I contest or accept that which I have no opinion of? I'm not an
> expert in the teleology of self-insert-command! Find someone who is to
> discuss this!
You're working on #33794. You must surely have some notion of the cause
of the bug. I've said what my idea is, and I'm somewhat disappointed
you've failed to comment on this central point. Without understanding
the cause of a bug, any fix is going to be suboptimal.
> Frankly: "my silence"... I'm not taking that bait, OK? Really, Alan,
> please please understand that I am only trying to make
> electric-layout-mode work a bit better, and not even touching any of its
> basic functioning vis-a-vis self-insert-command.
But you're commenting on this thread, which is about a bug concerning
the interaction of e-p-m with CC Mode, not e-l-m.
> João
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2018-12-23 20:21 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 17:38 bug#33794: 26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode Beatrix Klebe
[not found] ` <mailman.5894.1545155289.1284.bug-gnu-emacs@gnu.org>
2018-12-21 13:48 ` Alan Mackenzie
2018-12-21 13:57 ` João Távora
2018-12-21 14:12 ` Stefan Monnier
2018-12-21 16:00 ` Beatrix Klebe
2018-12-21 18:49 ` João Távora
2018-12-21 19:06 ` Beatrix Klebe
2018-12-21 19:20 ` João Távora
2018-12-21 19:24 ` João Távora
2018-12-21 19:43 ` Beatrix Klebe
2018-12-22 1:08 ` João Távora
2018-12-22 2:16 ` João Távora
2018-12-22 2:41 ` Alan Mackenzie
2018-12-22 3:22 ` João Távora
2018-12-22 4:41 ` Beatrix Klebe
2018-12-22 10:02 ` João Távora
2018-12-22 12:33 ` Alan Mackenzie
2019-01-01 19:27 ` Alan Mackenzie
2019-01-15 16:10 ` Alan Mackenzie
2018-12-21 20:11 ` Alan Mackenzie
2018-12-22 0:45 ` João Távora
2018-12-22 10:20 ` Alan Mackenzie
2018-12-22 13:47 ` João Távora
2018-12-21 21:50 ` Alan Mackenzie
2018-12-22 16:22 ` Stefan Monnier
2018-12-22 16:34 ` Beatrix Klebe
2018-12-22 17:12 ` Stefan Monnier
2018-12-22 17:34 ` Beatrix Klebe
2018-12-22 21:19 ` João Távora
2018-12-22 22:15 ` Alan Mackenzie
2018-12-22 22:55 ` João Távora
2018-12-23 20:21 ` Alan Mackenzie [this message]
[not found] ` <20181223202143.GA6658@ACM>
2018-12-23 21:38 ` João Távora
2018-12-23 21:46 ` Alan Mackenzie
2018-12-28 12:44 ` Alan Mackenzie
2018-12-23 14:43 ` Stefan Monnier
2018-12-23 14:48 ` Alan Mackenzie
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='20181223202143.GA6658__24271.0002385595$1545600388$gmane$org@ACM' \
--to=acm@muc.de \
--cc=33794@debbugs.gnu.org \
--cc=bea@klebe.blog \
--cc=beeuhtricks@gmail.com \
--cc=joaotavora@gmail.com \
--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).