From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: disk-usage Date: Sun, 03 Mar 2019 11:28:38 +0100 Message-ID: <87ef7oqmjt.fsf@gmx.de> References: <87imxgmacr.fsf@ambrevar.xyz> <874l8z7cmi.fsf@gmx.de> <874l8zr0cs.fsf@ambrevar.xyz> <87zhqr5x81.fsf@gmx.de> <8736ojqyj1.fsf@ambrevar.xyz> <87mumqkhkm.fsf@ambrevar.xyz> <87bm31nm5w.fsf@ambrevar.xyz> <87ftsarc92.fsf@gmx.de> <875zt61taw.fsf@ambrevar.xyz> <877edmk1wx.fsf@gmx.de> <87va12eb4y.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="225336"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Emacs developers To: Pierre Neidhardt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 03 11:29:29 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 1h0ON7-000wOY-3e for ged-emacs-devel@m.gmane.org; Sun, 03 Mar 2019 11:29:29 +0100 Original-Received: from localhost ([127.0.0.1]:36812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0ON5-0002ON-TW for ged-emacs-devel@m.gmane.org; Sun, 03 Mar 2019 05:29:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0OMQ-0002O5-IH for emacs-devel@gnu.org; Sun, 03 Mar 2019 05:28:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0OMP-0005Em-LY for emacs-devel@gnu.org; Sun, 03 Mar 2019 05:28:46 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:49881) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0OMP-00059h-9q for emacs-devel@gnu.org; Sun, 03 Mar 2019 05:28:45 -0500 Original-Received: from detlef.gmx.de ([212.86.58.133]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MdK8t-1gi2Wp0YiJ-00ISQt; Sun, 03 Mar 2019 11:28:40 +0100 In-Reply-To: <87va12eb4y.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Fri, 01 Mar 2019 18:51:25 +0100") X-Provags-ID: V03:K1:ivbu3B0F8DU0U/UfFzNWthuu7j/gwZZof5yRYHRhbDiOisPYNx2 xbA0ZH38p10LhmiZBcOKqbJi3Xfu9y/pJIIJ0RwGhmaMrA7o78LnSzya7TU5c3olnGKff+g gyVea6aTosIIgKuXAMvgpX9KHS/17Q2LB4qOEI0FH9BEp6GcAmVY/r1uI5QHV6zeodmiDaa O56F2rm0nHUvD0NmYWCnQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:E+Zh76UKNA0=:uVOp+IcTD0SrIb2SnNySqT A+gEwQy9RD81RIygaVDB4gJANS37/a3wH9apey908CzuohOUSbhkYnCPXhkOeH19+rulN9/Ar krG3CdOfpRN+YFB1U+GUaVMxM5qxVkWCfD3Nw4DtxGam0RxHiWmNn9E3bquTwQtHyFAAPdp2J q6Jyg38M33n+4nsj+iw07RIMqEFUoC+GVJM6rbxVPNLg9L18jFwAzaYwHazq4i+V79eCUeAlc bQPs3GEducQ+LSLhO2kPvYCkxN4jsKk+f9JQ4UhfHbg9HEopkcOZzqjZIURxt/BXTIRDcH1ws bG7YR1nIA5fqZD4CduDLWaTellYIwCj3jJuZkKmC18ABJN/3ZrI36/y6dqDlZthsDv9RlYe7C oPx1hQhTm9D6OqnB0jIyaT7m7C7hiJCvqZp51S1M4iQ6GreLjI9bxxrdqDT0YtNAjUvooBXSd SgulB/kcF6PVHSE1zO4Dj6xz7vPcSZB2upSFSuTd7IEcPq3gI3LaOM6BKO3ZG/RjVIVDEbti5 HcwaQhxA8WjVFnfkMc0x9JQD3iyLWeoux9Rp8et1ncJU0oRBMREPDIQ/ffya/tUcQ3gIn0yXN Ua5a95B+SufkhqpSAanFKNs74ecX4oNRK9kkR09DfTSlA0G4G5rKgcbzSR3XhV8/PQkXF0F1x NmjQPWMf9XUsk4/OhyWRaPe+RzcryJB58XFLonB9RXIhLCPGWCU7pVg4ZcU0DRL4GdNpFY29A tcT3N2oCs/mNPoyfirjxZR3/0zFtkUh5sQPnIFdiCW/lzJMr5Ao3MDP2fUgtMavOzuw72xyZ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 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:233794 Archived-At: --=-=-= Content-Type: text/plain Pierre Neidhardt writes: > Hi Michael, Hi Pierre, > I've pushed your suggestions. Thanks. > - Regarding the TRAMP issue, I fail to test with "/sudo::", probably because > `find/du` cannot run there. Let me know if it works for you on > remote machines. I did need to apply further changes to let it run sufficiently on /sudo:: * In disk-usage--list-recursively, the (concat (file-remote-p ...) trick must be applied earlier. * In disk-usage--list-recursively and disk-usage--list I needed to adapt the directory-files-and-attributes call; otherwise also /. and /.. would be reported. If the remote case still doesn't work for you, set tramp-verbose to 6, and rerun the test. Show the resulting Tramp debug buffer. > - Regarding the optimization, local tests show no difference. Let me know if > you notice a significant improvement remotely. I have no figures, but it feels faster. One other point worth to fix: Pls don't run disk-usage-toggle-recursive globally. It shall affect only the current buffer; I don't want to have a recursive disk-usage report for every remote directory. It takes too much time. > Cheers! Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** /tmp/ediffhiunfK 2019-03-03 11:26:50.677462619 +0100 --- /home/albinus/src/elpa/packages/disk-usage/disk-usage.el 2019-03-03 10:59:27.620803344 +0100 *************** *** 263,269 **** (and (file-accessible-directory-p directory) (directory-files-and-attributes directory ! 'full nil 'nosort))))) (or (cl-loop for l in listing for attributes = (cl-rest l) for path = (cl-first l) --- 263,270 ---- (and (file-accessible-directory-p directory) (directory-files-and-attributes directory ! 'full directory-files-no-dot-files-regexp ! 'nosort))))) (or (cl-loop for l in listing for attributes = (cl-rest l) for path = (cl-first l) *************** *** 280,288 **** :name path :size (file-attribute-size attributes)) ;; Folders ! else if (and (eq t (file-attribute-type attributes)) ! (not (string= "." (file-name-base path))) ! (not (string= ".." (file-name-base path)))) collect (disk-usage--file-info-make :name path --- 281,287 ---- :name path :size (file-attribute-size attributes)) ;; Folders ! else if (eq t (file-attribute-type attributes)) collect (disk-usage--file-info-make :name path *************** *** 305,313 **** "-type" "d") (buffer-string)) "\n" 'omit-nulls))) ! (cl-loop for dir in subdirs ! append (cl-loop for file in (directory-files-and-attributes dir 'full nil 'nosort) ! for name = (concat (file-remote-p directory) (car file)) for attributes = (cdr file) when (and attributes (not (file-attribute-type attributes)) --- 304,317 ---- "-type" "d") (buffer-string)) "\n" 'omit-nulls))) ! (cl-loop for dir in (mapcar (lambda (item) ! (concat (file-remote-p directory) item)) ! subdirs) ! append (cl-loop for file in (directory-files-and-attributes ! dir 'full ! directory-files-no-dot-files-regexp ! 'nosort) ! for name = (car file) for attributes = (cdr file) when (and attributes (not (file-attribute-type attributes)) --=-=-=--