From: John Mastro <john.b.mastro@gmail.com>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Cc: Marcin Borkowski <mbork@wmi.amu.edu.pl>
Subject: Re: Jump to directory from a *Locate* buffer
Date: Wed, 14 Jan 2015 17:14:01 -0800 [thread overview]
Message-ID: <CAOj2CQSg_8wXtRL=12urqJvWoqw_csui5aH3EFhdoipOu9G6kA@mail.gmail.com> (raw)
In-Reply-To: <87a91kj24i.fsf@wmi.amu.edu.pl>
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)
--
john
next prev parent reply other threads:[~2015-01-15 1:14 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 [this message]
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='CAOj2CQSg_8wXtRL=12urqJvWoqw_csui5aH3EFhdoipOu9G6kA@mail.gmail.com' \
--to=john.b.mastro@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=mbork@wmi.amu.edu.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.
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).