From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Jump to directory from a *Locate* buffer Date: Wed, 14 Jan 2015 15:57:20 -0700 Message-ID: <20150114155022210190670@bob.proulx.com> References: <87k30phwqe.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1421276268 4694 80.91.229.3 (14 Jan 2015 22:57:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Jan 2015 22:57:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 14 23:57:42 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 1YBWsf-0000vX-PK for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2015 23:57:41 +0100 Original-Received: from localhost ([::1]:48447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBWsf-0008LG-3W for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2015 17:57:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBWsR-0008LA-Ft for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 17:57:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBWsM-0007ZF-HG for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 17:57:27 -0500 Original-Received: from joseki.proulx.com ([216.17.153.58]:58731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBWsM-0007Z8-AI for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 17:57:22 -0500 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 2F8B62182B for ; Wed, 14 Jan 2015 15:57:21 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id E6C282DC42; Wed, 14 Jan 2015 15:57:20 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87k30phwqe.fsf@wmi.amu.edu.pl> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 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:102078 Archived-At: 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. I am sure there are other ways too. Bob