all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alexander Adolf <alexander.adolf@condition-alpha.com>
To: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: Eric Abrahamsen <eric@ericabrahamsen.net>, 59314@debbugs.gnu.org
Subject: bug#59314: 29.0.50; EUDC and message-mode header completion
Date: Mon, 19 Dec 2022 17:09:01 +0100	[thread overview]
Message-ID: <3c62ae5a325020cfe7d66168372685d0@condition-alpha.com> (raw)
In-Reply-To: <m3tu1x5okk.fsf@fitzsim.org>

Hello Thomas,

Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:

> [...]
>>> This may be a clue; while I was experimenting, I found that this:
>>>
>>> @@ -8432,7 +8438,7 @@ message--name-table
>>>                            (all-completions string
>>>                                             (ecomplete-completion-table 'mail)
>>>                                             pred)))))
>>> -	   (if action candidates (try-completion string candidates))))))))
>>> +	   (if action (cdr candidates) (try-completion string candidates))))))))
>>> [...]
>>
>> Interesting; thanks for sharing this. Effectively, you're dropping the
>> first entry from the `candidates` list before returning it. What does
>> your `candidates` list contain at that point (before removal)?
>
> ("Emacs ERT3 <emacs-ert-test-3@bbdb.gnu.org>"
>  "Emacs ERT4 <emacs-ert-test-4@bbdb.gnu.org>")

Looking at the code in `completion-pcm--merge-try` (which is part of the
partial-completion style, and gets called from the basic, substring, and
flex completion styles), reducing it to a single candidate may make a
difference; the function begins like this:

---------------------------- Begin Quote -----------------------------
(defun completion-pcm--merge-try (pattern all prefix suffix)
  (cond
   ((not (consp all)) all)
   ((and (not (consp (cdr all)))        ;Only one completion.
         ;; Ignore completion-ignore-case here.
         (equal (completion-pcm--pattern->string pattern) (car all)))
    t)
   (t
[...]
----------------------------- End Quote ------------------------------

I.e. the behaviour for a single candidate (second condition case) is
different from when there's more than one candidate (third, and default
condition case). This could explain why you change seemed to improve
things.

> [...]
> OK, interesting; maybe we've found a bug in the completion engine
> itself.

That may well be the case.

And as the completion styles generously call each other, any change in
that area will require extra care.

> [...]
> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
> index 5faa3c8d4e8..455135628c8 100644
> --- a/lisp/minibuffer.el
> +++ b/lisp/minibuffer.el
> @@ -1191,7 +1191,7 @@ completion--nth-completion
>                                 (error "Invalid completion style %s" style))
>                             string table pred point)))
>                 (and probe (cons probe style))))
> -           (completion--styles md)))
> +           (let ((styles (completion--styles md))) (message "STYLES: %S" styles) styles)))
>
> When I press TAB, it prints:
>
> STYLES: (substring partial-completion basic emacs22)
>
> even though globally, completion-styles is set to its default,
> (basic partial-completion emacs22)

Yes, the the "completion-category-defaults" logic does work, and what
you're seeing is that `completion-category-defaults` (or *-overrides)
when non-nil gets pre-pended to the buffer-local value of
`completion-styles`.


Cheers,

  --alexander





  reply	other threads:[~2022-12-19 16:09 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 18:05 bug#59314: 29.0.50; EUDC and message-mode header completion Eric Abrahamsen
2022-11-16 19:18 ` Thomas Fitzsimmons
2022-11-16 19:46   ` Eric Abrahamsen
2022-11-16 20:54     ` Thomas Fitzsimmons
2022-11-16 22:28       ` Eric Abrahamsen
2022-11-17  1:34         ` Thomas Fitzsimmons
2022-11-17  2:04           ` Eric Abrahamsen
2022-11-17  1:16       ` Eric Abrahamsen
2022-11-17  3:32         ` Thomas Fitzsimmons
2022-11-17  3:28     ` Thomas Fitzsimmons
2022-11-18  4:21       ` Eric Abrahamsen
2022-11-19  7:42         ` Thomas Fitzsimmons
2022-11-22  0:15           ` Eric Abrahamsen
2022-11-22 15:21             ` Thomas Fitzsimmons
2022-11-24  7:24               ` Thomas Fitzsimmons
2022-11-24 22:09                 ` Eric Abrahamsen
2022-11-24  9:53             ` Thomas Fitzsimmons
2022-12-01 15:46     ` Alexander Adolf
2022-12-01 16:02       ` Eric Abrahamsen
2022-12-01 15:48     ` Alexander Adolf
2022-12-01 17:49       ` Eric Abrahamsen
2022-12-02  2:50       ` Thomas Fitzsimmons
2022-12-06 20:40         ` Alexander Adolf
2022-12-06 20:52           ` Thomas Fitzsimmons
2022-12-06 23:29             ` Alexander Adolf
2022-12-07  1:51               ` Thomas Fitzsimmons
2022-12-07  3:14                 ` Thomas Fitzsimmons
2022-12-07 22:10                   ` Alexander Adolf
2022-12-07 22:21                     ` Thomas Fitzsimmons
2022-12-08 22:34                       ` Alexander Adolf
2022-12-08 22:58                         ` Thomas Fitzsimmons
2022-12-10  1:40                           ` Alexander Adolf
2022-12-10 14:27                             ` Thomas Fitzsimmons
2022-12-12 22:10                               ` Alexander Adolf
2022-12-14  1:34                                 ` Thomas Fitzsimmons
2022-12-14 18:07                                   ` Alexander Adolf
2022-12-15  3:32                                     ` Thomas Fitzsimmons
2022-12-19 16:09                                       ` Alexander Adolf [this message]
2022-12-21 17:39                                 ` Thomas Fitzsimmons
2022-12-11 16:08                           ` Alexander Adolf
2022-12-12 12:31                             ` Thomas Fitzsimmons
2022-12-07 22:20                   ` Alexander Adolf
2023-02-11  3:30         ` Thomas Fitzsimmons
2023-01-31 13:04 ` Julien Cubizolles
2023-02-05  0:48   ` Thomas Fitzsimmons

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=3c62ae5a325020cfe7d66168372685d0@condition-alpha.com \
    --to=alexander.adolf@condition-alpha.com \
    --cc=59314@debbugs.gnu.org \
    --cc=eric@ericabrahamsen.net \
    --cc=fitzsim@fitzsim.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.