[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] New package: dired-du

From: Yuri Khan
Subject: Re: [ELPA] New package: dired-du
Date: Sat, 27 May 2017 00:04:34 +0700

On Fri, May 26, 2017 at 8:02 PM, Tino Calancha <address@hidden> wrote:

> New library implementing a Dired interface for `du'.

That sounds great.

> I)
> This library defines a minor mode `dired-du-mode' to display
> the recursive size of directories in Dired buffers.  This mode
> uses the external `du' program when available.  Otherwise, it
> performs a rough estimation with Lisp.

Would it be useful to extract the Lisp replacement of du as a separate
library, or does that raise too many questions about cache management?

> II)
> In addition, this file provides a command `dired-du-count-sizes',
> to show the total size of the marked files.  By default, it shows
> the size of the files marked with `dired-marker-char'.   If `dired-du-mode'
> is disabled, then ignores the size of directories.  Otherwise, it takes
> in account the size of the dirs.
> When called with a prefix prompts for the marks and asks if the dirs must
> be taken in account.
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> The file is available for inspection in the following Elpa repo. branch:
> scratch/dired-du

You are caching directory information in a buffer-local variable
‘dired-du-dir-info’. A single Dired buffer can show multiple
directories, and it can be killed and re-opened. Wouldn’t it make
sense to share the cache across all Dired buffers and persist it
independently of buffer lifetimes?

>From experience with other file managers implementing directory size
calculation, it is useful to have a command that recalculates the
sizes of marked subdirectories, or the subdirectory at point, if none
are marked. (Their cached size should be discarded and replaced with
the newly calculated one.)

Also, you are defining many functions that are copies of dired’s but
with added functionality. Would it be better to improve dired’s
functions instead?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]