unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [PATCH] Add file-ring to dired-aux.el
@ 2024-10-21 15:05 Justin Fields
  2024-10-21 17:47 ` [External] : " Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Justin Fields @ 2024-10-21 15:05 UTC (permalink / raw)
  To: michael_heerdegen@web.de, emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

> ​I would like to know about typical use cases.  How is this better than
> just invoking actions directly from another dired buffer?  Does it make
> what one might want to do when multiple buffers are involved more
> convenient?  How?

Hi there,

You can see some of our discussion on the use case on my MELPA PR:
https://github.com/melpa/melpa/pull/9207

But, to summarize, the general idea is that you capture files into the list, in which you can perform actions with them LATER. This also forgoes the need
of having multiple visible dired buffers present in the first place.

Furthermore, this allows for more explicit behavior of these actions in the event of having more than two dired buffers present on the frame
at once. This also means that you do not have to rely on the implicit behavior or dired-dwim-target (which requires cycling actions, if the
implied directory is not the intended one).

Lastly, this allows for the user to perform these actions, multiple times. (In the case of the symlink, symlink-relative, and copy functions)
As in, they can copy the captured files into one buffer, then move to another buffer and copy the same set again. So on, an so forth.


[-- Attachment #2: Type: text/html, Size: 5108 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [External] : Re: [PATCH] Add file-ring to dired-aux.el
  2024-10-21 15:05 [PATCH] Add file-ring to dired-aux.el Justin Fields
@ 2024-10-21 17:47 ` Drew Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2024-10-21 17:47 UTC (permalink / raw)
  To: Justin Fields, michael_heerdegen@web.de, emacs-devel@gnu.org

FWIW -

With Dired+ you can use:

* `M-0 w' to copy the absolute names of the marked files
  and dirs to the kill ring.  (Enhanced version of the
  standard `w'.)
  
   . `M-0' uses absolute names
   . `C-u' uses names relative to `default-directory'.

* `C-y' to yank (copy) those files (or another such
  filename list) into another Dired buffer.
  
   . Non-negative prefix arg prompts for target directory.
   . Non-positive prefix arg lists the files with
     details if you hit `l' when asked to confirm.

That is, `C-y' copies the files to the directory of the
current listing (maybe a subdir listing) in a Dired buffer.
With a non-negative prefix arg you're instead prompted for
the directory, with completion.  This is better than
`dired-dwim-target' etc.

This is the prompt to confirm yanking:

 Yank files whose names you copied?  (y or n; l to show file list)

`l' at the prompt lists the absolute filenames, by default.
But if you use a non-positive prefix arg with `C-y' then
`l' also lists the file attributes specified by option
`diredp-list-file-attributes'.  By default, that option
shows the permissions and time of last modification.
_______

https://www.emacswiki.org/emacs/download/dired%2b.el
_______


-- Doc strings ----------------

w runs the command dired-copy-filename-as-kill (found in
dired-mode-map), which is an interactive Lisp closure in ‘dired+.el’.

It is bound to w, menu-bar operate kill-ring.

(dired-copy-filename-as-kill &optional ARG)

Copy names of marked (or next ARG) files into the kill ring.
Multiple file names are separated by the value of variable
`diredp-filename-separator'.

When multiple names are copied, those with space or quotes (', ") are
enclosed in double-quote chars if option
`diredp-quote-copied-filenames-flag' is non-nil.

With a zero prefix arg, use the absolute file name of each marked file.
With C-u, use the file name relative to the Dired buffer's
`default-directory'.  (This still may contain slashes if in a subdirectory.)

If on a subdir headerline, use absolute subdir name instead;
prefix arg and marked files are ignored in this case.

You can then feed the file name(s) to other commands with M-x yank.

The value of global variable `diredp-last-copied-filenames' is updated
to the string list of file name(s), so you can obtain it even after
the kill ring is modified.
_______



C-y runs the command diredp-yank-files (found in dired-mode-map),
which is an interactive Lisp closure in ‘dired+.el’.

It is bound to C-y, menu-bar subdir diredp-yank-files.

(diredp-yank-files &optional DIR NO-CONFIRM-P DETAILS)

Yank (paste) files to the current directory.
With a non-negative prefix arg you are instead prompted for the target
 directory.
With a non-positive prefix arg you can see details about the files if
 you hit `l' when prompted to confirm pasting.  Otherwise you see only
 the file names.  The details you see are defined by option
 `diredp-list-file-attributes'.

The absolute names of the files to be yanked are taken from the
clipboard or, if that's empty, from names you've copied to the kill
ring using `M-0 w' or M-x diredp-copy-abs-filenames-as-kill.

Those copy-filename commands also:
 * Use the value of option `diredp-filename-separator' to separate the
   copied file names.
 * Set variable `diredp-last-copied-filenames' to the same string.
   `diredp-yank-files' uses the value of that variable, not whatever
   is currently at the head of the kill ring.

(To copy file names to the clipboard on MS Windows, you can use Windows
Explorer: Select the file names, then hold `Shift', right-click, and
choose `Copy as Path' from the menu.)

When called from Lisp:

Optional arg NO-CONFIRM-P means do not ask for confirmation to copy.
Optional arg DETAILS is passed to `diredp-y-or-n-files-p'.
_______



diredp-filename-separator is a variable defined in `dired+.el'.

Its value is "\0"

Documentation:
String used to separate file names in a `kill-ring' entry.
_______



diredp-quote-copied-filenames-flag is a variable defined in `dired+.el'.

Its value is t

Documentation:
Non-nil means w double-quotes file names containing SPC, ', or ".

You can customize this variable.
_______



diredp-list-file-attributes is a variable defined in `dired+.el'.

Its value is (5 8)

Documentation:
Which file attributes `diredp-list-file' uses, and when.
A list of file attribute numbers means use only the values of those
attributes.
A non-list means use all attribute values.

You can customize this variable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-21 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 15:05 [PATCH] Add file-ring to dired-aux.el Justin Fields
2024-10-21 17:47 ` [External] : " Drew Adams

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).