GNU bug report logs - #69084
30; check-declare-directory chokes on lock files

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Mon, 12 Feb 2024 19:56:02 UTC

Severity: normal

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69084 in the body.
You can then email your comments to 69084 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69084; Package emacs. (Mon, 12 Feb 2024 19:56:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonas Bernoulli <jonas <at> bernoul.li>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 Feb 2024 19:56:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: bug-gnu-emacs <at> gnu.org
Subject: 30; check-declare-directory chokes on lock files
Date: Mon, 12 Feb 2024 20:26:57 +0100
`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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69084; Package emacs. (Thu, 15 Feb 2024 08:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 69084 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jonas Bernoulli <jonas <at> bernoul.li>
Cc: 69084 <at> debbugs.gnu.org
Subject: Re: bug#69084: 30; check-declare-directory chokes on lock files
Date: Thu, 15 Feb 2024 10:48:01 +0200
> 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" <bug-gnu-emacs <at> 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.

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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69084; Package emacs. (Tue, 20 Feb 2024 21:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 69084 <at> debbugs.gnu.org (full text, mbox):

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69084 <at> debbugs.gnu.org
Subject: Re: bug#69084: 30; check-declare-directory chokes on lock files
Date: Tue, 20 Feb 2024 22:54:47 +0100
Eli Zaretskii <eliz <at> gnu.org> 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" <bug-gnu-emacs <at> 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.
>
> 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.




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sat, 01 Mar 2025 03:35:03 GMT) Full text and rfc822 format available.

Notification sent to Jonas Bernoulli <jonas <at> bernoul.li>:
bug acknowledged by developer. (Sat, 01 Mar 2025 03:35:03 GMT) Full text and rfc822 format available.

Message #16 received at 69084-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Jonas Bernoulli <jonas <at> bernoul.li>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 69084-done <at> debbugs.gnu.org
Subject: Re: bug#69084: 30; check-declare-directory chokes on lock files
Date: Fri, 28 Feb 2025 19:34:51 -0800
Jonas Bernoulli <jonas <at> bernoul.li> writes:

> Eli Zaretskii <eliz <at> gnu.org> 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" <bug-gnu-emacs <at> 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.
>>
>> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 29 Mar 2025 11:24:42 GMT) Full text and rfc822 format available.

This bug report was last modified 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.