From: Tino Calancha <tino.calancha@gmail.com>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>,
Tino Calancha <tino.calancha@gmail.com>
Subject: Re: [ELPA] New package: dired-du
Date: Sat, 27 May 2017 19:06:21 +0900 (JST) [thread overview]
Message-ID: <alpine.DEB.2.20.1705271833110.14415@calancha-pc> (raw)
In-Reply-To: <CAP_d_8V_Jvs-P5tPik1xCV=0dDC91suu=Q6RAfCZJ8mA-LrOSQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2923 bytes --]
On Sat, 27 May 2017, Yuri Khan wrote:
> On Fri, May 26, 2017 at 8:02 PM, Tino Calancha <tino.calancha@gmail.com> 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?
That part is expected to be very slow. I just added recently as a
fallback, but it is not the recomended way. Actually I show one
warning encouraging the user to install `du'.
>
>> 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?
I don't know. I decided the implementation according with my
use case:
i just wanted to see the actual size of my dirs in human readable units.
For this naive purpose the buffer locallity of `dired-du-dir-info' is
fine.
Once other people start using the lib we might find convenient to change
those particular aspects of the implementation.
> 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.)
Good idea. I just added the command `dired-du-update-dir-info' for
that operation.
Thank you.
>
> 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?
Of course it would.
If the lib is ported to master branch, some parts of the lib will be
absorbed by dired.el, dired-aux.el, dired-x.el, and the file will be
much shorter.
On the other hand, one of the nice things about Elpa is that you can
support older Emacs. This file works for Emacs >= 24.4.
next prev parent reply other threads:[~2017-05-27 10:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 13:02 [ELPA] New package: dired-du Tino Calancha
2017-05-26 13:45 ` Clément Pit-Claudel
2017-05-26 14:57 ` Tino Calancha
2017-05-26 17:04 ` Yuri Khan
2017-05-26 17:53 ` Eli Zaretskii
2017-05-26 18:12 ` Yuri Khan
2017-05-26 19:03 ` Eli Zaretskii
2017-05-27 10:06 ` Tino Calancha [this message]
2017-05-27 10:59 ` Yuri Khan
2017-05-29 1:37 ` Tino Calancha
2017-05-29 14:41 ` Filipp Gunbin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1705271833110.14415@calancha-pc \
--to=tino.calancha@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=yuri.v.khan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).