unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: yasu@utahime.org, 55386@debbugs.gnu.org
Subject: bug#55386: 29.0.50; check-declare-directory doesn't work on Windows
Date: Sat, 14 May 2022 12:09:56 +0300	[thread overview]
Message-ID: <83o800lbtn.fsf@gnu.org> (raw)
In-Reply-To: <87a6bl305x.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri,  13 May 2022 17:46:50 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: yasu@utahime.org,  55386@debbugs.gnu.org
> Date: Fri, 13 May 2022 17:46:50 +0200
> 
> Eli Zaretskii <eliz@gnu.org> 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))))
 





  reply	other threads:[~2022-05-14  9:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 15:22 bug#55386: 29.0.50; check-declare-directory doesn't work on Windows Yasuhiro Kimura
2022-05-12 15:57 ` Lars Ingebrigtsen
2022-05-12 16:43   ` Eli Zaretskii
2022-05-13 12:21     ` Lars Ingebrigtsen
2022-05-13 12:35       ` Eli Zaretskii
2022-05-13 15:46         ` Lars Ingebrigtsen
2022-05-14  9:09           ` Eli Zaretskii [this message]
2022-05-14 11:40             ` Lars Ingebrigtsen
2022-05-14 12:05               ` Eli Zaretskii
2022-05-14 15:36                 ` Lars Ingebrigtsen
2022-05-14 16:09                   ` Eli Zaretskii
2022-05-14 13:27             ` Eli Zaretskii
2022-05-14 13:39               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-14 13:44                 ` Eli Zaretskii
2022-05-14 15:37               ` Lars Ingebrigtsen
2022-05-14 16:34                 ` Eli Zaretskii
2022-05-12 17:35   ` Yasuhiro Kimura
2022-05-13 12:25     ` Lars Ingebrigtsen
2022-05-13 12:31       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o800lbtn.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=55386@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=yasu@utahime.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).