[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: [PATCH] Add file-ring to dired-aux.el
From: |
Drew Adams |
Subject: |
RE: [External] : Re: [PATCH] Add file-ring to dired-aux.el |
Date: |
Tue, 22 Oct 2024 22:24:17 +0000 |
> Currently copying/moving pops up a window
> "*Marked Files*" where the user can inspect the list
> of files and confirm before starting the process.
> Doing the same could be like the following:
>
> 1. Copy the file names of marked files with 'w'.
> 2. In another dired buffer type 'C-y' (yank)
> like suggested by Drew.
`C-y' in Dired+ also lets you (with a prefix arg) copy
the files to any directory, whether or not it has a
Dired buffer. There's no need limit the use of such
a file-name list to Dired.
And `C-w' in Dired+ moves, instead of copies, the files
whose names you copied with `w'. Again, you can use a
prefix arg to move the files to any directory - the
command isn't limited to use in Dired.
> Then it could pop up the standard window "*Marked Files*"
> and ask for a choice from the list of characters
> using 'map-y-or-n-p' or 'read-answer', e.g.:
>
> (read-answer "Choose what to do with marked files "
> '(("copy" ?c "copy")
> ("move" ?r "move")
> ("symlink" ?s "make symlink")
> ("relsymlink" ?y "make relative symlink")))
Dired+ doesn't have anything particular for symlinking
the copied file names.
If you do that, I suggest you do as I did for copy/move:
let users optionally specify a target directory with
completion, and perform the action even outside of Dired.
___
Overall:
1. Vanilla Dired already has `w' (Eli: not `C-w' or
`M-w' - `w' is as old Emacs 22) to copy the marked
file names.
In Dired+ the command respects option
`diredp-quote-copied-filenames-flag' instead of always
quoting file names that contain SPC, ' or ". And it
uses a separator string defined in a variable, instead
of just a SPC char. By default it's a string with just
a null char ("\0").
2. The string of file names is saved not only on the
kill ring, but also in a variable - you need not dig it
out of the kill ring to use it.
3. For yanking (`C-y'), the clipboard is checked first,
so MS Windows users can use file names copied to the
clipboard using Windows Explorer (or whatever).
4. To be useful for things such as Juri suggests above,
you want the copied names to be _absolute_ file names.
That's what command `diredp-copy-abs-filenames-as-kill'
does, and it's what a 0 numeric prefix arg (e.g. `M-0')
does for `w' (command `dired-copy-filename-as-kill') in
Dired+.
____
(Yes, there could also be register commands to do the
same things...)
Re: [PATCH] Add file-ring to dired-aux.el, Juri Linkov, 2024/10/22