From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#3911: get-free-disk-space when default-directory doesn't exist Date: Tue, 18 Aug 2009 10:23:08 +1000 Message-ID: <87bpme9dhv.fsf@blah.blah> References: <871vnclhoz.fsf@cyd.mit.edu> Reply-To: Kevin Ryde , 3911@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1250797698 25794 80.91.229.12 (20 Aug 2009 19:48:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Aug 2009 19:48:18 +0000 (UTC) Cc: 3911@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 20 21:48:11 2009 Return-path: Envelope-to: geb-bug-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 1MeDcH-0001lk-Gl for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 21:48:09 +0200 Original-Received: from localhost ([127.0.0.1]:32892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeDcH-0002KN-2E for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 15:48:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeDbn-0001wO-Ov for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 15:47:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeDbj-0001qq-EE for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 15:47:39 -0400 Original-Received: from [199.232.76.173] (port=33858 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeDbi-0001qZ-TR for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 15:47:35 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:46152) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeDbi-0002Sq-5Q for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 15:47:34 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7KJkpLV004437; Thu, 20 Aug 2009 12:47:31 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7KJbYff002055; Thu, 20 Aug 2009 12:37:34 -0700 Resent-Date: Thu, 20 Aug 2009 12:37:34 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 20 Aug 2009 19:37:32 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3911 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3911-submit@emacsbugs.donarmstrong.com id=B3911.12505550065445 (code B ref 3911); Thu, 20 Aug 2009 19:37:32 +0000 Original-Received: (at 3911) by emacsbugs.donarmstrong.com; 18 Aug 2009 00:23:26 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mailout2.pacific.net.au (mailout2-10.pacific.net.au [125.255.80.137]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7I0NOF7005442 for <3911@emacsbugs.donarmstrong.com>; Mon, 17 Aug 2009 17:23:26 -0700 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id A787818AC09; Tue, 18 Aug 2009 10:23:22 +1000 (EST) Original-Received: from blah.blah (ppp2002.dyn.pacific.net.au [61.8.32.2]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id BD7428C23; Tue, 18 Aug 2009 10:23:21 +1000 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1MdCTl-0005N2-Qt; Tue, 18 Aug 2009 10:23:09 +1000 In-Reply-To: <871vnclhoz.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 15 Aug 2009 20:34:52 -0400") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 20 Aug 2009 15:47:39 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30320 Archived-At: --=-=-= Chong Yidong writes: > > You're right; it's probably better to fall back on / instead of ~. I think the test for file-remote-p is covered by the first line of the func so it's not needed in the dir condition bit, per below. I still think "/" might as well be used unconditionally though. The reason I'm still banging on about that is that there's probably 3 or 4 other places in emacs which also don't care about the current directory when spawning a program. They would make use of the same idiom, whatever it might best be. (I arrived at this first when some of my own code bombed in a non-existent default-directory. I've seen it in other people's code too.) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.disk-space-noremote.diff *** files.el 18 Aug 2009 08:51:19 +1000 1.1068 --- files.el 18 Aug 2009 10:12:22 +1000 *************** *** 5400,5407 **** ;; not exist (Bug#2631, Bug#3911). (let ((default-directory default-directory)) (setq dir (expand-file-name dir)) ! (unless (and (not (file-remote-p default-directory)) ! (file-directory-p default-directory) (file-readable-p default-directory)) (setq default-directory "/")) (eq (call-process directory-free-space-program --- 5400,5406 ---- ;; not exist (Bug#2631, Bug#3911). (let ((default-directory default-directory)) (setq dir (expand-file-name dir)) ! (unless (and (file-directory-p default-directory) (file-readable-p default-directory)) (setq default-directory "/")) (eq (call-process directory-free-space-program --=-=-=--