all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#48657: Defvar delimiter for dired-copy-filename-as-kill
@ 2021-05-25 19:12 Rodrigo Morales
  2021-05-25 19:34 ` Eli Zaretskii
  2021-05-25 19:44 ` bug#48657: [External] : " Drew Adams
  0 siblings, 2 replies; 10+ messages in thread
From: Rodrigo Morales @ 2021-05-25 19:12 UTC (permalink / raw)
  To: 48657


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.





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

end of thread, other threads:[~2022-07-15 14:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` bug#48657: [External] : " Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.