* RE: dired in one buffer
@ 2006-08-16 16:19 Jay Bingham
2006-08-18 23:18 ` Drew Adams
0 siblings, 1 reply; 12+ messages in thread
From: Jay Bingham @ 2006-08-16 16:19 UTC (permalink / raw)
On Wednesday, August 16, 2006 4:53 AM henning wrote:
> I would like dired to stay in the same buffer, e.g. when I go up
> one directory I would like the present buffer to just clear and
> be replaced by the content in the parent folder instead of
> opening a new buffer. If find it quite annoying to have a stack
> of dired buffers open after looking around in the directory
> tree... Does anyone know how to implement that? Or am I missing
> something?
Missing something. :-)
The functionality is mostly already present in emacs. The function
dired-find-alternate-file (normally assigned to the 'a' key in dired-
mode) replaces the current buffer (the dired buffer) with the
file/directory that the cursor is on. When the function exits the
dired buffer containing the original directory has been killed and
the active buffer contains the file/directory that was opened.
Going down in the directory tree is intuitive. Going up the
directory tree requires that the cursor be on the '..' entry in the
dired buffer.
If you are used to using the '^' to navigate up the directory tree
then you will either need to retrain yourself or will need to do some
elisp programing to attach the functionality to the '^' key. I
looked at the function dired-up-directory (in dired.el) which is
associated with the '^' key, it does not look like it would be too
difficult to create your own function based on it and assign it to
the '^' key in dired mode.
Good luck,
__
J_)
C_)ingham
_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: dired in one buffer
2006-08-16 16:19 dired in one buffer Jay Bingham
@ 2006-08-18 23:18 ` Drew Adams
2006-08-20 8:24 ` Dieter Wilhelm
0 siblings, 1 reply; 12+ messages in thread
From: Drew Adams @ 2006-08-18 23:18 UTC (permalink / raw)
dired-find-alternate-file (normally assigned to the 'a' key in dired-
mode) replaces the current buffer (the dired buffer) with the
file/directory that the cursor is on.
Just thought I'd mention that you can also use `C-x C-v' to do this. Instead
of substituting the file or directory where the cursor is, it prompts you
for the file or directory name.
With a long directory listing (many files), when your cursor is not
necessarily near the file or directory you want to visit, it can be quicker
to use `C-x C-v', especially since you can use completion to provide the
name.
I would never bother to make an alternate-directory substitute command to
replace `^', for instance, because it is quick enough to do `C-x C-v' and
use, say, `M-DEL' (in the minibuffer) to remove the last directory
component. And I probably use `C-x C-v' more in Dired than anywhere else,
because although I often want several file buffers (visible or not), I don't
as often want multiple Dired buffers.
People use Emacs differently, but I find that my cursor in Dired is usually
not where I need it to be for this kind of thing (`a').
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: dired in one buffer
2006-08-18 23:18 ` Drew Adams
@ 2006-08-20 8:24 ` Dieter Wilhelm
2006-08-20 19:26 ` Drew Adams
0 siblings, 1 reply; 12+ messages in thread
From: Dieter Wilhelm @ 2006-08-20 8:24 UTC (permalink / raw)
Cc: help-gnu-emacs
"Drew Adams" <drew.adams@oracle.com> writes:
> dired-find-alternate-file (normally assigned to the 'a' key in dired-
> mode) replaces the current buffer (the dired buffer) with the
> file/directory that the cursor is on.
>
> Just thought I'd mention that you can also use `C-x C-v' to do this. Instead
> of substituting the file or directory where the cursor is, it prompts you
> for the file or directory name.
^^^^^^^^^^^^^^
It escaped my imagination that `C-x C-v' also can be used in dired for
replacing the directory listing. Thank you for mentioning this.
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: dired in one buffer
2006-08-20 8:24 ` Dieter Wilhelm
@ 2006-08-20 19:26 ` Drew Adams
0 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2006-08-20 19:26 UTC (permalink / raw)
> Just thought I'd mention that you can also use `C-x C-v' to
> do this. Instead of substituting the file or directory where
> the cursor is, it prompts you for the file or directory name.
^^^^^^^^^^^^^^
It escaped my imagination that `C-x C-v' also can be used in dired for
replacing the directory listing. Thank you for mentioning this.
Yes, sometimes it helps to take a step back and try stuff you might assume
would not work (as they say, "think out of the box"). Emacs is full of
surprises like this - I wish I had a dollar for every time Emacs surprised
me with something that I wouldn't have thought possible.
The first time I saw Emacs tags in action, for example, it blew my mind.
That was many moon ago, but I had simply never thought of such a
possibility. Likewise, the idea that ordinary keys (e.g. `a', `b') would run
a command (`self-insert-command') just to get themselves inserted in a
buffer. Emacs is a wondrous toy, indeed.
The problem, of course, is that we quickly get into habits, and that can
work against exploration and discovery.
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: dired in one buffer
@ 2006-08-16 11:06 Bourgneuf Francois
0 siblings, 0 replies; 12+ messages in thread
From: Bourgneuf Francois @ 2006-08-16 11:06 UTC (permalink / raw)
I have put this in my .emacs.
There's an other solution, type "a" instead of Enter to visit a directory (or a file).
(defun dired-follow-file ()
"In dired, visit the file or directory on this line.
If a directory is on the current line, replace the current Dired buffer with one containing the contents of the directory. Otherwise, invoke `dired-find-file' on the file."
(interactive)
(let ((filename (dired-get-filename)))
(if (file-directory-p filename)
(find-alternate-file filename)
(dired-find-file))))
(defun dired-setup-follow-file ()
(substitute-key-definition
'dired-find-file 'dired-follow-file dired-mode-map)
(substitute-key-definition
'dired-advertised-find-file 'dired-follow-file dired-mode-map)) (add-hook 'dired-mode-hook 'dired-setup-follow-file)
Bour9
-----Message d'origine-----
De : help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.fr@gnu.org [mailto:help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.fr@gnu.org] De la part de Peter Dyballa
Envoyé : mercredi 16 août 2006 12:41
À : henning
Cc : Help-gnu-emacs@gnu.org
Objet : Re: dired in one buffer
Am 16.08.2006 um 11:53 schrieb henning:
> Or am I missing something?
C-x k to kill the buffer? or C-x b to first re-enter that obsolete
buffer?
You could bind a kill-buffer action to pressing/choosing .. or any
other entry of type directory. Maybe dired-x allows things like this.
Could be you also miss that warm and very happy feeling of being glad
that this particular directory is still in the list of buffers.
--
Mit friedvollen Grüßen
Pete
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning."
-- Rich Cook
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <mailman.5219.1155721985.9609.help-gnu-emacs@gnu.org>]
* dired in one buffer
@ 2006-08-16 9:53 henning
2006-08-16 10:41 ` Peter Dyballa
0 siblings, 1 reply; 12+ messages in thread
From: henning @ 2006-08-16 9:53 UTC (permalink / raw)
I would like dired to stay in the same buffer, e.g. when I go up one
directory I would like the present buffer to just clear and be replaced by
the content in the parent folder instead of opening a new buffer. If find it
quite annoying to have a stack of dired buffers open after looking around in
the directory tree... Does anyone know how to implement that? Or am I
missing something?
Cheers
--
View this message in context: http://www.nabble.com/dired-in-one-buffer-tf2114297.html#a5829567
Sent from the Emacs - Help forum at Nabble.com.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: dired in one buffer
2006-08-16 9:53 henning
@ 2006-08-16 10:41 ` Peter Dyballa
0 siblings, 0 replies; 12+ messages in thread
From: Peter Dyballa @ 2006-08-16 10:41 UTC (permalink / raw)
Cc: Help-gnu-emacs
Am 16.08.2006 um 11:53 schrieb henning:
> Or am I missing something?
C-x k to kill the buffer? or C-x b to first re-enter that obsolete
buffer?
You could bind a kill-buffer action to pressing/choosing .. or any
other entry of type directory. Maybe dired-x allows things like this.
Could be you also miss that warm and very happy feeling of being glad
that this particular directory is still in the list of buffers.
--
Mit friedvollen Grüßen
Pete
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning."
-- Rich Cook
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-08-20 19:26 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-16 16:19 dired in one buffer Jay Bingham
2006-08-18 23:18 ` Drew Adams
2006-08-20 8:24 ` Dieter Wilhelm
2006-08-20 19:26 ` Drew Adams
-- strict thread matches above, loose matches on Subject: below --
2006-08-16 11:06 Bourgneuf Francois
[not found] <mailman.5219.1155721985.9609.help-gnu-emacs@gnu.org>
2006-08-16 10:09 ` Johan Bockgård
2006-08-16 10:44 ` Torsten Mueller
2006-08-18 8:37 ` henning
[not found] ` <mailman.5319.1155906765.9609.help-gnu-emacs@gnu.org>
2006-08-18 13:32 ` Torsten Mueller
2006-08-16 11:57 ` robert.thorpe
2006-08-16 9:53 henning
2006-08-16 10:41 ` Peter Dyballa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).