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: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode
Date: Tue, 9 Jul 2019 17:32:01 +0100	[thread overview]
Message-ID: <CALDnm52xLAejvVyGA5bPfxPoHwSzOaajG0VLwjiLgSnZRhZ=vQ@mail.gmail.com> (raw)
In-Reply-To: <e9ba01b3-6037-00c1-9b38-f8ddb27f0743@gmail.com>

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

On Tue, Jul 9, 2019 at 5:05 PM Clément Pit-Claudel <cpitclaudel@gmail.com>
wrote:
>
> On 2019-07-09 10:28, João Távora wrote:
> >
> > On Tue, Jul 9, 2019 at 1:33 PM Clément Pit-Claudel <
cpitclaudel@gmail.com <mailto:cpitclaudel@gmail.com>> wrote:
> >
> >> * Fontifying to the end of the line and not past it minimizes
refontification in that case
> >>
> >> Is that controversial?
> >
> > I didn't say it was.
>
> You wrote "No, it doesn't".

I wrote that we you said it would "minimize refontification and blinking".
I still
believe that, that it _doesn't_ minimize blinking, at least how I use
Emacs (more on that below). In your follow up you dropped the "blinking"
part, and kept the "minimize refontification" thing. And so that part is
not "controversial" (it's also not very interesting, as I tried to explain
afterwards).
>
> > I don't know what that amounts to" care about:
> >
> > - consistency: this is not consistent with how the rest of Emacs works.
>
> Which rest of Emacs? I'm saying I'd happily use an option all major modes
to work the way Alan did it in cc-mode.

But below you agree with me that it does't make much sense in
elisp or ruby.

> > - distraction: this is just as "distracting", and I actually like the
current "global
> > switch" more as it helps me spot the error easily;
>
> For me there's no error to spot: in the course of typing a string, I type
its opening ",
> then its contents, and then its closing ".  The rest of the buffer being
painted in
> string color is distracting, and it doesn't help me spot any error.

Of course. For me it never happens, _becauue I use electric-pair-mode_.
But it also probably would happen quite infrequently, if instead of
electric-pair-mode, I used another popular paren-matching package
such as smartparens, or paredit, or whatever.

So, again, it has to do with how you write code.

> >> > Both situations are wrong, and neither is "more wrong" than the
other.
> >> I'm glad we agree. That's why I wrote 'That's not more "correct", of
course'
> >
> > You seemed to imply there was some kind of advantage. I don't see which,
>
> But I told you, didn't I?  I said I'd like it better because I don't like
my buffers blinking :)

But _I_ don't see which, because I don't use Emacs the way you do.

In the next message I can start to sell the benefits of electric-pair-mode.
Oh what the heck, I can't help myself: it is designed to have you type
_exactly_ the same keys as you do now, while never unbalancing the
buffer. No blinking, really. Heck even smartparens will give you that,
in principle.

> > or at least I don't see any advantage that outweighs the fact that this
> > breaks consistency to virtually all other emacs major modes.
>
> It would break consistency with those major modes that allow
> multi-line unescaped strings, indeed.  I'm not too bothered by that.

OK. But let's not make it the default. Let consistency breakage be
a user-customized exception, not the norm.

> >> > But the version you propose is much harder to implement, likely less
> >> > efficient,
> >> Strong words :) Are you saying refontifying the whole screen after the
> >> point is faster than just refontifying to the end of the line?
> >
> > In your model, you are not refontifying "to the end of the line".
> > You may have meant to say "to the next closing double quote", which may
> > happen after the end of the screen.
>
> No, I meant what I say: to the end of the line.
> > While that may be less text, I would
> > expect perfomance of (re)fontification to vary according to the thing
being
> > fontified.
>
> In the model I'm describing, you don't have to refontify anything
> except the current line.  Am I missing something?

You and I are, I was talking about your "model" but assuming a
different usage pattern situation where you strip off a closing
backslash at the end of a multi-line string. Also I'm assuming you
are editing code, not writing code from scratch. The latter never
brings such problems, because I use a paren-matching solution.

