From c8d307d8cc172673f65502873b65ab91248ad229 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 23 Feb 2012 16:21:19 +0200 Subject: [PATCH] used kill-new instead of temp buffer in prelude-copy-file-name-to-clipboard --- modules/prelude-core.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/prelude-core.el b/modules/prelude-core.el index 8e498e3..1eb269d 100644 --- a/modules/prelude-core.el +++ b/modules/prelude-core.el @@ -175,16 +175,14 @@ the curson at its beginning, according to the current mode." 'display '(left-fringe right-triangle))))))) (defun prelude-copy-file-name-to-clipboard () - "Put the current file name on the clipboard." + "Copy the current buffer file name to the clipboard." (interactive) (let ((filename (if (equal major-mode 'dired-mode) default-directory (buffer-file-name)))) (when filename - (with-temp-buffer - (insert filename) - (clipboard-kill-region (point-min) (point-max))) - (message filename)))) + (kill-new filename) + (message "Copied buffer file name '%s' to the clipboard." filename)))) (defun prelude-duplicate-current-line-or-region (arg) "Duplicates the current line or region ARG times.