unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Jump to directory from a *Locate* buffer
Date: Wed, 14 Jan 2015 15:57:20 -0700	[thread overview]
Message-ID: <20150114155022210190670@bob.proulx.com> (raw)
In-Reply-To: <87k30phwqe.fsf@wmi.amu.edu.pl>

Marcin Borkowski wrote:
> imagine that I run M-x locate to find some file, and I want to open
> Dired in the directory one of the found files is in.  Is there a way to
> do it or should I write some Elisp for that?

What I do in that situation, already at the beginning of the file
name, is to C-space to set the mark then C-f to the end of the
directory name.  Then M-w copy to the kill ring.  Then C-x C-f C-y RET
to find-file and yank in the directory and open it in dired mode.

However using locate generates a dired buffer meaning all of those
commands are available too.  The 'w' command copies the filename.  The
0w command copies the full pathname of the file.  Therefore an
alternative could be to 0w on that filename to copy the entire full
pathname to the kill ring.  Then C-x C-f C-y and then DEL or M-DEL to
delete the filename part and then RET when the path is just the
directory name.

I am sure there are other ways too.

Bob



  reply	other threads:[~2015-01-14 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 21:35 Jump to directory from a *Locate* buffer Marcin Borkowski
2015-01-14 22:57 ` Bob Proulx [this message]
2015-01-15  0:53   ` Marcin Borkowski
2015-01-15  1:14     ` John Mastro
2015-01-15  5:52       ` Marcin Borkowski

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=20150114155022210190670@bob.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).