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#2631: get-free-disk-space when default-directory doesn't exist Date: Sat, 28 Mar 2009 10:17:47 +1100 Message-ID: <878wmqy2qs.fsf@blah.blah> References: <87d4cjzf89.fsf@cyd.mit.edu> <877i2p9fu5.fsf@blah.blah> Reply-To: Kevin Ryde , 2631@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1238197559 29474 80.91.229.12 (27 Mar 2009 23:45:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2009 23:45:59 +0000 (UTC) To: control@emacsbugs.donarmstrong.com, 2631@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 28 00:47:16 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 1LnLlU-0004tu-1W for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Mar 2009 00:47:08 +0100 Original-Received: from localhost ([127.0.0.1]:48458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnLk6-0001YC-QM for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Mar 2009 19:45:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LnLiM-0000w1-N6 for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 19:43:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LnLiH-0000sR-1K for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 19:43:53 -0400 Original-Received: from [199.232.76.173] (port=36939 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnLiG-0000sH-SA for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 19:43:48 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44951) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LnLiG-0002Dy-5d for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 19:43:48 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2RNhjNE017049; Fri, 27 Mar 2009 16:43:46 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2RNP5pX012071; Fri, 27 Mar 2009 16:25:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 27 Mar 2009 23:25:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2631-submit@emacsbugs.donarmstrong.com id=B2631.123819592310512 (code B ref 2631); Fri, 27 Mar 2009 23:25:04 +0000 Original-Received: (at 2631) by emacsbugs.donarmstrong.com; 27 Mar 2009 23:18:43 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mailout1.pacific.net.au (mailout1-2.pacific.net.au [61.8.2.209]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2RNIXva010504; Fri, 27 Mar 2009 16:18:35 -0700 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id CA5DE469097; Sat, 28 Mar 2009 10:18:31 +1100 (EST) Original-Received: from blah.blah (ppp203E.dyn.pacific.net.au [61.8.32.62]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id EF49927407; Sat, 28 Mar 2009 10:18:30 +1100 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LnLJ7-0004Nz-PI; Sat, 28 Mar 2009 10:17:50 +1100 In-Reply-To: <877i2p9fu5.fsf@blah.blah> (Kevin Ryde's message of "Tue, 17 Mar 2009 11:02:26 +1100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 27 Mar 2009 19:43:53 -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:26688 Archived-At: --=-=-= reopen 2631 retitle 2631 get-free-disk-space when home dir also doesn't exist tags 2631 +patch thanks If both default-directory and home directory both don't exist get-free-disk-space still gets an error (progn (setq default-directory "/no/such/dir") (setenv "HOME" "/another/no/such/dir") (get-free-disk-space "/")) => (file-error "Setting current directory" "no such file or directory" "/another/no/such/dir/") Although plenty of things probably depend on a home dir I don't think get-free-disk-space needs to be one of them. Change below is like what's also in the following funcs, I believe for the same purpose, ie. just to make sure call-process will be happy, when the program run doesn't care about the current directory. Man-init-defvars, mail-source-movemail message-send-mail-with-sendmail sendmail-send-it gamegrid-add-score-with-update-game-score-1 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.disk-space-root.diff *** files.el 28 Mar 2009 09:50:47 +1100 1.1041 --- files.el 28 Mar 2009 09:56:48 +1100 *************** *** 5336,5352 **** (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (let ((default-directory ! (if (and (not (file-remote-p default-directory)) ! (file-directory-p default-directory) ! (file-readable-p default-directory)) ! default-directory ! (expand-file-name "~/")))) ! (eq (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir) ! 0))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --- 5336,5349 ---- (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (progn ! (setq dir (expand-file-name dir)) ;; in case relative ! (let ((default-directory "/")) ! (eq (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir) ! 0)))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --=-=-=--