🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87936

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

#87936
From: Jonathan I. Kamens
Date: Sat, 13 Aug 1994 03:24
40 lines
2455 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: <9408130237.AA16804@sunshine>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu !asuvax!cs.utexas.edu!swrinde!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!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
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-13 06:21:37 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu      !asuvax!cs.utexas.edu!swrinde!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!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 23:24:22 -0400
Organization: GNUs Not Usenet
Lines: 43
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9408130237.AA16804@sunshine>