(point-min) 'noerror)
(replace-match (file-relative-name filename) t))
- ;; Try to insert the amount of free space.
- (goto-char (point-min))
- ;; First find the line to put it on.
- (when (re-search-forward "^\\([[:space:]]*total\\)" nil t)
- (when-let ((available (get-free-disk-space ".")))
- ;; Replace "total" with "total used", to avoid confusion.
- (replace-match "\\1 used in directory")
- (end-of-line)
- (insert " available " available))))
+ ;; Try to insert the amount of free space. This is moved to
+ ;; `dired-insert-directory' in Emacs 29.1.
+ (unless (boundp 'dired-free-space)
+ (goto-char (point-min))
+ ;; First find the line to put it on.
+ (when (re-search-forward "^\\([[:space:]]*total\\)" nil t)
+ (when-let ((available (get-free-disk-space ".")))
+ ;; Replace "total" with "total used", to avoid confusion.
+ (replace-match "\\1 used in directory")
+ (end-of-line)
+ (insert " available " available)))))
(prog1 (goto-char end-marker)
(set-marker beg-marker nil)
(setcar x (concat (car x) "*"))))))
entries))
- ;; Insert size information.
- (when full-directory-p
- (insert
- (if avail
- (format "total used in directory %s available %s\n" used avail)
- (format "total %s\n" used))))
+ ;; Insert size information. This is moved to
+ ;; `dired-insert-directory' in Emacs 29.1.
+ (unless (boundp 'dired-free-space)
+ (when full-directory-p
+ (insert
+ (if avail
+ (format "total used in directory %s available %s\n" used avail)
+ (format "total %s\n" used)))))
;; Print entries.
(mapc