From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tak Ota Newsgroups: gmane.emacs.devel Subject: dired leaves open dir after signal Date: Fri, 20 Dec 2002 14:26:21 -0800 (PST) Organization: Sony Electronics Inc. Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20021220.142621.107708847.Takaaki.Ota@am.sony.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1040423285 19776 80.91.224.249 (20 Dec 2002 22:28:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 20 Dec 2002 22:28:05 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18PVcf-00058Y-00 for ; Fri, 20 Dec 2002 23:28:01 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18PVeT-0006Ek-00 for ; Fri, 20 Dec 2002 23:29:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18PVbr-0003hU-02 for emacs-devel@quimby.gnus.org; Fri, 20 Dec 2002 17:27:11 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18PVbY-0003fF-00 for emacs-devel@gnu.org; Fri, 20 Dec 2002 17:26:52 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18PVb9-0003Qa-00 for emacs-devel@gnu.org; Fri, 20 Dec 2002 17:26:30 -0500 Original-Received: from mail6.fw-bc.sony.com ([160.33.98.73]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18PVb5-0003Nq-00 for emacs-devel@gnu.org; Fri, 20 Dec 2002 17:26:23 -0500 Original-Received: from mail2.sjc.in.sel.sony.com (mail2.sjc.in.sel.sony.com [43.134.1.111]) by mail6.fw-bc.sony.com (8.8.8/8.8.8) with ESMTP id WAA28363 for ; Fri, 20 Dec 2002 22:26:22 GMT Original-Received: by mail2.sjc.in.sel.sony.com id WAA22437; Fri, 20 Dec 2002 22:26:21 GMT Original-To: emacs-devel@gnu.org X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 X-Mailer: Mew-3.1 on Emacs-21.3.50.1 (i386-msvc-nt5.0.2195) of 2002-12-19 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10313 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10313 The following patch for dired.c fixes a problem caused by leaving open directory unclosed in case of an exception, i.e. C-g while completing file name in a minibuffer. -Tak $ diff -c pure/emacs-21.3.50/src/dired.c emacs-21.3.50/src/dired.c *** pure/emacs-21.3.50/src/dired.c Wed Nov 27 21:34:22 2002 --- emacs-21.3.50/src/dired.c Thu Dec 19 13:29:09 2002 *************** *** 523,528 **** --- 523,532 ---- if (!d) report_file_error ("Opening directory", Fcons (dirname, Qnil)); + record_unwind_protect (directory_files_internal_unwind, + Fcons (make_number (((unsigned long) d) >> 16), + make_number (((unsigned long) d) & 0xffff))); + /* Loop reading blocks */ /* (att3b compiler bug requires do a null comparison this way) */ while (1) *************** *** 716,725 **** } } closedir (d); } UNGCPRO; - bestmatch = unbind_to (count, bestmatch); if (all_flag || NILP (bestmatch)) { --- 720,730 ---- } } closedir (d); + /* Discard the unwind protect. */ + specpdl_ptr = specpdl + count; } UNGCPRO; if (all_flag || NILP (bestmatch)) { *************** *** 738,743 **** --- 743,750 ---- quit: if (d) closedir (d); + /* Discard the unwind protect. */ + specpdl_ptr = specpdl + count; Vquit_flag = Qnil; return Fsignal (Qquit, Qnil); }