emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: disk-usage


From: Clément Pit-Claudel
Subject: Re: [ELPA] New package: disk-usage
Date: Tue, 19 Feb 2019 10:55:43 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

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/<you-name-it>.
> 
> 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!
> 




reply via email to

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