From aa6a05c146e94c0afc35b5354d68da55aecb2db7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 2 Dec 2021 13:04:45 +0200 Subject: [PATCH] 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'. --- lisp/dired.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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))) ?:))) -- 2.39.2