[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#5762: 24.0.50; Show available disk space with -h option when using l
From: |
Thierry Volpiatto |
Subject: |
bug#5762: 24.0.50; Show available disk space with -h option when using ls with -h option |
Date: |
Wed, 24 Mar 2010 08:29:24 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
> Hi,
> in dired when using `dired-listing-switches' with -h option, the second
> line of dired buffer is like:
>
> total used in directory 24M available 19275100
>
> it should show:
>
> total used in directory 24M available 19G
>
> I suggest to modify `insert-directory' like this:
>
> ,----[ files.el (insert-directory) ]
> | [....]
> | (let* ((directory-free-space-args (if (string-match "h"
> dired-listing-switches)
> | (concat directory-free-space-args "h")
> | directory-free-space-args))
> | (available (get-free-disk-space ".")))
> | (when (re-search-forward "^ *\\(total\\)" nil t)
> | (when available
> | ;; Replace "total" with "used", to avoid confusion.
> | (replace-match "total used in directory" nil nil nil 1)
> | (end-of-line)
> | (insert " available " available))))))))))
> `----
>
> Find a patch attached.
Even better is to parse `dired-actual-switches', like that it update
correctly when using C-u s in dired.
Find the precedent patch modified here.
--
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/
patch-r107473
Description: Binary data