From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: dired-du Date: Sat, 27 May 2017 00:04:34 +0700 Message-ID: References: <8737brwz2a.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1495818322 23909 195.159.176.226 (26 May 2017 17:05:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 May 2017 17:05:22 +0000 (UTC) Cc: Emacs developers To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 26 19:05:17 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEIfr-00064M-Sf for ged-emacs-devel@m.gmane.org; Fri, 26 May 2017 19:05:15 +0200 Original-Received: from localhost ([::1]:37659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEIfx-0000YT-Dp for ged-emacs-devel@m.gmane.org; Fri, 26 May 2017 13:05:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEIfZ-0000Ha-Nu for emacs-devel@gnu.org; Fri, 26 May 2017 13:04:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEIfY-0001rc-Iu for emacs-devel@gnu.org; Fri, 26 May 2017 13:04:57 -0400 Original-Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:37435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEIfY-0001oW-CG for emacs-devel@gnu.org; Fri, 26 May 2017 13:04:56 -0400 Original-Received: by mail-wm0-x22d.google.com with SMTP id d127so26095452wmf.0 for ; Fri, 26 May 2017 10:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=YqHSQpDqF/tFu3oEPvGo/fnBPBDnt+GMrVSg2IVb6jE=; b=gZ0ovs1QowiRumT7qjuVedx/bUhE298H1akHb1/e/uevusKd8yY/uggfuLvwHjFRDx yZR5v9tMcn8bPOkZcRFfFQUI4sDKh1mk8KogygRESjPEJQm8fDNkenG6kj32ogQ/7UFW 4lsodiKYvXOrlJcmrj7RyUC/3EvVwQ/PiK2uOru0Y/AxDN48JsIWwH10AWri51m4a+67 WliJps8HfRklX7CLiXla1KCYPH4VdcSbWvBFA7p/5JFzmAlg/Z2Vu6cMAAliR1E84MPd XD4TDdhIRvCXlnWCa+dqVKLT6SIgQz1EZz67f3N/wFHzupzbXZQM5MJmXlUyQ1LBuSsB +NwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=YqHSQpDqF/tFu3oEPvGo/fnBPBDnt+GMrVSg2IVb6jE=; b=StO07qnldIonl2wZc7kZJq2vDOfNWrvy1273wdpNewIz6lVNLvPe9otcRlzuSEnoR3 blX8NCMPAPYsl4L+SLxDc14Lncr1VvONbftJFWpRLtPjgzZzJDo5KIj89iuB4JfVe+Dk yKCVKmlirKlhM9dHXBc4B9pg1ZRdMnsPizkUIIIgvzulJSK9l4VQT5YdVQh6UErFTR+9 +ETWH/HStkbhZTkkYiMtxeFFE6e3IrHjetCTuD9Hiy4f35V3rieIb/rUik2iXFuVrL6K pJCmkt4udK6vNbuEA1EPmf13XKVVLQmhxP7nUskyggiEwpDuzwGggc/8Gd8VIYIG5pJc XNSg== X-Gm-Message-State: AODbwcDa7O+DHMeGseiDuObgOI3c6ZWcyRd3R/Kq+/UEIgu9uttZMxDX CWgjeEz3HBgIvH9E5lT8Rc7R3epbxg== X-Received: by 10.28.9.204 with SMTP id 195mr2649979wmj.97.1495818295337; Fri, 26 May 2017 10:04:55 -0700 (PDT) Original-Received: by 10.223.163.196 with HTTP; Fri, 26 May 2017 10:04:34 -0700 (PDT) In-Reply-To: <8737brwz2a.fsf@calancha-pc> X-Google-Sender-Auth: cyTw0v742tltc8YwjpSgR7_94VU X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215225 Archived-At: On Fri, May 26, 2017 at 8:02 PM, Tino Calancha wr= ote: > 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-mod= e' > 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 =E2=80=98dired-du-dir-info=E2=80=99. A single Dired buffer can show multipl= e directories, and it can be killed and re-opened. Wouldn=E2=80=99t 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=E2=80=99s bu= t with added functionality. Would it be better to improve dired=E2=80=99s functions instead?