João

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

  reply	other threads:[~2019-07-09 16:32 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 13:16 bug#36474: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode Alan Mackenzie
     [not found] ` <CALDnm51Hi10KMqYneWBamNL4sNdzHEz6_NasGk=oR_y-=1Y7nQ@mail.gmail.com>
2019-07-02 15:27   ` Fwd: " João Távora
2019-07-02 16:04   ` bug#36474: " Alan Mackenzie
2019-07-02 17:22     ` João Távora
2019-07-02 18:28       ` bug#36474: " Alan Mackenzie
2019-07-02 21:11         ` Stefan Monnier
2019-07-03  9:28         ` João Távora
2019-07-03 10:58           ` Alan Mackenzie
2019-07-03 13:07             ` Dmitry Gutov
2019-07-03 13:32               ` Alan Mackenzie
2019-07-03 14:25                 ` Dmitry Gutov
2019-07-03 15:58                 ` Eli Zaretskii
2019-07-03 20:54                   ` Alan Mackenzie
2019-07-04  2:33                     ` Eli Zaretskii
2019-07-04  1:36                 ` Richard Stallman
2019-07-03 13:33               ` Eli Zaretskii
2019-07-03 13:35               ` João Távora
2019-07-03 13:31             ` João Távora
2019-07-03 18:25               ` Kévin Le Gouguec
2019-07-04  0:52                 ` João Távora
2019-07-04  6:17                   ` Kévin Le Gouguec
2019-07-04 15:05               ` Alan Mackenzie
2019-07-04 15:50                 ` João Távora
2019-07-04 16:58               ` [PATCH] " Alan Mackenzie
2019-07-04 18:45                 ` João Távora
2019-07-04 19:01                   ` Alan Mackenzie
2019-07-04 21:44                     ` João Távora
2019-07-08 10:05                       ` Alan Mackenzie
2019-07-08 12:10                         ` João Távora
2019-07-08 15:49                         ` Stefan Monnier
2019-07-08 16:33                           ` Stefan Monnier
2019-07-08 17:24                             ` Alan Mackenzie
2019-07-08 17:32                               ` Stefan Monnier
2019-07-08 16:45                           ` Alan Mackenzie
2019-07-08 17:29                             ` Stefan Monnier
2019-07-08 18:05                               ` Alan Mackenzie
2019-07-08 20:59                                 ` Stefan Monnier
2019-07-09  6:41                                   ` Clément Pit-Claudel
2019-07-09  9:06                                     ` João Távora
2019-07-09  9:23                                       ` João Távora
2019-07-09  9:52                                         ` Alan Mackenzie
2019-07-09 10:54                                           ` João Távora
2019-07-09 11:18                                             ` João Távora
2019-07-09 15:18                                             ` Dmitry Gutov
2019-07-09 15:40                                               ` contextual refontification (was: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode) Stefan Monnier
2019-07-10  9:32                                                 ` João Távora
2019-07-09 15:43                                               ` [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode João Távora
2019-07-09 15:31                                             ` Alan Mackenzie
2019-07-09 16:14                                               ` João Távora
2019-07-09 12:33                                       ` Clément Pit-Claudel
2019-07-09 14:28                                         ` João Távora
2019-07-09 16:05                                           ` Clément Pit-Claudel
2019-07-09 16:32                                             ` João Távora [this message]
2019-07-09 17:09                                               ` João Távora
2019-07-09 13:45                                     ` Stefan Monnier
2019-07-09 16:00                                   ` Alan Mackenzie
2019-07-09 17:11                                     ` Stefan Monnier
2019-07-09 18:26                                       ` Alan Mackenzie
2019-07-09 18:47                                         ` Eli Zaretskii
2019-07-09 18:53                                         ` João Távora
2019-07-10 10:32                                           ` Alan Mackenzie
2019-07-10 10:40                                             ` Lars Ingebrigtsen
2019-07-10 12:24                                               ` João Távora
2019-07-10 14:14                                                 ` Clément Pit-Claudel
2019-07-10 16:07                                                   ` João Távora
2019-07-11 15:14                                                 ` Lars Ingebrigtsen
2019-07-11 15:43                                                   ` João Távora
2019-07-11 15:51                                                     ` Lars Ingebrigtsen
2019-07-11 16:13                                                       ` João Távora
2019-07-12 15:58                                                         ` Lars Ingebrigtsen
2019-07-12 18:47                                                           ` João Távora
2019-07-13  0:08                                                             ` Lars Ingebrigtsen
2019-07-10 12:10                                             ` João Távora
2019-07-10 14:03                                               ` Alan Mackenzie
2019-07-10 16:05                                                 ` João Távora
2019-07-10 17:56                                                   ` Alan Mackenzie
2019-07-11  0:11                                                     ` Richard Stallman
2019-07-03 16:56             ` Stefan Monnier
2019-07-03 16:58             ` Stefan Monnier
2019-07-04 15:24               ` Alan Mackenzie
2019-07-04 15:52                 ` Stefan Monnier
2019-07-04 16:42                   ` Alan Mackenzie
2019-07-04 20:16                     ` Stefan Monnier
2019-07-04 21:27                     ` João Távora
2019-07-02 17:22     ` bug#36474: " João Távora
     [not found] ` <handler.36474.B.156207340818492.ack@debbugs.gnu.org>
2019-07-08  9:36   ` bug#36474: Acknowledgement (Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode) 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='CALDnm52xLAejvVyGA5bPfxPoHwSzOaajG0VLwjiLgSnZRhZ=vQ@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=cpitclaudel@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.