GNU bug report logs -
#66649
29.1; `project-remember-projects-under' behavior doesn't match its doc
Previous Next
Reported by: Damien Cassou <damien <at> cassou.me>
Date: Fri, 20 Oct 2023 11:50:01 UTC
Severity: normal
Found in version 29.1
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 8 Nov 2023 23:16:15 +0200
with message-id <dcd24b40-5dec-0f5b-497f-8956a1acd935 <at> yandex.ru>
and subject line Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc
has caused the debbugs.gnu.org bug report #66649,
regarding 29.1; `project-remember-projects-under' behavior doesn't match its doc
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
66649: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66649
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Hi,
the documentation of `project-remember-projects-under' is:
"Index all projects below a directory DIR. If RECURSIVE is
non-nil, recurse into all subdirectories to find more projects.
After finishing, a message is printed summarizing the progress. The
function returns the number of detected projects."
Regardless of the value of RECURSIVE, I understand from the above that
all child directories of the DIR argument will be investigated. The doc
doesn't say anything about investigating if DIR is itself a project or
not so I think it would make sense if the function wasn't.
But the code says otherwise (as far as I understand it):
(defun project-remember-projects-under (dir &optional recursive)
(let ((queue (list dir)))
;; …
(while queue
(when-let ((subdir (pop queue))
((file-directory-p subdir)))
;; maybe register `subdir' as a project
;; …
(when (and recursive (file-directory-p subdir))
(setq queue (nconc (directory-files subdir …) queue)))))))
The code above seems to investigate DIR first and, if RECURSIVE is
non-nil, look at the directories below it.
Also, the second check (file-directory-p subdir) seems unnecessary
because of the first one.
There is a part of the code I don't understand:
(unless (eq recursive 'in-progress)
It seems nowhere in the code nor in the documentation do we say anything
about this 'in-progress special value. Is it a left over from a previous
(recursive) version of the algorithm?
Best
--
Damien Cassou
"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
[Message part 3 (message/rfc822, inline)]
On 08/11/2023 23:13, Damien Cassou wrote:
> Dmitry Gutov<dgutov <at> yandex.ru> writes:
>> Damien, is there anything else here to do?
>>
>> Did you perhaps also (or instead) saw a problem with either of the
>> docstrings? I'm not sure if I understood the last complaint correctly.
>
> The bug can be closed, no problem.
>
> Thanks everyone for your great work.
Thanks for reporting!
This bug report was last modified 1 year and 251 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.