From 06531fc3fc5d8c975d3edc9d8b77118f88b742d7 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 30 Jan 2007 20:23:38 +0000 Subject: * files.el (get-free-disk-space): Return nil for remote directories. * net/ange-ftp.el (ange-ftp-ls): In case of wildcards, use "ls" instead of "dir". --- lisp/files.el | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index f671f1ae0c..36f9e0353f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4749,36 +4749,37 @@ preference to the program given by this variable." "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 -- cgit v1.2.3 From e8a84e5ba2b9472552ca6034cdb5a5b71019ea44 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Wed, 31 Jan 2007 12:37:29 +0000 Subject: (magic-mode-alist): Use image-mode-maybe rather than image-mode. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 36f9e0353f..139585368f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2127,7 +2127,7 @@ of the regular expression. The mode is then determined as the mode associated with that interpreter in `interpreter-mode-alist'.") (defvar magic-mode-alist - `((image-type-auto-detected-p . image-mode) + `((image-type-auto-detected-p . image-mode-maybe) ;; The < comes before the groups (but the first) to reduce backtracking. ;; TODO: UTF-16 Date: Fri, 9 Feb 2007 16:50:00 +0000 Subject: (magic-mode-alist): Call image-mode instead of image-mode-maybe for autodetected images. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 139585368f..36f9e0353f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2127,7 +2127,7 @@ of the regular expression. The mode is then determined as the mode associated with that interpreter in `interpreter-mode-alist'.") (defvar magic-mode-alist - `((image-type-auto-detected-p . image-mode-maybe) + `((image-type-auto-detected-p . image-mode) ;; The < comes before the groups (but the first) to reduce backtracking. ;; TODO: UTF-16 Date: Sun, 11 Feb 2007 02:28:57 +0000 Subject: (change-major-mode-with-file-name): Fix typo in docstring. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 36f9e0353f..6d5b101d3c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2829,7 +2829,7 @@ It is dangerous if either of these conditions are met: 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) -- cgit v1.2.3