From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Emacs ignores modified state of "untitled" buffer Date: Thu, 20 May 2010 06:45:08 -0600 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=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1274359584 5736 80.91.229.12 (20 May 2010 12:46:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 May 2010 12:46:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 20 14:46:23 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 1OF58l-0006dY-Ci for geh-help-gnu-emacs@m.gmane.org; Thu, 20 May 2010 14:46:19 +0200 Original-Received: from localhost ([127.0.0.1]:46062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF58k-00070J-TW for geh-help-gnu-emacs@m.gmane.org; Thu, 20 May 2010 08:46:18 -0400 Original-Received: from [140.186.70.92] (port=47829 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF582-0006jl-TD for help-gnu-emacs@gnu.org; Thu, 20 May 2010 08:45:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OF57j-0002Km-DL for help-gnu-emacs@gnu.org; Thu, 20 May 2010 08:45:34 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36992) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF57j-0002KS-7B for help-gnu-emacs@gnu.org; Thu, 20 May 2010 08:45:15 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OF57e-00062B-Az for help-gnu-emacs@gnu.org; Thu, 20 May 2010 14:45:10 +0200 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 May 2010 14:45:10 +0200 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 May 2010 14:45:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) In-Reply-To: <51707DDA-8D52-4D9F-9FD4-461987F2DEDE@nf.mpg.de> 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:73685 Archived-At: Stefan Vollmar wrote: > 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? See switch-to-new-untitled-buffer in http://lists.gnu.org/archive/html/gnu-emacs-sources/2008-09/msg00016.html Here is the Commentary: ;; The switch-to-new-buffer command is like switch-to-buffer, but it ;; generates a new buffer name instead of prompting the user. It sets ;; buffer-offer-save to protect against inadvertant data loss via ;; kill-emacs. And it adds a buffer-local query function to protect ;; against inadvertant data loss via kill-buffer. ;; ;; switch-to-new-scratch-buffer and switch-to-new-untitled buffer are ;; convenience commands, for creating new *scratch* buffers (like Emacs) ;; and new "Untitled" buffers (like other text editors). ;; ;; switch-to-new-buffer is added to the menu bar Buffers menu. -- Kevin Rodgers Denver, Colorado, USA