GNU bug report logs -
#55386
29.0.50; check-declare-directory doesn't work on Windows
Previous Next
Reported by: Yasuhiro Kimura <yasu <at> utahime.org>
Date: Thu, 12 May 2022 15:27:02 UTC
Severity: normal
Found in version 29.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #32 received at 55386 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: yasu <at> utahime.org, 55386 <at> debbugs.gnu.org
> Date: Fri, 13 May 2022 17:46:50 +0200
>
> Eli Zaretskii <eliz <at> 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))))
This bug report was last modified 235 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.