From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: Jump to directory from a *Locate* buffer Date: Wed, 14 Jan 2015 17:14:01 -0800 Message-ID: References: <87k30phwqe.fsf@wmi.amu.edu.pl> <20150114155022210190670@bob.proulx.com> <87a91kj24i.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1421284481 27374 80.91.229.3 (15 Jan 2015 01:14:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2015 01:14:41 +0000 (UTC) Cc: Marcin Borkowski To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 15 02:14:36 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YBZ19-0000Po-Qr for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Jan 2015 02:14:35 +0100 Original-Received: from localhost ([::1]:48713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBZ19-0004C3-2o for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2015 20:14:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBZ0x-0004Bx-K4 for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 20:14:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBZ0w-0007yu-S6 for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 20:14:23 -0500 Original-Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:56652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBZ0w-0007yo-ND for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 20:14:22 -0500 Original-Received: by mail-oi0-f49.google.com with SMTP id a141so10180582oig.8 for ; Wed, 14 Jan 2015 17:14:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=mHO99N3HkjKsI2601aP1Kq1tr4EjRmo8czoyWIttqmI=; b=b0eMoJTNgxND0PL3XbHDEjJxP/njCnMqweeJTjbASmf4vRLlfUZiIgEOKnnekS7b+2 YPdCVTzfxfZ+kUq/LN9vGHkAn/ul09DGlZeUkGoTG9xX6q1hCCgMJvAX+kGCUgHJi7tQ lCPjEyBs8mC3bFBuEw2TUNM8XYwo6AM4cQbSX0bIdYBQwVyopkIBzpy04QlstYSyyutn /OrK3GG9w8qGvzw2WDG/gmzFDtNQRYs+qSpd7ryXxzmDnQwIzcW/Z2FMeRlcz/fWX2Dw J43RRR/HkiiSKVbFiL7Vj/25Wyx2wvdAQft9Ulh0iUzZMPC70Jxq+2z7mPIOag7s3wMW Sp5A== X-Received: by 10.202.216.9 with SMTP id p9mr4115123oig.94.1421284461870; Wed, 14 Jan 2015 17:14:21 -0800 (PST) Original-Received: by 10.76.12.162 with HTTP; Wed, 14 Jan 2015 17:14:01 -0800 (PST) In-Reply-To: <87a91kj24i.fsf@wmi.amu.edu.pl> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c06::231 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102081 Archived-At: 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) -- john