(dired-move-to-filename-regexp): Fixed for the case
[bpt/emacs.git] / lisp / dired.el
index 5308cdb..07bfcb8 100644 (file)
@@ -686,22 +686,30 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
          (goto-char (point-min))
          (when (re-search-forward "total [0-9]+$" nil t)
            (insert "  free ")
-           (let ((beg (point)))
-             (if (zerop (call-process dired-free-space-program nil t nil
-                                      dired-free-space-args
-                                      (expand-file-name dir-or-list)))
-                 (progn
-                   (goto-char beg)
-                   (forward-line 1)
-                   (skip-chars-forward "^ \t")
-                   (forward-word 2)
-                   (skip-chars-forward " \t")
-                   (delete-region beg (point))
-                   (forward-word 1)
-                   (delete-region (point)
-                                  (progn (forward-line 1) (point))))
-               ;; The dired-free-space-program failed; delete its output
-               (delete-region (- beg 7) (point))))))))
+           ;; Non-Posix systems don't always have dired-free-space-program,
+           ;; but might have an equivalent system call.
+           (if (fboundp 'file-system-info)
+               (insert
+                (format "%.0f"
+                        (/ (nth 2 (file-system-info dir-or-list)) 1024)))
+             (let ((beg (point)))
+               (condition-case nil
+                   (if (zerop (call-process dired-free-space-program nil t nil
+                                            dired-free-space-args
+                                            (expand-file-name dir-or-list)))
+                       (progn
+                         (goto-char beg)
+                         (forward-line 1)
+                         (skip-chars-forward "^ \t")
+                         (forward-word 2)
+                         (skip-chars-forward " \t")
+                         (delete-region beg (point))
+                         (forward-word 1)
+                         (delete-region (point)
+                                        (progn (forward-line 1) (point))))
+            ;; The dired-free-space-program failed; delete its output
+                     (delete-region (- beg 7) (point)))
+                 (error (delete-region (- beg 7) (point))))))))))
     ;; Quote certain characters, unless ls quoted them for us.
     (if (not (string-match "b" dired-actual-switches))
        (save-excursion
@@ -1397,7 +1405,8 @@ otherwise, display it in another buffer."
   "In dired, return name of file mentioned on this line.
 Value returned normally includes the directory name.
 Optional arg LOCALP with value `no-dir' means don't include directory
-  name in result.  A value of t means construct name relative to
+  name in result.  A value of `verbatim' means to return the name exactly as
+  it occurs in the buffer, and a value of t means construct name relative to
   `default-directory', which still may contain slashes if in a subdirectory.
 Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on
   this line, otherwise an error occurs."
@@ -1429,6 +1438,8 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on
         (not default-file-name-coding-system)
         (setq file (encode-coding-string file buffer-file-coding-system)))
     (cond
+     ((eq localp 'verbatim)
+      file)
      ((and (eq localp 'no-dir) already-absolute)
       (file-name-nondirectory file))
      ((or already-absolute (eq localp 'no-dir))
@@ -1504,7 +1515,8 @@ DIR must be a directory name, not a file name."
                                  "\\|" yyyy s s "?"
                                  "\\|" s "?" yyyy
                             "\\)"))
-        (japanese (concat mm k s dd k s "\\(" s HH:MM "\\|" yyyy k "\\)")))
+        (japanese
+         (concat mm k s dd k "?" s "\\(" s HH:MM "\\|" yyyy k "?" "\\)")))
         ;; The "[0-9]" below requires the previous column to end in a digit.
         ;; This avoids recognizing `1 may 1997' as a date in the line:
         ;; -r--r--r--   1 may      1997        1168 Oct 19 16:49 README
@@ -2199,7 +2211,7 @@ FILES is the list of marked files."
   ;; Point must be at beginning of line
   ;; Should be equivalent to (save-excursion (not (dired-move-to-filename)))
   ;; but is about 1.5..2.0 times as fast. (Actually that's not worth it)
-  (or (looking-at "^$\\|^. *$\\|^. total\\|^. wildcard\\|^. used")
+  (or (looking-at "^$\\|^. *$\\|^. total\\|^. wildcard\\|^. used\\|^. find")
       (and (looking-at dired-subdir-regexp)
           (save-excursion (not (dired-move-to-filename))))))