🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98816

find-alternate-file to same dired buffer kills buffer

#98816
From: Sebastian Kremer
Date: Tue, 05 Mar 1991 12:17
32 lines
1813 bytes
[Emacs 18.55, 18.57]

Type `C-x C-v RET' in a dired buffer, that is find-alternate-file to
the same dired buffer.  This kills the buffer instead of giving me a
fresh dired buffer for the same directory.  (It happens both with
18.55 dired.el and my own tree dired.)

I think the bug is in find-alternate-file.  In the final statement
where it says

	(kill-buffer obuf)

it should instead say

    	(or (eq obuf (current-buffer))
	    (kill-buffer obuf))

This is necessary because dired-noselect returns the old buffer
regardless of buffer-file-name, in contrast to find-file-noselect
returning a fresh buffer after find-alternate-file sets
buffer-file-name to nil.  (Dired uses dired-directory to record the
directory or wildcards for the dired buffer and does not touch or care
about buffer-file-name.)

BTW, `C-x C-v RET' on a plain file works fine, it revisits the file,
though judging from the prompt I would expect to dired its directory.
I think (interactive "F...") defaults to the current buffer's name,
even if the prompt does not indicate this.


Sebastian Kremer <sk@thp.Uni-Koeln.DE>
Institute of Theoretical Physics, University of Cologne, F. R. of Germany
Technical Details
Message-ID: <9103051217.AA13528@sun0.thp.Uni-Koeln.DE>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,8ef0656f4b12b680,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-03-05 04:17:59 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage
From: sk@thp.uni-koeln.de (Sebastian Kremer)
Newsgroups: gnu.emacs.bug
Subject: find-alternate-file to same dired buffer kills buffer
Message-ID: <9103051217.AA13528@sun0.thp.Uni-Koeln.DE>
Date: 5 Mar 91 12:17:59 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 32
Approved: bug-gnu-emacs@prep.ai.mit.edu