Subject: Re: bug#71115: [PATCH] Fix usage of cons cells in grep-find-ignored-files

From: Dmitry Gutov <[email-masked]>
Date: Wed, 22 May 2024 21:03:37 +0300

Hi Spencer,

Thanks a lot.

On 22/05/2024 15:28, Spencer Baugh wrote:
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -295,7 +295,7 @@ project-name
>   Nominally unique, but not enforced."
>     (file-name-nondirectory (directory-file-name (project-root project))))
>   
> -(cl-defgeneric project-ignores (_project _dir)
> +(cl-defgeneric project-ignores (_project dir)
>     "Return the list of glob patterns to ignore inside DIR.
>   Patterns can match both regular files and directories.
>   To root an entry, start it with `./'.  To match directories only,
> @@ -304,13 +304,13 @@ project-ignores
>     ;; TODO: Document and support regexp ignores as used by Hg.
>     ;; TODO: Support whitelist entries.
>     (require 'grep)
> -  (defvar grep-find-ignored-files)
> +  (declare-function grep-find-ignored-files "grep" (dir))
>     (nconc
>      (mapcar
>       (lambda (dir)
>         (concat dir "/"))
>       vc-directory-exclusion-list)
> -   grep-find-ignored-files))
> +   (grep-find-ignored-files dir)))

There is just one problem that project.el is supposed to be usable in 
Emacs 26+.

I suppose that a little fboundp check will get us around the problem.