From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#55894: 26.3; [PATCH] `find-lisp.el' bugs Date: Sat, 11 Jun 2022 09:01:55 +0300 Message-ID: <83edzvzqjw.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5536"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55894@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 11 08:04:48 2022 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 1nzuEp-0001Gh-Nh for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Jun 2022 08:04:47 +0200 Original-Received: from localhost ([::1]:39750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzuEo-0007v1-EO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Jun 2022 02:04:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzuD8-0007uX-Jm for bug-gnu-emacs@gnu.org; Sat, 11 Jun 2022 02:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzuD8-0002cx-BX for bug-gnu-emacs@gnu.org; Sat, 11 Jun 2022 02:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzuD8-0000Du-4E for bug-gnu-emacs@gnu.org; Sat, 11 Jun 2022 02:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Jun 2022 06:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 55894-submit@debbugs.gnu.org id=B55894.1654927326782 (code B ref 55894); Sat, 11 Jun 2022 06:03:02 +0000 Original-Received: (at 55894) by debbugs.gnu.org; 11 Jun 2022 06:02:06 +0000 Original-Received: from localhost ([127.0.0.1]:51731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzuCD-0000CY-L8 for submit@debbugs.gnu.org; Sat, 11 Jun 2022 02:02:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzuCA-0000C3-G5 for 55894@debbugs.gnu.org; Sat, 11 Jun 2022 02:02:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzuC4-0002Ws-Of; Sat, 11 Jun 2022 02:01:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ovRA1GubgEewK9vb3LsdULKV8KOZ65znpjfZgHNbJac=; b=OJqL5yTAfFW0 cv1CaAIY3dKjDonYGNGh98D/WkI8RHNNs6a4WqNCQMKtwV+n1ITahyy1FHdHjYesqkwuzmyhtKM4I sfitpMsn/RROhbfxc0jfpBdJqnZu643DvoUFK6l9s1yoBAraNI4vH4PojCif6QrSa+/n3pFdIiL5w jbvYmHYZRoqn8K+KsFnEKcFBI9XTMblG0FJXsiXAmlDCO0TfTNjxMXB7nlGwSEcfhCUC2ST31Vz+o 5rhdGsQc3V6um/putu3yPQ7Vrid1KUZfe12L/t7z/DN7d2QkR4m9GZzUpHmtErDrAi0z8wVXaiv37 eFG4TNzD3FgbGEMsvgF6nw==; Original-Received: from [87.69.77.57] (port=4983 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzuC2-0006SL-SZ; Sat, 11 Jun 2022 02:01:55 -0400 In-Reply-To: (message from Drew Adams on Fri, 10 Jun 2022 22:06:58 +0000) 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:234249 Archived-At: > From: Drew Adams > Date: Fri, 10 Jun 2022 22:06:58 +0000 > > `find-lisp.el' is an old file that doesn't seem to have gotten much > love. It's apparently been updated just to change things like use of > (set (make-local-variable...)) to (setq-local...). > > (I wasn't aware of this library till I saw a blog post by Micky Petersen: > https://www.masteringemacs.org/article/working-multiple-files-dired.) > > The attached patch fixes a few bugs that prevent using it in some > important ways: (1) opening a Dired buffer that explicitly lists its > listed files or dirs (i.e. a snapshot Dired buffer, where DIRNAME is a > cons), (2) using its listing with a `dired-actual-switches' value that > contains switch `F', (3) properly handling a listed file or dir name > that starts with a space char. Thanks. > (defun find-lisp-find-dired-subdirectories (dir) > "Find all subdirectories of DIR." > - (interactive "DFind subdirectories of directory: ") > + (interactive "DDired descendent dirs of directory: ") I find the new prompt much more cryptic than the old one. Can this be improved, please? For example, would Find and dired subdirectories of directory: be okay? > - "Run find (Lisp version) and go into Dired mode on a buffer of the output." > - (let ((dired-buffers dired-buffers) > - (regexp find-lisp-regexp)) > - ;; Expand DIR ("" means default-directory), and make sure it has a > - ;; trailing slash. > + directory-predicate buffer-name > + &optional other-window) > + "Run Lisp version of `find', then dired the result." Here, the existing doc string explains better what the function does. I don't think relying too much on the assumption that "dired SOMETHING" should be clear to users is a good idea. One cannot find such a verb in a dictionary, and we don't use that widely enough in our documentation. So explanations of that term would help clarifying the meaning. > (defun find-lisp-find-dired-insert-file (file buffer) > + "Insert line for FILE in BUFFER. > +FILE is a file or a directory name. > +If `dired-actual-switches' is non-nil in BUFFER then preserve it." What does it mean in this context to "preserve it"? This part of the doc string is not clear. > (defun find-lisp-format (file-name file-attr switches now) > - "Format one line of long ls output for file FILE-NAME. > + "Format one line of long `ls' output for file or directory FILE-NAME. The comment says this was lifted from ls-lisp.el, but the latter has since improved its formatting capabilities _a_lot_. How about making this version more like what ls-lisp.el does nowadays. In particular, this: > - (if (stringp file-type) ; is a symbolic link > - (concat " -> " file-type) > - "") > + (and (eq t file-type) (memq ?F switches) > + "/") ; Add `/' for dir if `F' switch > + (and (stringp file-type) > + (concat " -> " file-type)) ; Add " -> " for symbolic link > "\n"))) is treated much more thoroughly now in ls-lisp.el, recognizing more file types than just symlinks and directories. I think we should do the same here.