From: Marcin Borkowski <mbork@wmi.amu.edu.pl>
To: "help-gnu-emacs\@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Jump to directory from a *Locate* buffer
Date: Thu, 15 Jan 2015 06:52:33 +0100 [thread overview]
Message-ID: <8761c8io9q.fsf@wmi.amu.edu.pl> (raw)
In-Reply-To: <CAOj2CQSg_8wXtRL=12urqJvWoqw_csui5aH3EFhdoipOu9G6kA@mail.gmail.com>
On 2015-01-15, at 02:14, John Mastro <john.b.mastro@gmail.com> wrote:
> Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:
>> 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.)
>
> If I understand the situation correctly, something like this is all it
> takes.
>
> (defun locate-open-in-dired (file)
> (interactive (list (dired-filename-at-point)))
> (cond ((file-directory-p file)
> (dired file))
> ((file-regular-p file)
> (dired (file-name-directory file)))
> (t
> (error "Not a file: '%s'" file))))
>
> (define-key locate-mode-map (kbd "C-c d") #'locate-open-in-dired)
Looks like it should. Thanks! I'll check it ASAP.
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
prev parent reply other threads:[~2015-01-15 5:52 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
2015-01-15 1:14 ` John Mastro
2015-01-15 5:52 ` Marcin Borkowski [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=8761c8io9q.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).