GNU bug report logs - #48657
Defvar delimiter for dired-copy-filename-as-kill

Previous Next

Package: emacs;

Reported by: Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>

Date: Tue, 25 May 2021 19:21:02 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>
To: 48657 <at> debbugs.gnu.org
Subject: bug#48657: Defvar delimiter for dired-copy-filename-as-kill
Date: Tue, 25 May 2021 14:12:02 -0500
I regularly use "dired-copy-filename-as-kill" (by default, it is mapped
to " w") for inserting filenames to the kill ring when being in a dired
buffer.

I'm having the following issue when interacting with filenames that
contain spaces: 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).

#+BEGIN_SRC emacs-lisp
(defun dired-copy-filename-as-kill (&optional arg)
...
             (mapconcat #'identity
                        (if arg
                            (cond ((zerop (prefix-numeric-value arg))
                                   (dired-get-marked-files))
                                  ((consp arg)
                                   (dired-get-marked-files t))
                                  (t
                                   (dired-get-marked-files
				    'no-dir (prefix-numeric-value arg))))
                          (dired-get-marked-files 'no-dir))
                        " ") ;; <---- [[[ Here's the hardcoded delimiter ]]]
...)
#+END_SRC

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

P.S. This is my first time interacting with this mailing list; forgive
me if I did something wrong.




This bug report was last modified 2 years and 306 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.