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


Message #14 received at 48657 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 48657 <at> debbugs.gnu.org, Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>
Subject: Re: bug#48657: Defvar delimiter for dired-copy-filename-as-kill
Date: Sun, 24 Oct 2021 00:11:28 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Rodrigo Morales <moralesrodrigo1100 <at> gmail.com>
>> Date: Tue, 25 May 2021 14:12:02 -0500
>>
>> (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".
>
> The only sane value for a reliable delimiter is the null byte, so
> maybe it doesn't make much sense to customize it.

That's true, but on the other hand replacing space with the null byte as
the hard-coded delimiter for dired-copy-filename-as-kill seems a
bit... clunky.  Even if space sometimes fails, it is not a control
character, which is why I assume that it was chosen.

I've personally never had a problem with using space here, but you
obviously will eventually run into problems.  So I think something
should be done.

I was thinking for a while about allowing a user to set the delimiter
with a prefix command, but then I realized that users might be using
this function *a lot* (I do sometimes) and that UI would quickly get
old.

So perhaps we should just provide the asked for defvar?




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.