[Top][All Lists]

[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 06:52:33 +0100

On 2015-01-15, at 02:14, John Mastro <> wrote:

> Marcin Borkowski <> 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
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

reply via email to

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