all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Beatrix Klebe <beeuhtricks@gmail.com>
Cc: Alan Mackenzie <acm@muc.de>,
	bea@klebe.blog, 33794@debbugs.gnu.org,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#33794: 26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode
Date: Sat, 22 Dec 2018 10:02:07 +0000	[thread overview]
Message-ID: <87d0pt98ww.fsf@gmail.com> (raw)
In-Reply-To: <CAH6apoZaCLxPTBQcuHy4vmrwu=wTnYMDPiwy_atBKBP+YacrYg@mail.gmail.com> (Beatrix Klebe's message of "Fri, 21 Dec 2018 23:41:38 -0500")

Beatrix Klebe <beeuhtricks@gmail.com> writes:

> I didn’t intend to kick the hornet’s nest of ideological factions

You kinda did, but it's in their nature to be kicked.

> here, I was honestly just wondering if this was actually expected
> behavior of these two modes together and if not if the fix was
> trivial. The answer seems to be that it is indeed a bug and the fix is
> non-trivial,

All correct.

> and furthermore while I appreciate attempts to hotfix it, those are
> not solutions of the quality I was expecting

 Can you specify what is missing in terms of quality? 

> , (I encountered those already while doing my own research before I
> filed this bug report and I found them unsatisfactory both then and
> now) and furthermore I feel like I should be open in stating that I
> feel somewhat condescended to.

I'm very sorry about that, it was never my intention (please read
below).

> I know what c-toggle-auto-newline is, I also know that functions
> prefixed with “toggle” are functions that toggle a mode or setting
> internally, in this case a minor mode called auto-newline
> (https://www.gnu.org/software/emacs/manual/html_node/ccmode/Auto_002dnewlines.html)

After following the link you gave me: I see the misunderstanding.  You
see, even though CC-mode's manual says "auto-newline" is a minor mode,
it's not.  It's just a variation on the major-mode's behaviour (in fact
the CC-mode manual clarifies it here[1] as a "minor-mode-like feature",
but the misunderstanding remained). There's no M-x auto-newline-mode to
be invoked and no (define-minor-mode auto-newline-mode...) to be found
in the code.  Mentions to this as a minor mode are only found in the
manual (a documentation bug, in my opinion).

So this is why I was so specific with M-x c-toggle-auto-newline,
becausen that's the actual command that someone who doesn't use it needs
to turn on that pseudo-minor-mode: Without it, I couldn't observe the
behaviour that you reported. With it, you couldn't experience the
solution I was giving you.

> I was about five minutes away from diving into the source of these two
> packages to fix it myself, as I have spent probably 10 hours
> reasearching this problem at this point. I’m sorry if I misunderstood
> something, I was mainly looking for clarification that what I was
> experiencing was a bug, and it is beginning to seem like there is none
> to be had here.

OK I'll clarify: There is a bug: there are two diverging views on how to
fix it because there are diverging views about where it lies in Emacs:

* The only available fix so far (mine) is still experimental.  I would
  appreciate your feedback but it's perfectly OK to go spend your time
  elsewhere because there's a risk that it won't make it in the end.

  In this fix, I'm not targetting Alan's code: I am extending an
  existing, separate feature that could render some of CC-mode's
  functionality, specifically the peudo auto-newline-mode, obsolete.

* The other fix isn't available yet, in experimental or final form.
  Presumably it would target electric-pair-mode.  If Alan, you, or
  someone else wants to work on it, that's quite alright, but beware
  that electric-pair-mode must work for all major modes (including
  things like minibuffers and REPLs), not just CC-mode.

Regards,
João

[1]: https://www.gnu.org/software/emacs/manual/html_node/ccmode/Minor-Modes.html#Minor-Modes


>
> On Fri, Dec 21, 2018 at 10:22 PM João Távora <joaotavora@gmail.com> wrote:
>
>  Alan Mackenzie <acm@muc.de> writes:
>
>  > Hello, Beatrix.
>  >
>  > As maintainer of CC Mode, I earnestly recommend you NOT to follow João's
>  > suggestion.  It will not work, and will waste your time.
>
>  What, exactly, will not work?
>
>  > Even if it appears to work, you will end up picking out bugs for an
>  > indeterminate period.
>
>  What bugs?  If you know of any, it would be good to report them, right?
>
>  > Basically, electric-pair-mode as it is currently built is incompatible
>  > with CC Mode, as I have pointed out here, albeit somewhat
>  > undiplomatically.
>  >
>  > I suggest you do nothing until tempers amongst Emacs developers have
>  > cooled down, and hopefully a genuine solution to the bug has been worked
>  > out and implemented.
>
>  If you don't like electric-layout-mode, don't use it.  I'm trying to
>  develop an alternative to c-toggle-auto-newline within the
>  electric-*-mode frame.  It's an experiment which I don't even know if
>  Stefan will agree to, but it seems to work.  If Beatrix wants to
>  cooperate, why shouldn't she?
>
>  I'm not asking you to nuke c-toggle-auto-newline or anything, but should
>  we all be forced to use it?  I don't think it's sensible in a free
>  software project, Alan (and my temper is quite cool when saying this
>  :-))
>
>  Again, I said I don't have anything against making eletric-pair-mode
>  compatible with c-toggle-auto-newline if someone comes up with a good
>  solution that doesn't break e-p-m for other modes.  I will not invest
>  time in looking into that solution, but you or someone else may, of
>  course.
>
>  In the meantime let people explore alternatives, right?
>
>  João





  reply	other threads:[~2018-12-22 10:02 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 [this message]
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
     [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0pt98ww.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=33794@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=bea@klebe.blog \
    --cc=beeuhtricks@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 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.