From: Sean Whitton <spwhitton@spwhitton.name>
Date: Sat, 15 Mar 2025 08:03:38 +0000 (+0800)
Subject: New project-save-some-buffers command
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8619e0de6bdfcd9344fd96b0346672e6681411e8;p=emacs.git

New project-save-some-buffers command

* lisp/progmodes/project.el (project-save-some-buffers): New command.
(project-prefix-map): Bind it to C-x p C-x s.
* etc/NEWS: Announce the new command and binding.

(cherry picked from commit db0bed7a68cd2308eba61247a6a77f73533ffef6)
---

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index a0edb177584..169f6156f5c 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -902,6 +902,7 @@ DIRS must contain directory names."
     (define-key map "o" 'project-any-command)
     (define-key map "\C-b" 'project-list-buffers)
     (define-key map "`" 'project-go-to-diagnostic)
+    (define-key map "\C-xs" 'project-save-some-buffers)
     map)
   "Keymap for project commands.")
 
@@ -1755,6 +1756,12 @@ Also see the `project-kill-buffers-display-buffer-list' variable."
           ((funcall query-user)
            (mapc #'kill-buffer bufs)))))
 
+;;;###autoload
+(defun project-save-some-buffers (arg)
+  "Like `save-some-buffers', but only for this project's buffers."
+  (interactive "P")
+  (save-some-buffers arg (save-some-buffers-root)))
+
 
 ;;; Project list