>From bffb831838f16182fe4e26629c0c6b85ffe98419 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Thu, 25 Jan 2018 14:06:41 +0100 Subject: [PATCH] Make pwd copy current dir to kill ring when run with C-u C-u --- lisp/files.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 7194b56fef..0ebc7b5b9d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -714,14 +714,16 @@ read-directory-name 'file-directory-p)) -(defun pwd (&optional insert) - "Show the current default directory. -With prefix argument INSERT, insert the current default directory -at point instead." +(defun pwd (&optional arg) + "Show the current default directory. With \\[universal-argument], insert +the current default directory at point instead. With \\[universal-argument] \\[universal-argument], +show the current default directory and put it in the kill ring." (interactive "P") - (if insert + (if (equal arg '(4)) (insert default-directory) - (message "Directory %s" default-directory))) + (message "Directory %s" default-directory) + (when (equal arg '(16)) + (kill-new default-directory)))) (defvar cd-path nil "Value of the CDPATH environment variable, as a list. -- 2.15.1