GNU bug report logs - #20451
25.0.50; [PATCH] Add prefix argument to `pwd'

Previous Next

Package: emacs;

Reported by: Simen Heggestøyl <simenheg <at> gmail.com>

Date: Tue, 28 Apr 2015 19:51:03 UTC

Severity: wishlist

Tags: patch

Found in version 25.0.50

Done: Simen Heggestøyl <simenheg <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20451 in the body.
You can then email your comments to 20451 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20451; Package emacs. (Tue, 28 Apr 2015 19:51:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simen Heggestøyl <simenheg <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 28 Apr 2015 19:51:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simen Heggestøyl <simenheg <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; [PATCH] Add prefix argument to `pwd'
Date: Tue, 28 Apr 2015 21:50:36 +0200
[Message part 1 (text/plain, inline)]
I often find myself doing `C-u M-x pwd RET', hoping that the current
default directory will be inserted at point, but it doesn't. `pwd'
doesn't currently act on a prefix argument, so why not let it do this?

This matches how `shell-command', and newly also `quick-calc', treat
prefix arguments.


From 56c93aa20b19bebb5cb1afcf3894911355d23e30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg <at> gmail.com>
Date: Tue, 28 Apr 2015 21:25:20 +0200
Subject: [PATCH] * lisp/files.el (pwd):

When called with a prefix argument, insert the current default
directory at point.
---
etc/NEWS      |  3 +++
lisp/files.el | 12 ++++++++----
2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 5046d30..7497652 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 045eeaf..ef6ac7b 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.
-- 
2.1.4
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20451; Package emacs. (Thu, 30 Apr 2015 22:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 20451 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Simen Heggestøyl <simenheg <at> gmail.com>
Cc: 20451 <at> debbugs.gnu.org
Subject: Re: bug#20451: 25.0.50; [PATCH] Add prefix argument to `pwd'
Date: Thu, 30 Apr 2015 18:37:58 -0400
> I often find myself doing `C-u M-x pwd RET', hoping that the current
> default directory will be inserted at point, but it doesn't. `pwd'
> doesn't currently act on a prefix argument, so why not let it do this?
> This matches how `shell-command', and newly also `quick-calc', treat
> prefix arguments.

Looks OK, thank you,


        Stefan




Reply sent to Simen Heggestøyl <simenheg <at> gmail.com>:
You have taken responsibility. (Fri, 01 May 2015 21:29:02 GMT) Full text and rfc822 format available.

Notification sent to Simen Heggestøyl <simenheg <at> gmail.com>:
bug acknowledged by developer. (Fri, 01 May 2015 21:29:02 GMT) Full text and rfc822 format available.

Message #13 received at 20451-done <at> debbugs.gnu.org (full text, mbox):

From: Simen Heggestøyl <simenheg <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 20451-done <at> debbugs.gnu.org
Subject: Re: bug#20451: 25.0.50; [PATCH] Add prefix argument to `pwd'
Date: Fri, 01 May 2015 23:28:05 +0200
[Message part 1 (text/plain, inline)]
On Fri, May 1, 2015 at 12:37 AM, Stefan Monnier 
<monnier <at> iro.umontreal.ca> wrote:
> Looks OK, thank you,

Thanks, landed.

-- Simen
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 30 May 2015 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 81 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.