diff lisp/files.el @ 83556:07774e5c3ff5

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-619 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-620 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-621 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-622 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-623 Remove RCS keywords * emacs@sv.gnu.org/emacs--devo--0--patch-624 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-625 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-626 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-627 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-628 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-629 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-630 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-631 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-632 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-633 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-634 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-635 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-636 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-637 Remove RCS keywords * emacs@sv.gnu.org/emacs--devo--0--patch-638 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-639 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-640 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-641 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-642 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-643 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-644 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-645 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-646 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-647 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-648 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-649 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-197 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-198 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-199 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-200 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-201 Update from CVS: lisp/nnweb.el (nnweb-google-parse-1): Update parser. * emacs@sv.gnu.org/gnus--rel--5.10--patch-202 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-596
author Karoly Lorentey <karoly@lorentey.hu>
date Sat, 24 Feb 2007 19:26:54 +0000
parents b8d9a391daf3 732f9b589f8e
children edf631bdbb7a
line wrap: on
line diff
--- a/lisp/files.el	Sat Feb 24 19:12:27 2007 +0000
+++ b/lisp/files.el	Sat Feb 24 19:26:54 2007 +0000
@@ -2830,7 +2830,7 @@
 However, the mode will not be changed if
 \(1) a local variables list or the `-*-' line specifies a major mode, or
 \(2) the current major mode is a \"special\" mode,
-\    not suitable for ordinary files, or
+\     not suitable for ordinary files, or
 \(3) the new file name does not particularly specify any mode."
   :type 'boolean
   :group 'editing-basics)
@@ -4750,36 +4750,37 @@
   "Return the amount of free space on directory DIR's file system.
 The result is a string that gives the number of free 1KB blocks,
 or nil if the system call or the program which retrieve the information
-fail.
+fail.  It returns also nil when DIR is a remote directory.
 
 This function calls `file-system-info' if it is available, or invokes the
 program specified by `directory-free-space-program' if that is non-nil."
-  ;; Try to find the number of free blocks.  Non-Posix systems don't
-  ;; always have df, but might have an equivalent system call.
-  (if (fboundp 'file-system-info)
-      (let ((fsinfo (file-system-info dir)))
-	(if fsinfo
-	    (format "%.0f" (/ (nth 2 fsinfo) 1024))))
-    (save-match-data
-      (with-temp-buffer
-	(when (and directory-free-space-program
-		   (eq 0 (call-process directory-free-space-program
-				       nil t nil
-				       directory-free-space-args
-				       dir)))
-	  ;; Usual format is a header line followed by a line of
-	  ;; numbers.
-	  (goto-char (point-min))
-	  (forward-line 1)
-	  (if (not (eobp))
-	      (progn
-		;; Move to the end of the "available blocks" number.
-		(skip-chars-forward "^ \t")
-		(forward-word 3)
-		;; Copy it into AVAILABLE.
-		(let ((end (point)))
-		  (forward-word -1)
-		  (buffer-substring (point) end)))))))))
+  (when (not (file-remote-p dir))
+    ;; Try to find the number of free blocks.  Non-Posix systems don't
+    ;; always have df, but might have an equivalent system call.
+    (if (fboundp 'file-system-info)
+	(let ((fsinfo (file-system-info dir)))
+	  (if fsinfo
+	      (format "%.0f" (/ (nth 2 fsinfo) 1024))))
+      (save-match-data
+	(with-temp-buffer
+	  (when (and directory-free-space-program
+		     (eq 0 (call-process directory-free-space-program
+					 nil t nil
+					 directory-free-space-args
+					 dir)))
+	    ;; Usual format is a header line followed by a line of
+	    ;; numbers.
+	    (goto-char (point-min))
+	    (forward-line 1)
+	    (if (not (eobp))
+		(progn
+		  ;; Move to the end of the "available blocks" number.
+		  (skip-chars-forward "^ \t")
+		  (forward-word 3)
+		  ;; Copy it into AVAILABLE.
+		  (let ((end (point)))
+		    (forward-word -1)
+		    (buffer-substring (point) end))))))))))
 
 ;; The following expression replaces `dired-move-to-filename-regexp'.
 (defvar directory-listing-before-filename-regexp