From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#48657: Defvar delimiter for dired-copy-filename-as-kill Date: Sun, 24 Oct 2021 00:11:28 -0700 Message-ID: References: <87v97639x9.fsf@gmail.com> <83bl8yboat.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16942"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 48657@debbugs.gnu.org, Rodrigo Morales To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 24 09:12:17 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1meXg1-0004As-AV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 09:12:17 +0200 Original-Received: from localhost ([::1]:34302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meXg0-0002d8-4o for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 03:12:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meXfn-0002LK-30 for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 03:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meXfm-0003r5-OI for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 03:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1meXfm-0004ls-EM for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 03:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 07:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48657 X-GNU-PR-Package: emacs Original-Received: via spool by 48657-submit@debbugs.gnu.org id=B48657.163505949818296 (code B ref 48657); Sun, 24 Oct 2021 07:12:02 +0000 Original-Received: (at 48657) by debbugs.gnu.org; 24 Oct 2021 07:11:38 +0000 Original-Received: from localhost ([127.0.0.1]:37776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meXfO-0004l2-B8 for submit@debbugs.gnu.org; Sun, 24 Oct 2021 03:11:38 -0400 Original-Received: from mail-pj1-f49.google.com ([209.85.216.49]:41829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meXfK-0004kZ-E4 for 48657@debbugs.gnu.org; Sun, 24 Oct 2021 03:11:36 -0400 Original-Received: by mail-pj1-f49.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so6054843pjb.0 for <48657@debbugs.gnu.org>; Sun, 24 Oct 2021 00:11:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=o5rf4VTiHzsUUXQN16NoJWdHNb373DLNu2mhQBcg0H0=; b=ghVXBZ71gn1MmlnBpGx631PLbPHOetvArnjjgVeXq2EFwjQODPy1p/V4yFOY2EnRTa dfwMglIHw50RxW0mKDFJyQPkF+LQ9KIaYXu+4A4WHex5ySqM1hiZoa+YNn9faq3k1J+p iGA6r5yLdRSfOCKw6tFc4OYsA/SWy5ZPcMYMmeRpNxdALew2YvMqpzHoa2BBWwePP4s+ lrTAE8pSnN4B0V+ot9NJ2IACgk1cHJF5+71xyddnse9A27p3+YGjbrxQgACUYIUnzpUb rZ01fSH17RvrAbtmLaOPbUTeBYqpFlWqpNPh/eAzJuzSCLFdaJ1r+MDGyAFSw02CvImV GUNw== X-Gm-Message-State: AOAM533MQlBw9vBO1ywT9uoZgrDOzkGQpB+2etZUnXzSlNDYujbVCcgw dHl8p7uHFYFTFft+P3fHazzE+l02Ez3Q+RFVAcE= X-Google-Smtp-Source: ABdhPJwZMIm5js6HU72DyGZdj1SgKyi3mXit11n02vc/hP3wzIvJ5FGOLEFnPiX/B0UKjrIdzHrDP4BUAb42glfYUnE= X-Received: by 2002:a17:90b:3b86:: with SMTP id pc6mr9309802pjb.143.1635059488845; Sun, 24 Oct 2021 00:11:28 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 24 Oct 2021 00:11:28 -0700 In-Reply-To: <83bl8yboat.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 25 May 2021 22:34:18 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218066 Archived-At: Eli Zaretskii writes: >> From: Rodrigo Morales >> 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?