From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Emacs ignores modified state of "untitled" buffer Date: Wed, 19 May 2010 08:04:13 -0700 Message-ID: References: <51707DDA-8D52-4D9F-9FD4-461987F2DEDE@nf.mpg.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1274281504 32306 80.91.229.12 (19 May 2010 15:05:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 May 2010 15:05:04 +0000 (UTC) To: "'Stefan Vollmar'" , "'Emacs mailing list'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 19 17:05:01 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OEkpP-0007Xv-Ms for geh-help-gnu-emacs@m.gmane.org; Wed, 19 May 2010 17:05:00 +0200 Original-Received: from localhost ([127.0.0.1]:34850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEkpP-0003ye-6y for geh-help-gnu-emacs@m.gmane.org; Wed, 19 May 2010 11:04:59 -0400 Original-Received: from [140.186.70.92] (port=48930 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEkoy-0003tS-Hn for help-gnu-emacs@gnu.org; Wed, 19 May 2010 11:04:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEkor-00043A-WC for help-gnu-emacs@gnu.org; Wed, 19 May 2010 11:04:32 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:51299) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEkor-00042d-QR for help-gnu-emacs@gnu.org; Wed, 19 May 2010 11:04:25 -0400 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o4JF4KVm015012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 May 2010 15:04:22 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4JELtEX003372; Wed, 19 May 2010 15:04:19 GMT Original-Received: from abhmt008.oracle.com by acsmt353.oracle.com with ESMTP id 250784091274281455; Wed, 19 May 2010 08:04:15 -0700 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 May 2010 08:04:13 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <51707DDA-8D52-4D9F-9FD4-461987F2DEDE@nf.mpg.de> Thread-Index: Acr3Y1JqN4pKYpkIRWGS+A9USi9JdwAAOYrQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4BF3FDF4.0075:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73676 Archived-At: > we have a user who wants to always open Emacs with a new > "untitled" buffer so he can start writing right away without > having to think of a file name first (similar to a "New > Document" feature in Mac and Windows programs). If we try > this in site-start.el: > > (generate-new-buffer "untitled") > (switch-to-buffer "untitled") > > we are almost there - Emacs starts with the new "untitled" > buffer. However, if he then exits Emacs, Emacs does not warn > about a modified buffer and potential data loss, although the > buffer is marked dirty. How can we get the usual behaviour > for this new buffer? The buffer is not associated with a file. Try (find-file "untitled") instead of the code you're using. If you do `C-h k', then choose `File > Visit New File', you'll see that that menu item corresponds to command `find-file'.