From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "A.Politz" Newsgroups: gmane.emacs.help Subject: Re: Is it possible not to quit emacs when buffer is modified? Date: Wed, 19 Aug 2009 21:49:14 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250746916 31710 80.91.229.12 (20 Aug 2009 05:41:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Aug 2009 05:41:56 +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 Aug 20 07:41:50 2009 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.50) id 1Me0PD-0004SG-8V for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 07:41:47 +0200 Original-Received: from localhost ([127.0.0.1]:40627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Me0PC-00084o-4E for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 01:41:46 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g23g2000vbr.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 84.59.121.224 Original-X-Trace: posting.google.com 1250743754 32253 127.0.0.1 (20 Aug 2009 04:49:14 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 20 Aug 2009 04:49:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g23g2000vbr.googlegroups.com; posting-host=84.59.121.224; posting-account=Cb0eCQoAAADOp8Qt5mU0s83Gs6qJzY70 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009061208 Iceweasel/3.0.12 (Debian-3.0.12-1), gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:172127 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:67283 Archived-At: On Aug 20, 2:22=A0am, YOUNG wrote: > Hi, > > If a buffer does not connect to a file but it is modified, if you type > c-x c, emacs just quits and losts the data. > > Is there a way to protect of it? > > Regards, > Youngwhan One way to avoid this is the `buffer-offer-save' variable, e.g like this. (add-hook 'first-change-hook #'(lambda nil ;; set for all 'regular' buffers (unless (string-match "\\`[ *].*[*]\\'" (buffer-name)) (setq buffer-offer-save t)))) -ap