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#55386: 29.0.50; check-declare-directory doesn't work on Windows Date: Sat, 14 May 2022 12:09:56 +0300 Message-ID: <83o800lbtn.fsf@gnu.org> References: <20220513.002244.1042559713148422728.yasu@utahime.org> <878rr6ycaa.fsf@gnus.org> <835ymapupz.fsf@gnu.org> <878rr5wrma.fsf@gnus.org> <83pmkhmwyv.fsf@gnu.org> <87a6bl305x.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38303"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yasu@utahime.org, 55386@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 14 11:11:13 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 1npnns-0009oO-Ix for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 May 2022 11:11:12 +0200 Original-Received: from localhost ([::1]:37272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npnnr-0002QD-8n for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 May 2022 05:11:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npnni-0002O6-FJ for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 05:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npnni-0002H1-5c for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 05:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npnni-0000xN-0g for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 05:11: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, 14 May 2022 09:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55386 X-GNU-PR-Package: emacs Original-Received: via spool by 55386-submit@debbugs.gnu.org id=B55386.16525194233615 (code B ref 55386); Sat, 14 May 2022 09:11:01 +0000 Original-Received: (at 55386) by debbugs.gnu.org; 14 May 2022 09:10:23 +0000 Original-Received: from localhost ([127.0.0.1]:45752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npnn4-0000wE-UK for submit@debbugs.gnu.org; Sat, 14 May 2022 05:10:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npnn4-0000vz-07 for 55386@debbugs.gnu.org; Sat, 14 May 2022 05:10:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52098) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npnmr-00019B-JV; Sat, 14 May 2022 05:10:09 -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=7Z1CAKLguTAT8/NIrwtwubq/6zn8TFuVw+gveb+DLAs=; b=b5FuEKEz7SdV n6AqHUQRGZvRdU+re9Vo4Zf/Ieu60lCCt0muujtKF3Dvba8+G5/ePLgqm3vuNrWevdr9GTbistPXP 2i3XJK4un1bT6gcE4Y6Aov4dhJc/KPn+4xfMAyMb/Z286aht48Ml9nCAN+S+FbzGO/GvfG53Zl2tT P3yccoYrg5Cu0aEqlk3PqI+2Xuc0FnIa/Zf2kg4HkczfKiJMbu63xIpdbuHc3UOtv5FxECBGWDQmP omSH1wvIis2udTqXSu3e2V+5IfiTEs5QcFzmCDc/mVbR3xa39zpJhGreQnodR0BtNX7a+czGGd/Ap GVU13XTsSWf89fuccmgThg==; Original-Received: from [87.69.77.57] (port=3844 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 1npnmk-0003Mh-Gd; Sat, 14 May 2022 05:10:03 -0400 In-Reply-To: <87a6bl305x.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 13 May 2022 17:46:50 +0200) 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:232224 Archived-At: > From: Lars Ingebrigtsen > Cc: yasu@utahime.org, 55386@debbugs.gnu.org > Date: Fri, 13 May 2022 17:46:50 +0200 > > Eli Zaretskii writes: > > > I'm not sure. How much time does it take for the find/grep command to > > finish working on our lisp/ directory on your system? > > Let's see... > > (benchmark-run (check-declare-directory "~/src/emacs/trunk/lisp/")) > > 11 seconds. Perhaps a pure-Lisp solution wouldn't be that much slower, > anyway? > > (Hm... it finds over a 100 in-tree declarations that it says are > malformed/wrong... Perhaps somebody should have a look at that.) Yes, please. > > And this command is not really time-critical anyway. > > That's true. > > > In any case, we could use the Lisp path only on Windows, since having > > a slower command is better than having a broken command. > > If we have a Lisp solution, I think I'd prefer to use that on all > platforms. Easier to debug when there only one code path, for one. How about the below? It's 3% to 9% slower than the find/grep version (because it examines more files, I think), but much simpler (IMNSHO), and works on any platform without any caveats. diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index b3c9651..83187ac 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -319,11 +319,7 @@ check-declare-directory (setq root (directory-file-name (file-relative-name root))) (or (file-directory-p root) (error "Directory `%s' not found" root)) - (let ((files (process-lines-ignore-status - find-program root - "-name" "*.el" - "-exec" grep-program - "-l" "^[ \t]*(declare-function" "{}" "+"))) + (let ((files (directory-files-recursively root "\\.el\\'"))) (when files (apply #'check-declare-files files))))