From d81dc05258963d88725a684a6fb1d6ee07eaca1f Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sat, 30 Jul 2016 17:26:19 +0900 Subject: [PATCH] Copy just non-empty strings to kill-ring * lisp/dired.el (dired-copy-filename-as-kill): Do not change the kill ring when the string is empty (Bug#24103). --- lisp/dired.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 5d14291d787..7ead0876fc8 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -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)))) ;; Keeping Dired buffers in sync with the filesystem and with each other -- 2.11.4.GIT