From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: disk-usage Date: Tue, 19 Feb 2019 10:55:43 -0500 Message-ID: References: <87imxgmacr.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="90012"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 19 16:58:42 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gw7n8-000NF8-8X for ged-emacs-devel@m.gmane.org; Tue, 19 Feb 2019 16:58:42 +0100 Original-Received: from localhost ([127.0.0.1]:50893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw7n7-0003o1-5s for ged-emacs-devel@m.gmane.org; Tue, 19 Feb 2019 10:58:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw7kT-0002Wn-2i for emacs-devel@gnu.org; Tue, 19 Feb 2019 10:55:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gw7kP-0001Gr-9l for emacs-devel@gnu.org; Tue, 19 Feb 2019 10:55:55 -0500 Original-Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:39674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gw7kN-000138-6c for emacs-devel@gnu.org; Tue, 19 Feb 2019 10:55:51 -0500 Original-Received: by mail-qt1-x834.google.com with SMTP id o6so23646540qtk.6 for ; Tue, 19 Feb 2019 07:55:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=WvkSpzMgX8+3J74y6jzfg+oLoxN5PQbKxkqYiognw0A=; b=hLrTKN4ko5szsf2GT/Rki3diaYET4DbW5+T8K73wGX/2VfeTPJdw/H2npPEeMJZOPe EdbbLzKj8Tb7yFabSivGS3Fbv2edVO+2YOTamxZvdTrV8NfmnZnGftMLxxpsh2Qz2pKb 46dc8xQ7dlyhXS8kIYWOoPvg0ALMH2+RnimJe0o6qMuhCceme9yi6GYxTWoLfekH6cYu zh8Yr4DLvwybrrRn7ufhFSE6RzYQMNqjvfZt5Gjyr5f4V/b5L/me2iqRgJW/38GCdiLR Sf7OQrwUm9dqumdD9sTkSD+qnqHqxFyPqrndGXHFjYnhUL6wt9Fw0qSwreEVApunC/1R pT4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WvkSpzMgX8+3J74y6jzfg+oLoxN5PQbKxkqYiognw0A=; b=dCJ2vubYs8ZKTKsq8oES97QKAOpqdY6xHfp5ETjIHmE6npXEnKXx94iTxCVyioSzeH 8eBK+lb8A2AXsTUCnMNzpkNuXeiOYS66EpbizY7FgqT+tHAV0E+b7VtVtAiUBLgtaI7Q G+bCFF5Rf1a99sFgUf8jb2AiKAV2pCut0IcHD0rbQIvm8MLoU91WSZVB0e9j8aGx1i+x jmuwUSC4Fsn8qvJUc7/zKglwngiNODgrfld2KgSQM30C1HjLecpqAAhnvPNcu+77iBTx 737Xanzhpie31fmICeNyRMQZVSulRSmxzyS77yOGEl9Omy1y+GbT3e0d1VzRufzQym+H muLg== X-Gm-Message-State: AHQUAuYjS7D/psLP74IB6cF0VAP7f9xxzXjREoaYMuLDSUOwrzq2Z/eH RCMTWUBGg3x237oN+y8cKrnNFKC6 X-Google-Smtp-Source: AHgI3IZjZeyRJ7Erja22R/CUqmBKqKbtPq/r/NJscZZ1JD74/ENhxfMMGZ3+IG8WDHo/J0Veegvlmw== X-Received: by 2002:a0c:b126:: with SMTP id q35mr22762318qvc.156.1550591745260; Tue, 19 Feb 2019 07:55:45 -0800 (PST) Original-Received: from ?IPv6:2601:184:4180:66e7:7153:e8ef:c4f6:5d09? ([2601:184:4180:66e7:7153:e8ef:c4f6:5d09]) by smtp.googlemail.com with ESMTPSA id t26sm11011688qkl.73.2019.02.19.07.55.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 07:55:44 -0800 (PST) In-Reply-To: <87imxgmacr.fsf@ambrevar.xyz> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::834 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:233455 Archived-At: On 19/02/2019 03.49, Pierre Neidhardt wrote: > I'm happy to announce disk-usage.el > (https://gitlab.com/ambrevar/emacs-disk-usage), a disk analyzer for Emacs! This looks great! It works smoothly here. Thanks for working on this :) Some questions: * Out of curiosity, why do you use `find . -type f -exec du -sb {} +` instead of a plain `du -ab`? (Also, wouldn't that save you the extra step of computing disk-usage--total?) * Could you use the same face for directories as dired uses (rather than the hyperlink face)? In fact, is there any way that this could be integrated more tightly with dired? For example, I got bitten by the face that d exits the disk-usage window, instead of marking a file for deletion. * Using a visual representation (a sort of progress bar) instead of a percentage could be nice (on graphic terminals only, of course). You could implement it like this: (defun disk-usage--make-progress-bar (pct) (let ((width 5)) (concat (propertize " " 'face '(:reverse-video t) 'display `(space :width ,(* width pct))) (propertize " " 'display `(space :width ,(* width (- 1 pct))))))) (defun disk-usage--refresh (&optional directory) … (list file-info (vector (number-to-string (disk-usage--file-info-size file-info)) (disk-usage--make-progress-bar (/ (float (disk-usage--file-info-size file-info)) total-size)) … Thanks again for the great work! Clément. > It displays a tabulated list of files and folders along their size in a select > directory. > > Features: > > - It's an Emacs buffer, you can use all Emacs facilities (search, multiple > buffers, etc.). > > - Results are cached and disk-usage.el should generally be very fast. > > - Directories can be explored up and down, re-using the cache. (ncdu can not even go "up" without > rescanning everything). > > - File listings can be displayed recursively (all files in all subfolders). > > - Toggle "human size" display. > > - Display size statistics by extension. > > - Sort by any column (size, filename, extension, percentage, etc.). > > - Open current entry in Dired/M-x shell/Eshall/. > > I decided to work on this as an answer to years of frustration with more limited > tools such as ncdu (my last ncurses application). > > It already has Evil bindings in Evil collection > (https://github.com/emacs-evil/evil-collection) and a Guix package. > > I'd like to add this item to ELPA as an external. Let me know if there > is anything. > > Feedback is more than welcome! > > Cheers! >