unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Eli Zaretskii <eliz@gnu.org>,
	"mardani29@yahoo.es" <mardani29@yahoo.es>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: [External] : Re: Q: Is there a built-in way to read multiple file names?
Date: Mon, 15 Jul 2024 19:44:11 +0000	[thread overview]
Message-ID: <SJ0PR10MB54883994099841A54393D6DCF3A12@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87o76yiivc.fsf@localhost>

> >> This sounds overengineered. What you describe is an
> >> equivalent of `completing-read' HISTORY argument.
> >
> > No, there's really no relation to any HISTORY
> > argument.  Minibuffer history args record only
> > minibuffer input that you've _entered_ (`RET').
> 
> Sure. But if multi-selection is incorporated into standard APIs, history
> may also hold the information about selected elements, in addition to
> minibuffer input. I do not see a reason to keep it as a completely
> separate structure.

Sorry, not clear to me.  Define "history of selected
elements".

By "selected elements" I assume you mean something
like what we've been discussing: designating/marking
some file names (or more generally any kind of
completion candidates) for use as a group at some
time, particularly at some time other than during
the current act of completing patterns.

Saving such a set of candidates somewhere (register,
variable, file etc.) is what I've been talking about.
You say that that's overkill, and that some notion
of history gives you the same capability.  I don't
see that, and I don't see that you've described it.

For minibuffer input there really is a history
determined by the act of hitting RET at some point.

Likewise, for Icicles selection ("saving") of
candidates.

If your proposed marking is similar then what's the
difference?  The "history" that records the set of
marked candidates needs to be saved somewhere.

Certainly you could save multiple sets of candidates
to the same variable (or register or file etc.).
Perhaps that's what you're suggesting.  E.g., a var
that holds a list of candidate sets instead of just
one.

I didn't do that for Icicles because I didn't see
a need (use case) for it.  Typically, when you want
to retrieve a candidate set later (i.e., to use it
as the current set of "matching completions"), you
don't want to have to cycle through some list of
sets to get the one you want.

You can think of this like saving a minibuffer
pattern, then retrieving it later to use it again,
to get the same set of matching candidates.

But no single pattern would suffice, in general.
You might have (1) used several different patterns,
and possibly (2) used some in sequence (progressive
completion, aka progressive filtering), and (3)
selected (aka marked) among matches during #1 or #2
just some that you actually want to include ("save").

> > 1. `C-x C-f' followed by a pattern...
> > 2. Mark any of those candidates...
> > ...
> > Change your minibuffer pattern...
> > 4. Repeat...
> 
> Yes, makes sense.
> 
> > 6. Hit `C-g' to cancel reading file names.
> 
> Why not <RET>? (I guess simply because icicles builds on top of
> completion, instead of extending it. I am aiming to extend the
> completion/selection UI)

You _can_ certainly hit RET at any time, accepting
the text currently in the minibuffer (which adds
that to the current minibuffer history list).

Until Icicles, that was the _only_ point of a
completion function such as `completing-read': to
get a value that the user chooses.

The point in step #6 (`C-g') was that you don't
_have_ to enter anything - you don't _have_ to end
the call to `completing-read' or whatever at that
point.  You can completion not for a return value
but for performing different actions on candidates.
(One such action is to select some for later use
as a candidate set.)

IOW, you can use completion _not just_ to provide
a value for `read-file-name' or `completing-read',
but also for other purposes.  Those purposes
include (1) discovery - explore the domain of
candidates, (2) see info/help about candidates,
(3) accumulate a selection of candidates, and
(4...) lots more.

This is about #3.  And you can gather candidates
across any number of different acts of completion
(still within the same `completing-read' etc.
call, using any number of different minibuffer
patterns.



  reply	other threads:[~2024-07-15 19:44 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-07  7:22 Q: Is there a built-in way to read multiple file names? Ihor Radchenko
2024-07-07 13:26 ` Daniel Martín
2024-07-07 15:56   ` Ihor Radchenko
2024-07-07 16:03     ` Eli Zaretskii
2024-07-07 17:18       ` Ihor Radchenko
2024-07-07 17:38         ` Eli Zaretskii
2024-07-07 17:47           ` Ihor Radchenko
2024-07-07 17:56             ` Eli Zaretskii
2024-07-07 21:24               ` [External] : " Drew Adams
2024-07-13 13:57                 ` Ihor Radchenko
2024-07-13 18:56                   ` Drew Adams
2024-07-14 12:38                     ` Ihor Radchenko
2024-07-14 17:23                       ` Drew Adams
2024-07-15 18:56                         ` Ihor Radchenko
2024-07-15 19:44                           ` Drew Adams [this message]
2024-07-17 17:21                             ` Ihor Radchenko
2024-07-17 19:49                               ` Drew Adams
2024-07-13 13:43               ` Ihor Radchenko
2024-07-13 13:53                 ` Eli Zaretskii
2024-07-13 14:15                   ` Ihor Radchenko
2024-07-13 14:28                     ` Eli Zaretskii
2024-07-14 12:16                       ` Ihor Radchenko
2024-07-14 13:11                         ` Eli Zaretskii
2024-07-15 18:52                           ` Ihor Radchenko
2024-07-15 19:22                             ` Eli Zaretskii
2024-07-15 19:52                               ` Ihor Radchenko
2024-07-16 10:05                                 ` Eli Zaretskii
2024-07-23 11:13                                   ` Ihor Radchenko
2024-07-23 12:05                                     ` Eli Zaretskii
2024-07-23 16:30                                       ` Ihor Radchenko
2024-07-23 16:35                                         ` Eli Zaretskii
2024-07-23 16:40                                           ` Ihor Radchenko
2024-07-23 17:48                                             ` Eli Zaretskii
2024-07-23 16:02                                     ` Yuri Khan
2024-07-23 17:35                                     ` [External] : " Drew Adams
2024-07-16  5:09                             ` Yuri Khan
2024-07-13 14:19                 ` Thierry Volpiatto
2024-07-13 14:19                   ` Ihor Radchenko
2024-07-08 12:00       ` Max Nikulin
2024-07-13 14:00         ` Ihor Radchenko
2024-07-14  9:00           ` Max Nikulin
2024-07-14 12:33             ` Ihor Radchenko
2024-07-15 12:12               ` Max Nikulin

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=SJ0PR10MB54883994099841A54393D6DCF3A12@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mardani29@yahoo.es \
    --cc=yantar92@posteo.net \
    /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).