From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alex Schroeder Newsgroups: gmane.emacs.devel Subject: Re: [jidanni@deadspam.com: modeline doesn't divulge buffer will go bye bye] Date: Mon, 24 Jun 2002 09:41:02 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <87r8ixazu9.fsf@emacswiki.org> References: <200206201435.g5KEZLF18772@aztec.santafe.edu> <5xu1nxh6o7.fsf@kfs2.cua.dk> <200206221720.g5MHKLj16237@rum.cs.yale.edu> <877kkrw1pz.fsf@emacswiki.org> <200206231812.g5NICiS24452@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1024905246 24743 127.0.0.1 (24 Jun 2002 07:54:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Jun 2002 07:54:06 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17MOfm-0006Qy-00 for ; Mon, 24 Jun 2002 09:54:06 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17MOgo-0003ss-00 for ; Mon, 24 Jun 2002 09:55:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17MOfs-0003Bx-00; Mon, 24 Jun 2002 03:54:12 -0400 Original-Received: from relay03.cablecom.net ([62.2.33.103]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17MOT1-0001Vs-00 for ; Mon, 24 Jun 2002 03:40:55 -0400 Original-Received: from smtp.swissonline.ch (mail-4.swissonline.ch [62.2.32.85]) by relay03.cablecom.net (8.11.6/8.11.4/SOL/AWF/MXRELAY/06072001) with ESMTP id g5O7er910748 for ; Mon, 24 Jun 2002 09:40:53 +0200 (CEST) Original-Received: from confusibombus (dclient217-162-237-245.hispeed.ch [217.162.237.245]) by smtp.swissonline.ch (8.11.6/8.11.6/SMTPSOL/AWF/2002040101) with ESMTP id g5O7equ00881 for ; Mon, 24 Jun 2002 09:40:52 +0200 (MEST) Original-Received: from alex by confusibombus with local (Exim 3.12 #1 (Debian)) id 17MOT8-0000A4-00 for ; Mon, 24 Jun 2002 09:41:02 +0200 Original-To: emacs-devel@gnu.org X-Face: ^BC$`[IcggstLPyen&dqF+b2'zyK#r.mU*'Nms}@&4zw%SJ#5!/7SMVjBS7'lb;QK)|IPU5U'o1'522W4TyzB3Ab*IBo^iw]l4|kUbdZuUDO6=Um-.4IzhNiV'B"@K#jy_(wW|Zbk[34flKY^|PrQ?$u2\fKg^]AY>wOX#H32i In-Reply-To: <200206231812.g5NICiS24452@aztec.santafe.edu> (Richard Stallman's message of "Sun, 23 Jun 2002 12:12:44 -0600 (MDT)") Original-Lines: 41 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.90 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5139 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5139 Richard Stallman writes: > and set a new variable "buffer needs > file", so that Emacs will ask about saving changes (because there is a > file name associated with it), and then when the user hits C-x C-s, > Emacs recognizes that the fil name is still unknown, and asks the user > for it. > > C-x C-s already handles this, but maybe we ought to make C-x s do something > for them. My bad; I was talking about C-x C-c. > Maybe we should do just that -- set the buffer-file-name to > /nonexistingdrive/buffername, > > What is the point in that? Why not just leave it nil? Start emacs -q, create new buffer using C-x b test RET. Type something. Quit using C-x C-c. Emacs quits, your edit is lost. With my fix: Start emacs -q, create new buffer using C-x b test RET. Set file name using M-: (setq buffer-file-name "/nonexistingdrive/buffername"). Type something. Quit using C-x C-c. Emacs asks: "Save file /nonexistingdrive/buffername? (y, n, !, ., q, C-r or C-h)". I think this is the kind of behaviour users expect. Emacs will not discard their edits, unless they are typing at a temporary buffer -- and those are buffers with names starting and ending with an asterix. Obviously my idea leads to a weird prompt. Perhaps using (setq buffer-file-name (buffer-name (current-buffer))) is better. I just tried it and the prompt looks great. Perhaps fixing save-buffers-kill-emacs and friends is better. Perhaps what I want is that C-x b with a nonexisting buffer is equivalent to C-x C-f with that name. I do not know. Alex. -- http://www.electronicintifada.net/diaries/index.html http://www.us-israel.org/jsource/US-Israel/hr2506c.html