(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
"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."
(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))
"\\|" 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
;; 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))))))