From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Cummings Newsgroups: gmane.emacs.bugs Subject: bug#50630: [PATCH] Add tests for insert-directory Date: Sat, 25 Sep 2021 17:15:21 +0000 Message-ID: References: <83a6k1rxrc.fsf@gnu.org> <83ilyorei3.fsf@gnu.org> <83bl4gr9gr.fsf@gnu.org> Reply-To: John Cummings Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12791"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50630@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 25 19:16:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUBHc-000345-U5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Sep 2021 19:16:17 +0200 Original-Received: from localhost ([::1]:53042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUBHZ-0000le-NB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Sep 2021 13:16:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUBHO-0000l6-Dy for bug-gnu-emacs@gnu.org; Sat, 25 Sep 2021 13:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51253) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUBHO-0000V7-6R for bug-gnu-emacs@gnu.org; Sat, 25 Sep 2021 13:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUBHO-0004gl-2S for bug-gnu-emacs@gnu.org; Sat, 25 Sep 2021 13:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Cummings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Sep 2021 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50630 X-GNU-PR-Package: emacs Original-Received: via spool by 50630-submit@debbugs.gnu.org id=B50630.163259014217985 (code B ref 50630); Sat, 25 Sep 2021 17:16:02 +0000 Original-Received: (at 50630) by debbugs.gnu.org; 25 Sep 2021 17:15:42 +0000 Original-Received: from localhost ([127.0.0.1]:34563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUBH3-0004g1-C4 for submit@debbugs.gnu.org; Sat, 25 Sep 2021 13:15:41 -0400 Original-Received: from mail-4323.protonmail.ch ([185.70.43.23]:43679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUBGr-0004fR-FF for 50630@debbugs.gnu.org; Sat, 25 Sep 2021 13:15:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rootabega.net; s=protonmail; t=1632590122; bh=aagfMUsE/x4VPKCxwMcd1V2vyWtw5Z1REpERflJ4EFM=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=txjkgmPk5NG5SVePQrK0eDljkml5P35Y4EmaPRl7OyCTOO7U+RmumSSQKMbkwU/6x VPNPagzHGu+d+rgGY+EKiYf3zxkWsmzl/STadxVToxdUKVEOjLe/rfjxqMbyuguTEZ h8FtQ6pjIas0OjYhSvZAfh8dJn4hp2fyBKUAllstxXixGShg0vUan84tAd2k1hFmfT gADxHDJVEip8lM480Cn8rGIbaPkjcdQo6dkB7TsYR5VL5VJ640F1dAxV2U8V+18n5h 01Bv3JUZqLOOrKS2DIkPG2sSR1ytm6hHuQGVMG7fgsuozb7JLMmoh1BZpo7UQjdWJZ 2nTc8g9c/A0Ng== In-Reply-To: <83bl4gr9gr.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:215479 Archived-At: >> I and others found that the same problem was duplicated in ls-lisp.el >> and tramp-sh.el, and I provided instructions to reproduce attached >> earlier in the thread: >> https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-09/msg01813.html > That recipe invokes insert-directory in some arbitrary way, which is > probably different from what happens when one invokes Dired. So I'm > not sure we should worry about that. But anyway, I tried that recipe > on MS-Windows, and I don't see the problem: the values shown on the > first line reflect my home directory, not pwd-a or pwd-b. I'm replying only to this part for now, because we need to agree on the facts in order to do anything else. If what you say is accurate, then this bug may not really exist as I've described it, but I think I've done everything reasonable to eliminate that possibility. Are you sure that you picked values for pwd-a and pwd-b that would have different amounts of available space on MS-Windows, like two drive letters on physically separate disks? But if Windows uses ls-lisp for this, we should see the same results on any system using ls-lisp, so I think it's OK to focus on ls-lisp and forget about MS-Windows for the purposes of this reply. I tried to supply values for pwd-a and pwd-b that would be under different mount points on a Unix-like system, / and /proc, but if your system is different, you may need to pick different Unix-like values for those, too. I just built 285f59cbe230701f15d28dfe8036cf2feb9d1d31 (terminal only) from a brand new git clone on Ubuntu 20,and here are the results of the recipes. I'll use a "[" character to quote the text I copied off my terminal: files.el (this case is already fixed): [emacsdev@ubuntu:~/freshemacs/emacs$ src/emacs -Q --eval "\ [> (progn \ [> (setq pwd-a \"/\") \ [> (setq pwd-b \"/proc\") \ [> (setq list-dir \"~\") \ [> (with-current-buffer-window \"a\" nil nil \ [> (cd pwd-a) \ [> (insert-directory list-dir \"-l\" nil t) \ [> (insert (format \"listing of %s in cwd %s\" list-dir (pwd)))) \ [> (with-current-buffer-window \"b\" nil nil \ [> (cd pwd-b) \ [> (insert-directory list-dir \"-l\" nil t) \ [> (insert (format \"listing of %s in cwd %s\" list-dir (pwd)))) \ [> (switch-to-buffer \"a\") \ [> (switch-to-buffer-other-window \"b\"))" Resulting Emacs frame: [File Edit Options Buffers Tools Help [total used in directory 0 available 7.6 GiB [lrwxrwxrwx 1 emacsdev emacsdev 26 Sep 24 12:18 emacs -> /media/ubuntu/tur= key/emacs [lrwxrwxrwx 1 emacsdev emacsdev 31 Sep 25 12:26 freshemacs -> /media/ubunt= u/turkey/freshemacs [listing of ~ in cwd Directory / [ [ [ [ [ [ [ [-UUU:%%--F1 a All L1 (Fundamental) --------------------= --------------------- [total used in directory 0 available 7.6 GiB [lrwxrwxrwx 1 emacsdev emacsdev 26 Sep 24 12:18 emacs -> /media/ubuntu/tur= key/emacs [lrwxrwxrwx 1 emacsdev emacsdev 31 Sep 25 12:26 freshemacs -> /media/ubunt= u/turkey/freshemacs [listing of ~ in cwd Directory /proc/ [ [ [ [ [ [ [-UUU:%%--F1 b All L1 (Fundamental) --------------------= --------------------- [ ls-lisp.el (not fixed yet): [emacsdev@ubuntu:~/freshemacs/emacs$ src/emacs -Q --eval "\ [> (progn \ [> (setq pwd-a \"/\") \ [> (setq pwd-b \"/proc\") \ [> (setq list-dir \"~\") \ [> (require 'ls-lisp) \ [> (setq ls-lisp-use-insert-directory-program nil) \ [> (with-current-buffer-window \"a\" nil nil \ [> (cd pwd-a) \ [> (insert-directory list-dir \"-l\" nil t) \ [> (insert (format \"listing of %s in cwd %s\" list-dir (pwd)))) \ [> (with-current-buffer-window \"b\" nil nil \ [> (cd pwd-b) \ [> (insert-directory list-dir \"-l\" nil t) \ [> (insert (format \"listing of %s in cwd %s\" list-dir (pwd)))) \ [> (switch-to-buffer \"a\") \ [> (switch-to-buffer-other-window \"b\"))" Resulting Emacs frame with different available space: [File Edit Options Buffers Tools Help [total used in directory 1 available 7.6 GiB [lrwxrwxrwx 1 emacsdev emacsdev 26 09-24 12:18 emacs -> /media/ubuntu/tur= key/emacs [lrwxrwxrwx 1 emacsdev emacsdev 31 09-25 12:26 freshemacs -> /media/ubunt= u/turkey/freshemacs [listing of ~ in cwd Directory / [ [ [ [ [ [ [ [-UUU:%%--F1 a All L1 (Fundamental) --------------------= --------------------- [total used in directory 1 available 0 B [lrwxrwxrwx 1 emacsdev emacsdev 26 09-24 12:18 emacs -> /media/ubuntu/tur= key/emacs [lrwxrwxrwx 1 emacsdev emacsdev 31 09-25 12:26 freshemacs -> /media/ubunt= u/turkey/freshemacs [listing of ~ in cwd Directory /proc/ [ [ [ [ [ [ [-UUU:%%--F1 b All L1 (Fundamental) --------------------= --------------------- [ tramp-sh.el (not fixed yet): [emacsdev@ubuntu:~/freshemacs/emacs$ src/emacs -Q --eval "\ [> (progn \ [> (setq pwd-a \"/\") \ [> (setq pwd-b \"/proc\") \ [> (setq list-dir \"/ssh:emacsdev@localhost:~/\") \ [> (require 'tramp) \ [> (setq ls-lisp-use-insert-directory-program t) \ [> (with-current-buffer-window \"a\" nil nil \ [> (cd pwd-a) \ [> (insert-directory list-dir \"-l\" nil t) \ [> (insert (format \"listing of %s in cwd %s\" list-dir (pwd)))) \ [> (with-current-buffer-window \"b\" nil nil \ [> (cd pwd-b) \ [> (insert-directory list-dir \"-l\" nil t) \ [> (insert (format \"listing of %s in cwd %s\" list-dir (pwd)))) \ [> (switch-to-buffer \"a\") \ [> (switch-to-buffer-other-window \"b\"))" Resulting Emacs frame with different available space: [File Edit Options Buffers Tools Help [total used in directory 0 available 7.6 GiB [lrwxrwxrwx 1 emacsdev emacsdev 26 Sep 24 12:18 emacs -> /media/ubuntu/tur= key/emacs [lrwxrwxrwx 1 emacsdev emacsdev 31 Sep 25 12:26 freshemacs -> /media/ubunt= u/turkey/freshemacs [listing of /ssh:emacsdev@localhost:~/ in cwd Directory / [ [ [ [ [ [ [ [-UUU:%%--F1 a All L1 (Fundamental) --------------------= --------------------- [total used in directory 0 available 0 B [lrwxrwxrwx 1 emacsdev emacsdev 26 Sep 24 12:18 emacs -> /media/ubuntu/tur= key/emacs [lrwxrwxrwx 1 emacsdev emacsdev 31 Sep 25 12:26 freshemacs -> /media/ubunt= u/turkey/freshemacs [listing of /ssh:emacsdev@localhost:~/ in cwd Directory /proc/ [ [ [ [ [ [ [-UUU:%%--F1 b All L1 (Fundamental) --------------------= --------------------- [