Subject: bug#78099: [PATCH] Make 'project-remember-project' interactive

From: Dmitry Gutov <[email-masked]>
Date: Thu, 15 May 2025 02:32:55 +0300

On 30/04/2025 03:38, Elijah Gabe Pérez wrote:
>> On 27/04/2025 23:18, Elijah Gabe Pérez wrote:
>>> +  (interactive)
>> Something like
>>
>>    (interactive (list (project-current t)))
>>
>> should allow to keep PR a required argument.
> Thanks, done:

How about this? Modulo reindentation.

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 27b69277e81..e7ae7d282ab 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1933,12 +1933,18 @@ project-remember-project
  If project PR satisfies `project-list-exclude', then nothing is done.
  Save the result in `project-list-file' if the list of projects
  has changed, and NO-WRITE is nil."
-  (let ((root (project-root pr)))
-    (unless (seq-some (lambda (r)
+  (interactive (list (project-current t)))
+  (let ((root (project-root pr))
+        (interact (called-interactively-p 'any)))
+    (if     (seq-some (lambda (r)
                          (if (functionp r)
                              (funcall r pr)
                            (string-match-p r root)))
                        project-list-exclude)
+        (when interact
+          (message "Current project is blacklisted!"))
+      (when interact
+        (message "Current project remembered"))
        (project--remember-dir root no-write))))

  (defun project--remove-from-project-list (project-root report-message)