Subject: bug#59272: [PATCH] Make Memory Human Readable in proced Buffers

From: Stefan Kangas <[email-masked]>
Date: Mon, 14 Nov 2022 19:40:31 -0800

Visuwesh <[email-masked]> writes:

> [திங்கள் நவம்பர் 14, 2022] Laurence Warne wrote:
>
>> Hi, this patch makes vsize and rss human readable in proced buffers by
>> formatting them as megabytes or gigabytes according to their size, similar
>> as the -h flag for ls and du.
>>
>> The current behaviour is to show them always as kilobytes, though I'm
>> unsure if this meant as 1000 bytes or 1024 bytes, this patch assumes the
>> former case.
>
> We can leave this to the user to decide by...
>
>> +(defun proced-format-memory (kilobytes)
>> +  "Format KILOBYTES in a human readable format."
>
> ... using `file-size-human-readable' instead.

Yes, we could do something like

(defcustom  proced-format-memory-function #'file-size-human-readable
  "..."
  )

Where one of the options is #'identity, which means not to use human
readable sizes, and then funcall that.