🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87924

find-alternate-buffer shouldn't prompt for confirmation of no filename assoc. w/buffer

#87924
From: Jonathan I. Kamens
Date: Fri, 12 Aug 1994 06:28
40 lines
2458 bytes
In GNU Emacs 19.25.1 of Thu Aug 11 1994 on gza-client1 (sparc-sun-sunos4.1.3)

Kill-buffer only asks the user to confirm killing a modified buffer if
there is a filename associated with it.  Find-alternate-file, however,
asks the user to confirm even if there's no filename associated with
the buffer.  I believe that find-alternate-file should have the same
behavior as kill-buffer.

Here's a fix:

Thu Aug 11 20:03:47 1994  Jonathan I. Kamens  (jik@gza-client1)

        * files.el (find-alternate-file): Use the same semantics as
        kill-buffer for deciding to confirm the killing of a buffer.
        Kill-buffer asks the user to confirm if the buffer has a
        filename and it is modified.  Previously, find-alternate-file
        asked the user to confirm whenever the buffer was modified;
        now, it must also be associated with a filename.

*** files.el	1994/08/11 19:57:12	1.1.1.1
--- files.el	1994/08/11 20:00:32
***************
*** 476,482 ****
  		file-dir (file-name-directory file)))
       (list (read-file-name
  	    "Find alternate file: " file-dir nil nil file-name))))
!   (and (buffer-modified-p)
         ;; (not buffer-read-only)
         (not (yes-or-no-p (format "Buffer %s is modified; kill anyway? "
  				 (buffer-name))))
--- 476,482 ----
  		file-dir (file-name-directory file)))
       (list (read-file-name
  	    "Find alternate file: " file-dir nil nil file-name))))
!   (and (buffer-modified-p) (buffer-file-name)
         ;; (not buffer-read-only)
         (not (yes-or-no-p (format "Buffer %s is modified; kill anyway? "
  				 (buffer-name))))

Jonathan Kamens  |  OpenVision Technologies, Inc.  |   jik@cam.ov.com
Technical Details
Message-ID: <199408120015.UAA10481@gza-client1.aktis.com>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu !asuvax!cs.utexas.edu!usc!nic-nac.CSU.net!charnel.ecst.csuchico.edu!olivea!uunet!cis.ohio-state.edu!cam.ov.COM!jik

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,1881f0a5f7c5b8fd,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-12 07:31:19 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu      !asuvax!cs.utexas.edu!usc!nic-nac.CSU.net!charnel.ecst.csuchico.edu!olivea!uunet!cis.ohio-state.edu!cam.ov.COM!jik
From: jik@cam.ov.COM (Jonathan I. Kamens)
Newsgroups: gnu.emacs.bug
Subject: find-alternate-buffer shouldn't prompt for confirmation of no filename assoc. w/buffer
Date: 12 Aug 1994 02:28:58 -0400
Organization: GNUs Not Usenet
Lines: 41
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <199408120015.UAA10481@gza-client1.aktis.com>