Subject: bug#69084: closed (Re: bug#69084: 30; check-declare-directory chokes on lock files)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 01 Mar 2025 03:35:03 +0000

Your bug report

#69084: 30; check-declare-directory chokes on lock files

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
69084: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69084
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#69084: 30; check-declare-directory chokes on lock files
From: Stefan Kangas <[email-masked]>
To: Jonas Bernoulli <[email-masked]>
Cc: Eli Zaretskii <[email-masked]>, [email-masked]
Date: Fri, 28 Feb 2025 19:34:51 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Jonas Bernoulli <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>>> Date: Mon, 12 Feb 2024 20:26:57 +0100
>>> From:  Jonas Bernoulli via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <[email-masked]>
>>>
>>> `check-declare-directory' chokes on lock files for libraries:
>>>
>>>   check-declare-scan: Opening input file: No such file or directory,
>>>     /home/jonas/.config/emacs/lib/forge/lisp/.#forge-pullreq.el
>>>
>>> This simple change would take care of that:
>>>
>>> diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
>>> @@ -328,7 +328,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 (directory-files-recursively root "\\.el\\'")))
>>> +  (let ((files (directory-files-recursively root "\\`[^.].*\\.el\\'")))
>>>      (when files
>>>        (apply #'check-declare-files files))))
>>>
>>> I am not sure this is acceptable as it would also skip over other hidden
>>> files.  IMO that would be okay; libraries arguably shouldn't be hidden
>>> files.
>>
>> Why not exempt specifically the lock files, i.e. those whose basename
>> begins with ".#"?  That can be done with an additional test on the
>> candidate file names returned by directory-files-recursively.
>>
>> WDYT?
>
> I've gone with the approach you suggested.

The patch was installed, so I'm closing this bug report.

Subject: 30; check-declare-directory chokes on lock files
From: Jonas Bernoulli <[email-masked]>
To: [email-masked]
Date: Mon, 12 Feb 2024 20:26:57 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

`check-declare-directory' chokes on lock files for libraries:

  check-declare-scan: Opening input file: No such file or directory,
    /home/jonas/.config/emacs/lib/forge/lisp/.#forge-pullreq.el

This simple change would take care of that:

diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
@@ -328,7 +328,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 (directory-files-recursively root "\\.el\\'")))
+  (let ((files (directory-files-recursively root "\\`[^.].*\\.el\\'")))
     (when files
       (apply #'check-declare-files files))))

I am not sure this is acceptable as it would also skip over other hidden
files.  IMO that would be okay; libraries arguably shouldn't be hidden
files.

     Cheers,
     Jonas