[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use dired to return a file or directory name
From: |
Thorsten Jolitz |
Subject: |
Re: How to use dired to return a file or directory name |
Date: |
Thu, 26 Jun 2014 00:19:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Tim Johnson <tim@akwebsoft.com> 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