unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* 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 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

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).