Previously, project-kill-buffers always called (project-current t). A
Lisp program could change what project project-kill-buffers operated
on by binding project-current-directory-override. However, in some
edge cases (for example, if the project was deleted between looking it
up and calling project-kill-buffers) this might fail to detect a
project, and so (project-current t) would prompt the user.
To avoid this, accept the project to kill buffers for as an argument.
* lisp/progmodes/project.el (project-kill-buffers): Take project as an
optional argument (bug#72019).
(cherry picked from commit
6b2f51633e0f508d393516d6624e1a4ddaca31d1)
bufs))
;;;###autoload
-(defun project-kill-buffers (&optional no-confirm)
+(defun project-kill-buffers (&optional no-confirm project)
"Kill the buffers belonging to the current project.
Two buffers belong to the same project if their project
instances, as reported by `project-current' in each buffer, are
NO-CONFIRM is always nil when the command is invoked
interactively.
+If PROJECT is non-nil, kill buffers for that project instead.
+
Also see the `project-kill-buffers-display-buffer-list' variable."
(interactive)
- (let* ((pr (project-current t))
+ (let* ((pr (or project (project-current t)))
(bufs (project--buffers-to-kill pr))
(query-user (lambda ()
(yes-or-no-p