From: Simen Heggestøyl Date: Fri, 1 May 2015 21:24:10 +0000 (+0200) Subject: * lisp/files.el (pwd): X-Git-Tag: emacs-25.0.90~2229^2~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a58c6cb5288ed9357cc54d4bb1f95f1fcd286eb6;p=emacs.git * lisp/files.el (pwd): When called with a prefix argument, insert the current default directory at point. --- diff --git a/etc/NEWS b/etc/NEWS index 5046d300d45..74976527d6f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -817,6 +817,9 @@ name. The variable `system-name' is now obsolete. +++ ** Function `write-region' no longer outputs "Wrote FILE" in batch mode. +** If `pwd' is called with a prefix argument, insert the current default +directory at point. + --- ** New utilities in subr-x.el: *** New macros `if-let' and `when-let' allow defining bindings and to diff --git a/lisp/files.el b/lisp/files.el index 045eeaf154c..ef6ac7b8c92 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -654,10 +654,14 @@ the value of `default-directory'." 'file-directory-p)) -(defun pwd () - "Show the current default directory." - (interactive nil) - (message "Directory %s" default-directory)) +(defun pwd (&optional insert) + "Show the current default directory. +With prefix argument INSERT, insert the current default directory +at point instead." + (interactive "P") + (if insert + (insert default-directory) + (message "Directory %s" default-directory))) (defvar cd-path nil "Value of the CDPATH environment variable, as a list.