From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.help Subject: Re: make emacs ask to save modified non-file buffers Date: Mon, 23 Jun 2008 10:48:40 +0200 Message-ID: References: <635b5b5f-398f-44a0-8bf2-873a050696bb@v1g2000pra.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1214210971 13267 80.91.229.12 (23 Jun 2008 08:49:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Jun 2008 08:49:31 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 23 10:50:15 2008 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 1KAhkb-0003o4-19 for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Jun 2008 10:50:13 +0200 Original-Received: from localhost ([127.0.0.1]:55942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAhjl-0001ik-UA for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Jun 2008 04:49:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAhjO-0001iV-GY for help-gnu-emacs@gnu.org; Mon, 23 Jun 2008 04:48:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAhjM-0001i5-NN for help-gnu-emacs@gnu.org; Mon, 23 Jun 2008 04:48:58 -0400 Original-Received: from [199.232.76.173] (port=49041 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAhjM-0001i2-J7 for help-gnu-emacs@gnu.org; Mon, 23 Jun 2008 04:48:56 -0400 Original-Received: from gv-out-0910.google.com ([216.239.58.186]:5379) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KAhjL-0006MO-6Q for help-gnu-emacs@gnu.org; Mon, 23 Jun 2008 04:48:55 -0400 Original-Received: by gv-out-0910.google.com with SMTP id i36so363792gve.17 for ; Mon, 23 Jun 2008 01:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ZBKSiT0+B/Lk8jM+KWlOZk2jCrR+axkUdtSI8wloMWo=; b=ioN03FErqiA8BAk1PnEtI2hKfhw55KfyfZKVVbUsWzN+sLADVl0CyZhT8cH5rm3wPN 9YYLH0+/4q9Yk0p4SeeJRtfcUMgzuMN363EwLhUfCa+U74TH0c3VI0kxe4VDFQSe2sj+ F1FqWYfSf77VCZo0szRA5OmyOr9c0V3YC3iO8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=w6k1AEvunW2OQTX178zCl/PiG10UL741mh/TNToKH82r5JKSJ9th0TMkMSh5njzC7E x0OBV5pE+UFfoyYxwWuvFmItEjo9tCiUydYS3yEjXUUrVWhK3JhYZAR4ZGzI/zrLHa1Y kEHeiRuCpB4iPStp61wan+tLYvXJ6moWfk4m8= Original-Received: by 10.210.16.16 with SMTP id 16mr5587440ebp.41.1214210920359; Mon, 23 Jun 2008 01:48:40 -0700 (PDT) Original-Received: by 10.210.23.12 with HTTP; Mon, 23 Jun 2008 01:48:40 -0700 (PDT) In-Reply-To: <635b5b5f-398f-44a0-8bf2-873a050696bb@v1g2000pra.googlegroups.com> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:55045 Archived-At: On Mon, Jun 23, 2008 at 02:23, Xah wrote: > according to the manual, the var buffer-offer-save will do it only if > the buffer is a visiting buffer. Uh? describe-variable's output for `buffer-offer-save': [...] Non-nil in a buffer means always offer to save buffer on exit. Do so even if the buffer is not visiting a file. <--- ??????? [...] and the Emacs Lisp Reference's entry for `buffer-offer-save': -- Variable: buffer-offer-save This variable, if non-`nil' in a particular buffer, tells `save-buffers-kill-emacs' and `save-some-buffers' (if the second optional argument to that function is `t') to offer to save that buffer, just as they offer to save file-visiting buffers. <--- ??????? The problem here is that `buffer-offer-save' affects the two functions mentioned above (`save-buffers-kill-emacs' and `save-some-buffers'), not `kill-buffer'. As Lennart says, you'll have to use `kill-emacs-hook' or `kill-emacs-query-functions' and add a function to ask the user and save if appropriate. Juanma