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

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

Re: Jump to directory from a *Locate* buffer


From: Marcin Borkowski
Subject: Re: Jump to directory from a *Locate* buffer
Date: Thu, 15 Jan 2015 01:53:31 +0100

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 via email to

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