From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: How to use dired to return a file or directory name Date: Thu, 26 Jun 2014 00:19:01 +0200 Message-ID: <87tx78y6ne.fsf@gmail.com> References: <20140625215532.GD2131@mail.akwebsoft.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403735047 30760 80.91.229.3 (25 Jun 2014 22:24:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Jun 2014 22:24:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 26 00:24:00 2014 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 1Wzvbj-0007hH-JN for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jun 2014 00:23:59 +0200 Original-Received: from localhost ([::1]:41343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzvbj-0002Cn-48 for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jun 2014 18:23:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzvXK-0005ZD-RT for help-gnu-emacs@gnu.org; Wed, 25 Jun 2014 18:19:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzvXE-00078a-52 for help-gnu-emacs@gnu.org; Wed, 25 Jun 2014 18:19:26 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzvXD-00078R-U8 for help-gnu-emacs@gnu.org; Wed, 25 Jun 2014 18:19:20 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WzvXC-0003r0-5T for help-gnu-emacs@gnu.org; Thu, 26 Jun 2014 00:19:18 +0200 Original-Received: from g231234191.adsl.alicedsl.de ([92.231.234.191]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 Jun 2014 00:19:18 +0200 Original-Received: from tjolitz by g231234191.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 Jun 2014 00:19:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231234191.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:AK/bfsbfP5tb5Syy409whssFkGo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:98400 Archived-At: Tim Johnson writes: > Greetings : > > Using : > GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) > on Ubuntu 12.04 > > I'd like to be able to use dired (or something similar) to > select a directory name or a desktop name. > > 1)Dired shows directories only > Some action or command closes the dired buffer and returns a > selected directory name as a string. > > 2)Dired shows directories and a filtered file list - example > "*.emacs.desktop" and some action or command returns a selected > file name as a string. > > Feel free to point me to URLs or to help commands. Not sure if I understand the question correctly, but inside dired ,----[ C-h f dired-copy-filename-as-kill RET ] | dired-copy-filename-as-kill is an interactive compiled Lisp function | in `dired.el'. | | (dired-copy-filename-as-kill &optional ARG) | | Copy names of marked (or next ARG) files into the kill ring. | The names are separated by a space. | With a zero prefix arg, use the absolute file name of each marked file. | With C-u, use the file name relative to the dired buffer's | `default-directory'. (This still may contain slashes if in a subdirectory.) | | If on a subdir headerline, use absolute subdirname instead; | prefix arg and marked files are ignored in this case. | | You can then feed the file name(s) to other commands with C-y. | | [back] `---- with and without zero prefix arg is very useful, I have it bound to 'w', so I type either 'w' or '0 w' to get file/dir names. -- cheers, Thorsten