unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Rahguzar <rahguzar@zohomail.eu>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Thierry Volpiatto <thievol@posteo.net>,
	 Eli Zaretskii <eliz@gnu.org>,
	mardani29@yahoo.es,  emacs-devel@gnu.org
Subject: Re: Q: Is there a built-in way to read multiple file names?
Date: Sun, 14 Jul 2024 22:29:57 +0200	[thread overview]
Message-ID: <87ikx7ra2i.fsf@zohomail.eu> (raw)
In-Reply-To: <87bk30jguc.fsf@localhost> (Ihor Radchenko's message of "Sun, 14 Jul 2024 12:30:51 +0000")

Hi Ihor,
Ihor Radchenko <yantar92@posteo.net> writes:

> Rahguzar <rahguzar@zohomail.eu> writes:
>
>>> Sure, but I want the same thing to work for non-helm users.
>>> Preferably, without having to write helm-specific/ivy-specific/etc code.
>>
>> If you want a mostly completing-read interface for this task, maybe the
>> function filechooser-read-file-names [1] from my GNU ELPA package
>> filechooser can help you. It uses a group-function to distinguish
>> selected files from the rest. It works pretty well with vertico but I
>> think should work with any UI which supports group-function well. It is
>> entangled with some details of the package so probably not directly
>> useful but I think adapting to an API similar to read-file-name is not
>> too hard and hopefully can help with something similar to serve Org's
>> needs.
>
> Yes, it is quite similar to what I described
>
> 	  ------------- completions -----------------
> 	  [selected files group]
> 	  -rw-r--r--  1 yantar92 yantar92 35151 Jun 25 10:22 COPYING <MARKED>
> 	  [candidates group]
> 	  drwxr-xr-x  8 yantar92 yantar92  4096 Jul 13 16:04 .git
> 	  -rw-r--r--  1 yantar92 yantar92  1044 Jun 25 10:22 .gitignore
> 	  -rw-r--r--  1 yantar92 yantar92    95 Jun 25 10:22 .gitmodules
> 	  ------------------- minibuffer ------------------------
> 	  Choose files: git
>
> I tried using 
>
> (let ((filechooser-filters '(("All" always . t)))
>       (filechooser-use-popup-frame nil))
>   (filechooser-read-file-names "Files: "))
>
> M-TAB selects file.
> I did not find how to remove selected file.

M-TAB on a selected file deselects it. It is basically a toggle.

> The main problem is that it is not built-in, and I would like to get
> something in the core to cater multi-file prompts.

I would like that too, and if something like that is in the core I will
change current implementation to depend on it. I am also happy to try to
upstream the code if that is considered desirable.

> A side note: The usual /old/path/to/file/~/restart/path does not work as expected.

Can you please describe how it doesn't work? It works for me with
vertico. I thought let binding minibuffer-completing-file-name was
enough to get rfn-eshadow to work.

Rahguzar



  reply	other threads:[~2024-07-14 20:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-13 16:28 Q: Is there a built-in way to read multiple file names? Rahguzar
2024-07-14 12:30 ` Ihor Radchenko
2024-07-14 20:29   ` Rahguzar [this message]
2024-07-15 19:09     ` Alternative UI for reading multiple choices (was: Q: Is there a built-in way to read multiple file names?) Ihor Radchenko
2024-07-15 20:02       ` [External] : " Drew Adams
2024-07-15 19:12     ` ELPA package: filechooser " Ihor Radchenko
2024-07-16  8:59       ` ELPA package: filechooser Rahguzar
  -- strict thread matches above, loose matches on Subject: below --
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-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-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=87ikx7ra2i.fsf@zohomail.eu \
    --to=rahguzar@zohomail.eu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mardani29@yahoo.es \
    --cc=thievol@posteo.net \
    --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).