unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Matthew Leach <matthew@mattleach.net>,
	19032@debbugs.gnu.org, Ole Laursen <olau@iola.dk>
Subject: bug#19032: 24.4; icomplete cannot select matches with C-x b with no input
Date: Thu, 13 Aug 2020 09:43:41 -0400	[thread overview]
Message-ID: <jwva6yyk6ls.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <874kp6hotd.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 13 Aug 2020 11:34:22 +0200")

> +(defvar completion-use-stored-completions-when-no-input nil)
>  (defvar completion-fail-discreetly nil
>    "If non-nil, stay quiet when there  is no match.")
> @@ -1510,8 +1511,15 @@ completion--complete-and-exit
>  COMPLETION-FUNCTION is called if the current buffer's content does not
>  appear to be a match."
>      (cond
> -     ;; Allow user to specify null string
> -   ((= beg end) (funcall exit-function))
> +     ;; Allow user to specify null string.  In the case that
> +     ;; `completion-use-stored-completions-when-no-input' is t, use
> +     ;; the car of `completion-all-sorted-completions' as the
> +     ;; candidate.
> +     ((= beg end)
> +      (when completion-use-stored-completions-when-no-input
> +        (completion--replace beg end (car completion-all-sorted-completions)))
> +      (funcall exit-function))

Would it be cleaner to have the following instead?

      ;; Allow user to specify null string.  Obey `completion-content-when-empty`.
      ((= beg end)
       (when completion-content-when-empty
         (completion--replace beg end completion-content-when-empty))
       (funcall exit-function))

So icomplete would be in charge of setting that var to the `car` of
`completion-all-sorted-completions`.


        Stefan






  parent reply	other threads:[~2020-08-13 13:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 12:31 bug#19032: 24.4; icomplete cannot select matches with C-x b with no input Ole Laursen
2014-11-15 23:08 ` Matthew Leach
2020-08-13  9:34   ` Lars Ingebrigtsen
2020-08-13 10:00     ` Ole Laursen
2020-08-13 13:43     ` Stefan Monnier [this message]
2020-08-14 11:03       ` Lars Ingebrigtsen
2020-08-14 11:30         ` Lars Ingebrigtsen
2020-08-14 12:33           ` Ole Laursen
2020-08-14 12:35             ` Lars Ingebrigtsen
2020-08-18 18:00           ` Matthew Leach

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=jwva6yyk6ls.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=19032@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=matthew@mattleach.net \
    --cc=olau@iola.dk \
    /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).