GNU bug report logs - #24103
25.1.50; dired-copy-filename-as-kill: Copy just non-empty strings

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Fri, 29 Jul 2016 09:59:01 UTC

Severity: minor

Found in version 25.1.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tino Calancha <tino.calancha <at> gmail.com>
Subject: bug#24103: closed ()
Date: Sat, 30 Jul 2016 08:30:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#24103: 25.1.50; Add white space separator when appending string

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 24103 <at> debbugs.gnu.org.

-- 
24103: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24103
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: 24103-done <at> debbugs.gnu.org
Date: Sat, 30 Jul 2016 17:29:42 +0900 (JST)
Fixed in master branch

[Message part 3 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; Add white space separator when appending string
Date: Fri, 29 Jul 2016 18:57:41 +0900 (JST)
I)
emacs -Q ~
M-: (goto-char (dired-subdir-min)) RET
M-: (dired-goto-next-file) RET
w
;; copied first file name into kill-ring
M-: (dired-next-line 1) RET
C-M-w w
;; This append second file name to the kill-ring.
;; Note that there is no separator between the first/second file name.

II)
emacs -Q ~
M-: (goto-char (dired-subdir-min)) RET
w
;; dir name copied into kill-ring
M-: (goto-char (dired-subdir-max)) RET
w
;; copied '' into kill-ring

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 80e9eb3fc790148a70dbf1da5d12e22681180bee Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Fri, 29 Jul 2016 18:53:38 +0900
Subject: [PATCH] Add white space separator when appending string

* lisp/dired.el (dired-copy-filename-as-kill):
Add white space before string when command is appending.
Copy just non-empty strings (Bug#24103).
---
 lisp/dired.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/dired.el b/lisp/dired.el
index 5d14291..095ab14 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2467,10 +2467,11 @@ dired-copy-filename-as-kill
 				    'no-dir (prefix-numeric-value arg))))
                           (dired-get-marked-files 'no-dir))
                         " "))))
-    (if (eq last-command 'kill-region)
-	(kill-append string nil)
-      (kill-new string))
-    (message "%s" string)))
+    (unless (string= string "")
+      (if (eq last-command 'kill-region)
+          (kill-append (concat " " string) nil)
+        (kill-new string))
+      (message "%s" string))))


 ;; Keeping Dired buffers in sync with the filesystem and with each other
-- 
2.8.1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


GNU Emacs 25.1.50 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
 of 2016-07-28
Repository revision: 4a5b6e621c68172bb69d60fe8a76932f7c779f81



This bug report was last modified 8 years and 293 days ago.

Previous Next


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