[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [External] : Re: [PATCH] Add file-ring to dired-aux.el
From: |
Eshel Yaron |
Subject: |
Re: [External] : Re: [PATCH] Add file-ring to dired-aux.el |
Date: |
Mon, 28 Oct 2024 08:16:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Juri,
Juri Linkov <juri@linkov.net> writes:
>> FWIW, I found these ideas and the discussion so far really interesting.
>> I'm experimenting with an implementation of this concept that uses a
>> transient menu to both let you choose an action (copy/move/...) and show
>> you which files you're about to act on.
>
> The standard window "*Marked Files*" better handles a long list of files,
> but if it can't be used, then maybe displaying a truncated list of files
> would be ok.
I think that's right, the transient-based interface works well with
short file name lists, but for longer lists it may not be ideal.
>> As a bonus, this also lets you choose other files to act on or
>> a different target directory.
>
> Selecting files using the minibuffer is much less convenient.
Agreed. Still I think that it's a nice option to have.
>> I'm attaching my current implementation for reference if anybody's
>> interested, as well as a screenshot of the menu that you get by copying
>> some file names in one directory and then invoking a command in another.
>
> Thanks, I tried it out, and everything works nicely.
>
>> ;; Simply mark some files and hit `0 w' to copy their absolute names.
>
> There is more room for improvement to make it more simple.
> Instead of requiring a prefix argument `0 w',
> `w' could be modified to put text properties
> with absolute file names on relative file name strings
> to be available for functions that need absolute file names.
Good idea, that would definitely simplify things.
>> ;; hit `C-y' to invoke `filet'.
>
> Here is the missing keybinding: (keymap-set dired-mode-map "C-y" #'filet)
> since the primary use is for Dired.
>
>> [ :description (lambda () (concat "In directory "
>> (abbreviate-file-name
>> (expand-file-name default-directory))))
>
> Maybe displaying the current directory is helpful for such
> rare cases when it will be used from buffers other than Dired.
> But it's more important to show the source directory name, e.g.
>
> "From directory: ..."
I tend to agree, although as you see in my current implementation
there's no strong assumption that all files come from the same
directory. You could grab just any list of file names, and go copy them
to some directory. But I think you're right that in the common case of
copying from one directory (and perhaps some of its subdirectories),
showing the source directory name would be a nice addition.
>> ("-f" "Files" "--files"
>> :class transient-option :multi-value rest :reader filet-read-files
>> ;; Align value with the next line.
>> :format " %k %d (%v)")
>
> Displaying relative file names looks really bad with a lot of
> "../../../../../..". It would be much nicer to display file names
> relative to the source directory, especially when its name will be
> displayed above.
Right, note that filet-short-name only returns a relative name if it's
shorter than the absolute one, but still it may be better to limit the
number of "../../.." as it can get quite confusing.
Thank you for these suggestions. I'll tweak things accordingly when I
have some time, and let you know how it goes. Feel free to move forward
with Justin's or any other implementation in the meanwhile, of course.
Best,
Eshel
- Re: [PATCH] Add file-ring to dired-aux.el, (continued)
Re: [PATCH] Add file-ring to dired-aux.el, Michael Heerdegen, 2024/10/21
Re: [PATCH] Add file-ring to dired-aux.el, Juri Linkov, 2024/10/22
Re: [PATCH] Add file-ring to dired-aux.el, Justin Fields, 2024/10/21