]> git.eshelyaron.com Git - emacs.git/commitdiff
New project-save-some-buffers command
authorSean Whitton <spwhitton@spwhitton.name>
Sat, 15 Mar 2025 08:03:38 +0000 (16:03 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 16 Mar 2025 16:35:07 +0000 (17:35 +0100)
* 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)

lisp/progmodes/project.el

index a0edb177584714f1ff18b7695ccfc2e9b5c913f6..169f6156f5c29c1e0d1eb60fc15a2b9e8c44b913 100644 (file)
@@ -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)))
+
 \f
 ;;; Project list