unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Marcin Borkowski <mbork@wmi.amu.edu.pl>
To: help-gnu-emacs@gnu.org
Subject: Re: Jump to directory from a *Locate* buffer
Date: Thu, 15 Jan 2015 01:53:31 +0100	[thread overview]
Message-ID: <87a91kj24i.fsf@wmi.amu.edu.pl> (raw)
In-Reply-To: <20150114155022210190670@bob.proulx.com>


On 2015-01-14, at 23:57, Bob Proulx <bob@proulx.com> wrote:

> 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.

Thanks, though neither of your ways is very, let's say, "Emacs-ish": you
wouldn't win the Emacs Golf contest with them.  (Neither would I, for
that matter: my usual method is to open a file in the *Locate* list and
then hit C-x C-d RET.)

> I am sure there are other ways too.

Definitely there /should/ be.  And if there are not, someone has to code
them.  (I need this almost on a daily basis, so it's definitely worth
optimizing.)

> Bob

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



  reply	other threads:[~2015-01-15  0:53 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
2015-01-15  0:53   ` Marcin Borkowski [this message]
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=87a91kj24i.fsf@wmi.amu.edu.pl \
    --to=mbork@wmi.amu.edu.pl \
    --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).