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: Noam Postavsky <npostavs@gmail.com>
Cc: Alan Mackenzie <acm@muc.de>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	35254@debbugs.gnu.org, Dima Kogan <dima@secretsauce.net>
Subject: bug#35254: 27.0.50; cc-mode/electric-pair-mode/electric-layout-mode: bad trailing whitespace behavior in cc-mode
Date: Tue, 14 May 2019 02:20:52 +0100	[thread overview]
Message-ID: <CALDnm530jXRLXVCcDvqVKePB2d-GfEwLRZFP6BbfVrb-12U05g@mail.gmail.com> (raw)
In-Reply-To: <87a7fphqlz.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2237 bytes --]

On Tue, May 14, 2019 at 12:38 AM Noam Postavsky <npostavs@gmail.com> wrote:

>
> > 1. Does it fix the reported problem (assuming it is a problem, and not
> > an otherwise potentially desirable change in behaviour)?
>
> It does fix the problem.
>

It reintroduces the previous behaviour, I gather. Can you explain
quickly why it was "a problem"?


> > 2. Do any of you have suspicions that it might introduce problems
> > elsewhere?
>
> I'm unsure.  It seems to be undoing a small part of [fd94312443]
> 2019-01-22 "electric-layout-mode kicks in before electric-pair-mode", so
> I guess it might rebreak whatever that commit is fixing.  But I don't
> quite understand what that commit is fixing (in particular, where the
> commit message says "which can be a problem in some modes", which modes
> are those?  What is "a problem"?).
>

Sorry, can't say without investigating much more than time allows. Can you
post the complete sentence?

I vaguely remember that if electric-pair-mode kicked in before
electric-layout-mode we would need more complex layout specs and more
painful indentation logic.  That's why I changed it.  There is a thread of
discussion with Stefan somewhere about this, not sure if public or off-list.


> > 3. Does it pass the automated test suite?
>
> No, it breaks 3 tests in tests/lisp/electric.el:
>
> 3 unexpected results:
>    FAILED  electric-layout-int-main-kernel-style
>    FAILED  electric-layout-plainer-c-mode-use-c-style
>    FAILED  electric-modes-int-main-allman-style
>
> In each case, the reason for failure is that the expected result has
> trailing whitespace that the actual result misses.  I guess
> electric-layout does want to put trailing whitespace in certain cases?
>

Yes, it certainly does.  That trailing whitespace is indentation, I
believe. And
the cursor should be left at that indentation.  Can you confirm? Anyway, if
it's
breaking tests it's almost certainly not what we want.  And if it breaks in
"plainer-c-mode" (a slightly better behaved c-mode), then its even more
certain that it's not what we want.

... unless the tests are demading something unreasonable from the electric
modes, of course.

-- 
João Távora

[-- Attachment #2: Type: text/html, Size: 3239 bytes --]

  reply	other threads:[~2019-05-14  1:20 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-13  6:32 bug#35254: 27.0.50; cc-mode/electric-pair-mode/electric-layout-mode: bad trailing whitespace behavior in cc-mode Dima Kogan
2019-05-11  3:12 ` Noam Postavsky
2019-05-11 12:05   ` Alan Mackenzie
     [not found]   ` <20190511120524.GA15991@ACM>
2019-05-11 14:06     ` Noam Postavsky
2019-05-11 16:19       ` Alan Mackenzie
2019-05-11 19:34         ` Basil L. Contovounesios
2019-05-12 16:14           ` Alan Mackenzie
2019-05-12 21:45             ` Basil L. Contovounesios
2019-05-13 10:14               ` Alan Mackenzie
     [not found]               ` <20190513101448.GA5525@ACM>
2019-05-13 12:49                 ` Basil L. Contovounesios
2019-05-12 15:12         ` Alan Mackenzie
2019-05-12 18:42           ` Noam Postavsky
2019-05-13 19:53   ` Alan Mackenzie
     [not found]   ` <20190513195323.GB5525@ACM>
2019-05-13 22:39     ` João Távora
2019-05-13 23:38       ` Noam Postavsky
2019-05-14  1:20         ` João Távora [this message]
2019-05-14  1:28         ` Stefan Monnier
2019-05-14  1:56       ` Noam Postavsky
2019-05-14  8:38       ` Alan Mackenzie
2019-05-13 23:32     ` Stefan Monnier
     [not found]     ` <jwvimue9bzj.fsf-monnier+emacs@gnu.org>
2019-05-13 23:45       ` Noam Postavsky
2019-05-14  1:26         ` Stefan Monnier
2019-05-14  9:27       ` Alan Mackenzie
2019-05-14  9:34       ` Alan Mackenzie
     [not found]       ` <20190514092735.GB4231@ACM>
2019-05-14 10:34         ` João Távora
2019-05-15 10:03           ` Alan Mackenzie
2019-05-15 11:27             ` João Távora
2019-05-15 13:19               ` Stefan Monnier
2019-05-15 13:55                 ` João Távora
2019-05-15 14:03                   ` João Távora
2019-07-01 12:24                   ` João Távora
2019-07-01 13:34                     ` Alan Mackenzie
     [not found]                     ` <20190701133427.GA23312@ACM>
2019-07-06 16:24                       ` Noam Postavsky
2019-07-06 22:24                         ` João Távora
2019-07-06 22:50                           ` Noam Postavsky
2019-07-06 22:33                       ` João Távora
     [not found]       ` <20190514093415.GC4231@ACM>
2019-05-14 15:38         ` Stefan Monnier

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=CALDnm530jXRLXVCcDvqVKePB2d-GfEwLRZFP6BbfVrb-12U05g@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=35254@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=dima@secretsauce.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@gmail.com \
    /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.