Subject: bug#36729: 27.0.50; Unclear total in directory listing

From: Stephen Berman <[email-masked]>
Date: Wed, 26 Aug 2020 12:10:21 +0200

On Sat, 22 Aug 2020 16:02:28 +0200 Lars Ingebrigtsen <[email-masked]> wrote:

> Stephen Berman <[email-masked]> writes:
>
>> An alternative is to do for "total used" what was done for "available".
>> On systems that use `ls' (at least the GNU version), users can do that
>> by setting the environment variable BLOCK_SIZE, but since the change to
>> the display of "available" was unconditional (if I'm not mistaken), we
>> could do the same for the display of "total used", e.g. as in the below
>> patch.
>
> [...]
>
>> +	(block-size (getenv "BLOCK_SIZE"))
>>  	end)
>> +    (setenv "BLOCK_SIZE" "si")
>
> [...]
>
>> -      (dired-insert-set-properties content-point (point)))))
>> +      (dired-insert-set-properties content-point (point)))
>> +    (if block-size
>> +	(setenv "BLOCK_SIZE" block-size)
>> +      (setenv-internal process-environment "BLOCK_SIZE" nil t))))
>
> Makes sense to me, but this should probably be protected by an
> `unwind-protect' to ensure that things get properly reset.

Yes, but since this idea won't work with all ls implementations, I
assumed it's not worth pursuing.

Steve Berman