unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Rodrigo Morales <moralesrodrigo1100@gmail.com>,
	"48657@debbugs.gnu.org" <48657@debbugs.gnu.org>
Subject: bug#48657: [External] : bug#48657: Defvar delimiter for dired-copy-filename-as-kill
Date: Tue, 25 May 2021 19:44:13 +0000	[thread overview]
Message-ID: <SA2PR10MB4474A618910E52278406B5D1F3259@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87v97639x9.fsf@gmail.com>

> Because the space is used as the delimiter for the
> copied filenames, it is difficult (nearly impossible) to know the
> beginning and end of the copied filenames.
> 
> I looked at the source code of the function and found that the space
> character is hardcoded as the delimiter (see below)....
> 
> I thought that it would be useful to have a defvar that allows
> specifying the delimiter for copied filenames through the mentioned
> function. Perhaps, its name could be "dired-copy-filename-delimiter".

Yes.  This was reported by a Dired+ user a while back.
Dired+ fixed it this way, FWIW: Added two defvars, and
updated the command to use one as the separator and the
other to hold the text that's copied to the kill ring.

The second defvar is there so you can obtain the text
even after the kill ring is modified.  For example,
command `diredp-yank-files' uses the value of that var,
not whatever is currently at the head of the kill ring.
And `diredp-move-files-named-in-kill-ring' uses it to
move files to the current dir.

(`dired-yank-files' yanks files to a directory.  It
looks first for files via `interprogram-paste-function',
then it looks in that defvar.)
___

(defvar diredp-last-copied-filenames ()
  "String list of file names last copied to the `kill-ring'.
Copying is done by `dired-copy-filename-as-kill' and related commands.")

(defvar diredp-filename-separator (copy-sequence "\000") ; "^@"
  ;; Should contain only chars that are invalid in a file name.
  "String used to separate file names in a `kill-ring' entry.")






      parent reply	other threads:[~2021-05-25 19:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 19:12 bug#48657: Defvar delimiter for dired-copy-filename-as-kill Rodrigo Morales
2021-05-25 19:34 ` Eli Zaretskii
2021-10-24  7:11   ` Stefan Kangas
2021-10-24 12:01     ` Eli Zaretskii
2021-10-24 12:27       ` Stefan Kangas
2021-10-24 14:01         ` Eli Zaretskii
2021-10-24 14:27           ` Stefan Kangas
2022-07-15 10:37             ` Lars Ingebrigtsen
2022-07-15 14:16               ` Drew Adams
2021-05-25 19:44 ` Drew Adams [this message]

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=SA2PR10MB4474A618910E52278406B5D1F3259@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=48657@debbugs.gnu.org \
    --cc=moralesrodrigo1100@gmail.com \
    /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).