help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to put default-directory into kill-ring?


From: Marcin Borkowski
Subject: Re: How to put default-directory into kill-ring?
Date: Fri, 14 Feb 2014 13:41:09 +0100

Dnia 2014-02-12, o godz. 10:14:24
Stefan Monnier <monnier@iro.umontreal.ca> napisaƂ(a):

> >> quite often I want to put some full path to some file (usually
> >> init.el). It would be quite convenient for M-x pwd (or maybe C-u
> >> M-x pwd?) to put its output into the kill ring, which is does not.
> >> So: is there any function to do this? (I can easily write it
> >> myself, but don't want to reinvent the wheel.) If not, could this
> >> be considered a feature request?
> 
> We could provide such a feature, of course.  If you have a good UI for
> it, please tell.

Thanks!

Well, as I wrote: M-x pwd currently does *nothing* with its prefix
argument, and only outputs the default directory in the minibuffer.  So
C-u M-x pwd is basically "wasted".

Another possible use case might be to have my current directory in the
kill ring so that I can `cd' to it in an eshell buffer (assuming I
don't want to open a new one).  Or even in an xterm, for that matter.

> When I need such a thing, I usually use something like C-x C-f
> then copy the part I want, then C-g.

This is not exactly the same, since then I'm stuck with the "~/" prefix
for my home directory, which may or may not be what is wanted.  Also,
in case of us Ido users, this requires one more keypress (it's one more
C-f, so not *that* inconvenient, but still).

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



reply via email to

[Prev in Thread] Current Thread [Next in Thread]