From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: drkm Newsgroups: gmane.emacs.devel Subject: with-temp-buffer, insert-file-content and errors Date: Sat, 16 Jul 2005 00:54:45 +0200 Organization: None Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1121468242 27368 80.91.229.2 (15 Jul 2005 22:57:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2005 22:57:22 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 16 00:57:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DtZ7A-0004xc-C9 for ged-emacs-devel@m.gmane.org; Sat, 16 Jul 2005 00:57:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtZ8x-0002zO-L7 for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2005 18:58:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DtZ83-0002fi-Iq for emacs-devel@gnu.org; Fri, 15 Jul 2005 18:57:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DtZ7t-0002bL-9l for emacs-devel@gnu.org; Fri, 15 Jul 2005 18:57:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtZ7t-0002aw-5T for emacs-devel@gnu.org; Fri, 15 Jul 2005 18:57:49 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DtZDh-000103-6l for emacs-devel@gnu.org; Fri, 15 Jul 2005 19:03:49 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DtZ5I-0004oT-O4 for emacs-devel@gnu.org; Sat, 16 Jul 2005 00:55:08 +0200 Original-Received: from 184-238.242.81.adsl.skynet.be ([81.242.238.184]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jul 2005 00:55:08 +0200 Original-Received: from darkman_spam by 184-238.242.81.adsl.skynet.be with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jul 2005 00:55:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 24 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 184-238.242.81.adsl.skynet.be User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:959aCiWMFiVu0Qqwa1y9BW3eQeo= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40966 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40966 Hi If you eval the following: (defun drkm:test () (interactive) (with-temp-buffer (insert-file-contents "/tmp/an-existing-file" t) (insert "To modify the buffer...") (error "Some error"))) and then 'M-x drkm:test ', you'll be prompt for saving or not the " *temp*" buffer, *before* seeing the error (making a function is only to not have the debugger started because using 'C-x C-e'). But because you don't see the error when you are prompted, in some case it may be more difficult to know what you want to response. I guess 'with-temp-buffer' have to be modified to show the error before (or while) 'kill-buffer' prompts the user, isn't it? --drkm