From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Q: Is there a built-in way to read multiple file names? Date: Tue, 16 Jul 2024 13:05:06 +0300 Message-ID: <86cyndire5.fsf@gnu.org> References: <875xthfyz3.fsf@localhost> <87a5it6vr6.fsf@localhost> <86r0c5196r.fsf@gnu.org> <877cdx6ryu.fsf@localhost> <86o77914sh.fsf@gnu.org> <874j916qlv.fsf@localhost> <86ikxh13yc.fsf@gnu.org> <87zfqlpfty.fsf@localhost> <86jzhpjt4x.fsf@gnu.org> <87r0bxpecj.fsf@localhost> <86ikx9jrh4.fsf@gnu.org> <87frscjhhm.fsf@localhost> <8634ocjeze.fsf@gnu.org> <87r0buij3j.fsf@localhost> <86frsaihom.fsf@gnu.org> <878qy2igat.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13309"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mardani29@yahoo.es, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 16 12:06:27 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sTf4l-0003Bb-5E for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Jul 2024 12:06:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTf3z-0006fJ-63; Tue, 16 Jul 2024 06:05:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTf3u-0006eH-HB for emacs-devel@gnu.org; Tue, 16 Jul 2024 06:05:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTf3u-0004D5-5y; Tue, 16 Jul 2024 06:05:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TJatQ4bhnPybqKwqaXmOuqRB5kVJXgPHautLKq5A+J0=; b=UpMo/1QOtZpp nIO+o/OYfqvGhXk5zbY9nV9qHq0kjo4NeLEnRt/X4cmuN7VTo+UsWI452GTnkVlYKtEN7f9ZWcPSb RdZhXQLHD2gW0NStrNDjnMnjACZdiYjqP83FGlhH6DamWv2mKbd54nlIsC5rPnyyfBb2t48WtKSnE VMTnxP1+Yx5XIHpsjsBK8021ZEAnQcPY5oLk75yWWClPgvDr6Y9gex3eoDAwD+h4dM3zSqDUyqh/4 xk1iM4Da2Ta1jvn1uIJaYWSeru96iGOJeqh7YH6IAyPG3s1tA2aAIhGyjyJgppgYqNM90LXv3zmye VRKuJqqb0cO+7MwIsFqTvQ==; In-Reply-To: <878qy2igat.fsf@localhost> (message from Ihor Radchenko on Mon, 15 Jul 2024 19:52:26 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321693 Archived-At: > From: Ihor Radchenko > Cc: mardani29@yahoo.es, emacs-devel@gnu.org > Date: Mon, 15 Jul 2024 19:52:26 +0000 > > Eli Zaretskii writes: > > >> 3. What does not seem to be trivial is selecting multiple files residing > >> in different folders. What do you think should be done to dired to > >> get this? > > > > Why do you need to change anything? It should be possible to mark > > some files, then go to a different directory and mark some more files, > > etc. When the user eventually types "C-c C-c", the list of all the > > selected files in all the directories is returned to the caller. > > How to unmark after you go to a different directory? The same way you mark them? Or maybe I don't understand what difficulties you have in mind. > > An alternative could be for the user to insert another directory into > > the buffer, like 'i' in Dired does. > > 'i' works poorly when the directories contain many files - you get way > too long list of files, potentially with duplicate names, that is a > nighmare to search through. Even with regexps. How is this different from a directory that has a lot of files to begin with? Searching in an Emacs buffer is hardly a problem. At the very least, it's way more convenient than searching a typical GUI file-selection dialog, at least IME. > > . if there are many files, moving too far down will scroll the > > selected files out of view > > Sure. That's literally my concern as well. That's why I suggested to use > completion-based interface rather than dired-based. With completions > window, there is usually no need to scroll - typing in minibuffer is a > lot more efficient to narrow down to the desired file. > > As an alternative, maybe we can list the selected files in the minibuffer? The mini-window is ill-suited for showing long lists, so I'd recommend against that. > > . it is unusual, and so at least some users will be confused > > Any new UI will be unusual. Selecting files from a Dired-like list is non unusual. Both Emacs users and users who come from other GUI applications will feel right at home. > As since we cannot use dired as is (AFAIU), We can't? why not? > introducing something new is simply inevitable. > > Also, I am not sure if it is that much unusual - I replicated my dired > look in the above. With > https://github.com/Fuco1/dired-hacks?tab=readme-ov-file#filter-groups, > it is how dired UI looks like. Example: You miss my point. The unusual part is that the selected files are shown at the beginning of the buffer instead of being left in their original places with an indication that they were selected. > >> Why only to file that _begins_ with a character? Why not also moving to > >> a file that have specific work in its name? regexp? > > > > Because it is unusual and idiosyncratic. By contrast, what I describe > > exists in many selection dialogs, and so will be familiar. > > Yes, it is. Idiosyncratic for Emacs. Just like isearch. > I really see no reason to _not_ allow flexibility we already have in > Emacs and instead trying to mimic the limitations idiosyncatic to > Windows/Mac. What limitations are those? > > But if you want to have selection based on regexps, then Dired has the > > "% m REGEXP" command. So this, too, is already available. > > I was talking about jumping to regexp match. > In any case, isearch should be available, including searching by regexp. Exactly. > Maybe it is good enough? Especially since we may not want to shadow > existing single-letter bindings in dired. If that is the problem (but I don't see why, since most of those bindings are to dired-do-SOMETHING, which are not relevant for selecting files), we can find a solution, like M- or something.