unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
Cc: 42149@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#42149: Substring and flex completion ignore implicit trailing ‘any’
Date: Mon, 28 Dec 2020 11:34:59 +0000	[thread overview]
Message-ID: <87wnx2jh98.fsf@gmail.com> (raw)
In-Reply-To: <fv2zojeeja8c2t.fsf@gmail.com> (Dario Gjorgjevski's message of "Mon, 28 Dec 2020 11:22:18 +0100")

Dario Gjorgjevski <dario.gjorgjevski@gmail.com> writes:

>> Last time I looked it was too complex for me to follow, touches many
>> lines, and created unnecessary consing.  I'm convinced the current
>> algorithm in completion-pcm--hilit-commonality is fine for these
>> 1-char edge cases, given that the assumptions hold.
>
> I very much disagree with this

My assertion that your solution is complex is comparative, of course,
not absolute.  It is _more_ complex that some other existing solution --
in this case my three-line solution -- and I say that because of the
factual observation that it changes much more than three lines,
introduces new code paths, etc.  

For now, I believe the original problem that started this bug report,
which dealt with flex and substring completion, is fixed by my patch.
Your failed user experience of typing "R" to perform "M-x R" should now
be correct, as far as I can tell.

Of course, you say your current patch fixes _more_ things, but I've yet
to understand what those presumably broken things are.  Perhaps once all
of this is understood we will come to the conclusion that your solution
is indeed the simplest possible.  Or perhaps we won't.

> due to 1. the test cases

The test cases should be independent of the implementation, so adding
more tests doesn't make the implemented solution any simpler.  It does
make solutions _simpler to simplify_, which is why I welcome tests.

However, tests themselves should map to real-world problems (you know,
the ones that you describe in terms of Emacs -Q reproduction recipes).
And I'm still having trouble understanding exactly what these are for
some tests.  But I'm spending time to work on that.

> 2. the  previous reply to Stefan where I tried to explain the shortcomings of
> the current implementation of completion-pcm--hilit-commonality.

I don't understand these shortcomings, yet.  I think they should be
evidenced more clearly, in terms of actual user-experienceable problems.

> Also, could you point to the unnecessary consing?

completion-pcm--count-leading-holes and completion-pcm--match-size both
add consing.  That is clear to see from their respective
implementations.  I don't know if they can be made non-consing, though I
suspect they can.  Anyway, using them as they are adds a small amount
consing.

> I believe my patch is faster than the current implementation.

Why do you believe that?  Do you have any benchmarks to demonstrate it?

>> I'm not aware that it's not sound, but I do believe it's too complex and
>> not well understood.  In constrast, I can understand the three-line fix
>> I did earlier and which covers all of Darios's test cases for the flex
>> completion style.  Previously it was failing 7 cases, now it is only
>> failing these 3.
>
> Making the `any' explicit was also the very first thing I suggested, but
> further testing pointed to problems it doesn’t solve, which are indeed
> parts of the tests that are failing.

My latest proposal doesn't make the any explicit.  I'll try to
understand what the intention is behind the tests that are failing.

> I can add more tests if you think that would help.

Yes, it would.  But any test that you add should bring about evidence of
a real-world problem.  I.e., to state the obvious but make my point clear,
the assertion:

    (should (eq 'foo 'bar))
    
fails spectacularly but doesn't bring about such evidence.

João





  reply	other threads:[~2020-12-28 11:34 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 10:40 bug#42149: Substring and flex completion ignore implicit trailing ‘any’ Dario Gjorgjevski
2020-07-01 10:58 ` João Távora
2020-07-01 11:03 ` João Távora
2020-07-01 11:10   ` Dario Gjorgjevski
2020-09-08  9:05     ` Dario Gjorgjevski
2020-09-08  9:30       ` João Távora
2020-09-08  9:44         ` Dario Gjorgjevski
2020-09-08 10:08           ` João Távora
2020-09-08 11:12             ` Dario Gjorgjevski
2020-09-08 11:22               ` João Távora
2020-09-08 11:30                 ` Dario Gjorgjevski
2020-09-08 11:32                   ` João Távora
2020-09-09 10:17                     ` Dario Gjorgjevski
2020-09-09 11:38                       ` Dario Gjorgjevski
2020-09-09 13:13                         ` Stefan Monnier
2020-09-10 11:26                           ` Dario Gjorgjevski
2020-10-14  8:22                             ` Dario Gjorgjevski
2020-10-14  8:39                               ` João Távora
2020-10-14  9:01                                 ` Dario Gjorgjevski
2020-10-15 14:25                                   ` Dario Gjorgjevski
2020-11-20 20:39                                     ` Dario Gjorgjevski
2020-11-20 21:27                                       ` João Távora
2020-11-25  0:01                                         ` João Távora
2020-11-25  8:22                                           ` Dario Gjorgjevski
2020-11-25 12:22                                             ` João Távora
2020-11-25 13:27                                               ` Dario Gjorgjevski
2020-12-23  9:41                                                 ` Dario Gjorgjevski
2020-12-27 20:08                                                   ` João Távora
2020-12-27 20:23                                                     ` João Távora
2020-12-27 21:20                                                     ` Stefan Monnier
2020-12-28  9:30                                                       ` João Távora
2020-12-28 16:03                                                         ` Stefan Monnier
2020-12-28 16:58                                                           ` João Távora
2020-12-28 16:07                                                         ` Stefan Monnier
2020-12-28 17:04                                                           ` João Távora
2020-12-27 21:45                                     ` Stefan Monnier
2020-12-28  9:38                                       ` João Távora
2020-12-28 10:22                                         ` Dario Gjorgjevski
2020-12-28 11:34                                           ` João Távora [this message]
2020-12-28 11:48                                             ` Dario Gjorgjevski
2020-12-28 12:57                                               ` João Távora
2020-12-28 10:17                                       ` Dario Gjorgjevski
2020-12-28 16:26                                         ` Stefan Monnier
2020-12-28 17:16                                           ` João Távora
2020-12-28 19:48                                             ` Dario Gjorgjevski
2020-12-28 20:00                                               ` Stefan Monnier
2020-12-28 23:20                                                 ` João Távora
2020-12-29 13:27                                                   ` João Távora
2021-05-13  9:24                                                   ` Lars Ingebrigtsen
2021-05-13 14:31                                                     ` João Távora
2021-05-13 15:41                                                       ` Dario Gjorgjevski
2021-05-13 16:04                                                         ` João Távora
2021-05-16 13:51                                                           ` Lars Ingebrigtsen

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=87wnx2jh98.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=42149@debbugs.gnu.org \
    --cc=dario.gjorgjevski@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).