aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/files.el12
2 files changed, 11 insertions, 4 deletions
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.
817+++ 817+++
818** Function `write-region' no longer outputs "Wrote FILE" in batch mode. 818** Function `write-region' no longer outputs "Wrote FILE" in batch mode.
819 819
820** If `pwd' is called with a prefix argument, insert the current default
821directory at point.
822
820--- 823---
821** New utilities in subr-x.el: 824** New utilities in subr-x.el:
822*** New macros `if-let' and `when-let' allow defining bindings and to 825*** 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'."
654 'file-directory-p)) 654 'file-directory-p))
655 655
656 656
657(defun pwd () 657(defun pwd (&optional insert)
658 "Show the current default directory." 658 "Show the current default directory.
659 (interactive nil) 659With prefix argument INSERT, insert the current default directory
660 (message "Directory %s" default-directory)) 660at point instead."
661 (interactive "P")
662 (if insert
663 (insert default-directory)
664 (message "Directory %s" default-directory)))
661 665
662(defvar cd-path nil 666(defvar cd-path nil
663 "Value of the CDPATH environment variable, as a list. 667 "Value of the CDPATH environment variable, as a list.