unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: A patch for `pwd' - copying the current directory to the kill ring
Date: Thu, 25 Jan 2018 22:47:32 +0700	[thread overview]
Message-ID: <CAP_d_8VFTy6ShdUupGgywyNjAc_3K4C4RuoUb5hAmJcUtQh7CA@mail.gmail.com> (raw)
In-Reply-To: <871sieozdg.fsf@mbork.pl>

On Thu, Jan 25, 2018 at 8:13 PM, Marcin Borkowski <mbork@mbork.pl> wrote:

> from time to time I have a need to insert the current directory name
> somewhere.  Some time ago, I submitted a bug report suggesting that C-u
> M-x pwd could insert the current dir at point.  Someone made that patch
> a few years ago, and that is great.  However, it is not enough:
> sometimes I want to be able to yank this dir to some other application
> (usually the terminal - I want to cd to that dir).  I made a simple
> patch that makes `pwd' copy the current dir to the kill ring (and - by
> default - to the system clipboard) if prefixed with C-u C-u.  I attach
> the patch.  WDYT?

Long ago, on a different OS, I used a file manager that had a
relatively easy key to copy the full path to the currently selected
file(s) to clipboard.

It was crazy efficient, to the point that I hated programs that used
the system-provided “select a directory” dialog box without letting me
paste a path in there.

In that file manager, if I were editing a file and needed its
containing directory’s path, I’d press Ctrl+F10 (to jump to its
directory in a file panel), then Backspace (go to parent directory),
then Alt+Shift+Ins (to copy the full path of the selected file, which
now happens to be the original file’s containing directory).

In Emacs, this translates to two ‘dired-jump’s (which I have bound to
M-S-up) followed by ‘dired-copy-filename-as-kill’ with a zero argument
(easily accessible with 0 w). Alternatively, dired-jump
beginning-of-buffer dired-copy-filename-as-kill (M-S-up M-< w) also
works.



      parent reply	other threads:[~2018-01-25 15:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 13:13 A patch for `pwd' - copying the current directory to the kill ring Marcin Borkowski
2018-01-25 13:44 ` Kaushal Modi
2018-01-25 14:36   ` Stefan Monnier
2018-01-25 20:13     ` Stefan Monnier
2018-01-25 23:05       ` Richard Copley
2018-01-25 23:23         ` Stefan Monnier
2018-02-01 21:11           ` Marcin Borkowski
2018-02-01 22:03             ` Alexis
2018-02-02  1:59             ` Stefan Monnier
2018-02-02  8:51               ` Eli Zaretskii
2018-02-02 17:29                 ` Stefan Monnier
2018-02-03  0:02                   ` Richard Copley
2018-02-02 23:59                 ` Richard Copley
2018-02-06 21:03               ` Marcin Borkowski
2018-01-26  7:55       ` Eli Zaretskii
2018-01-26 14:40         ` Stefan Monnier
2018-01-26 15:40           ` Eli Zaretskii
2018-02-01 21:09     ` Marcin Borkowski
2018-02-01 21:08   ` Marcin Borkowski
2018-01-25 15:47 ` Yuri Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8VFTy6ShdUupGgywyNjAc_3K4C4RuoUb5hAmJcUtQh7CA@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=mbork@mbork.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).