From: Eli Zaretskii Date: Thu, 2 Dec 2021 11:04:45 +0000 (+0200) Subject: Fix display of free disk space in Dired X-Git-Tag: emacs-29.0.90~3625^2~15 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aa6a05c146e94c0afc35b5354d68da55aecb2db7;p=emacs.git Fix display of free disk space in Dired * lisp/dired.el (dired--insert-disk-space): Fix 'first' display on MS-Windows. (dired-free-space): Clarify the meaning of 'first'. --- diff --git a/lisp/dired.el b/lisp/dired.el index c8add87a008..d03c79df40d 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -210,12 +210,13 @@ If a character, new links are unconditionally marked with that character." :group 'dired-mark) (defcustom dired-free-space 'first - "Whether to display free disk space in dired buffers. + "Whether and how to display the amount of free disk space in Dired buffers. If nil, don't display. If `separate', display on a separate line (along with used count). -If `first', display the free disk space on the first line." +If `first', display only the free disk space on the first line, +following the directory name." :type '(choice (const :tag "On a separate line" separate) - (const :tag "On the first line" first) + (const :tag "On the first line, after directory name" first) (const :tag "Don't display" nil)) :version "29.1" :group 'dired) @@ -1658,7 +1659,10 @@ see `dired-use-ls-dired' for more details.") (point)) ((eq dired-free-space 'first) (goto-char beg) - (when (and (looking-at " */") + (when (and (looking-at + (if (memq system-type '(windows-nt ms-dos)) + " *[A-Za-z]:/" + " */")) (progn (end-of-line) (eq (char-after (1- (point))) ?:)))