]> git.eshelyaron.com Git - emacs.git/commitdiff
Copy just non-empty strings to kill-ring
authorTino Calancha <tino.calancha@gmail.com>
Sat, 30 Jul 2016 08:26:19 +0000 (17:26 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Sat, 30 Jul 2016 08:26:19 +0000 (17:26 +0900)
* lisp/dired.el (dired-copy-filename-as-kill):
Do not change the kill ring when the string is empty (Bug#24103).

lisp/dired.el

index 5d14291d787bede4536686c12ff546bf8d87e559..7ead0876fc802afa2a291ba4d3d071d12fe7fd39 100644 (file)
@@ -2467,10 +2467,11 @@ You can then feed the file name(s) to other commands with \\[yank]."
                                    '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 string nil)
+        (kill-new string))
+      (message "%s" string))))
 
 \f
 ;; Keeping Dired buffers in sync with the filesystem and with each other