diff options
| author | Sean Whitton | 2025-03-15 16:03:38 +0800 |
|---|---|---|
| committer | Sean Whitton | 2025-03-16 11:31:55 +0800 |
| commit | db0bed7a68cd2308eba61247a6a77f73533ffef6 (patch) | |
| tree | 2798889f8c179a39544b83cad3dfa5b62ce04151 | |
| parent | 6f483ffdc217ea9f8dc079b2344f771214222273 (diff) | |
| download | emacs-db0bed7a68cd2308eba61247a6a77f73533ffef6.tar.gz emacs-db0bed7a68cd2308eba61247a6a77f73533ffef6.zip | |
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.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/progmodes/project.el | 7 |
2 files changed, 11 insertions, 0 deletions
| @@ -362,6 +362,10 @@ invoked standalone or from the 'project-switch-commands' dispatch menu. | |||
| 362 | This user option describes projects that should always be skipped by | 362 | This user option describes projects that should always be skipped by |
| 363 | 'project-remember-project'. | 363 | 'project-remember-project'. |
| 364 | 364 | ||
| 365 | --- | ||
| 366 | *** New command 'project-save-some-buffers' bound to 'C-x p C-x s'. | ||
| 367 | This is like 'C-x s', but only for this project's buffers. | ||
| 368 | |||
| 365 | ** Registers | 369 | ** Registers |
| 366 | 370 | ||
| 367 | *** New functions 'buffer-to-register' and 'file-to-register'. | 371 | *** New functions 'buffer-to-register' and 'file-to-register'. |
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d954b78a745..e2cd5bfa231 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -903,6 +903,7 @@ DIRS must contain directory names." | |||
| 903 | (define-key map "x" 'project-execute-extended-command) | 903 | (define-key map "x" 'project-execute-extended-command) |
| 904 | (define-key map "o" 'project-any-command) | 904 | (define-key map "o" 'project-any-command) |
| 905 | (define-key map "\C-b" 'project-list-buffers) | 905 | (define-key map "\C-b" 'project-list-buffers) |
| 906 | (define-key map "\C-xs" 'project-save-some-buffers) | ||
| 906 | map) | 907 | map) |
| 907 | "Keymap for project commands.") | 908 | "Keymap for project commands.") |
| 908 | 909 | ||
| @@ -1828,6 +1829,12 @@ Also see the `project-kill-buffers-display-buffer-list' variable." | |||
| 1828 | ((funcall query-user) | 1829 | ((funcall query-user) |
| 1829 | (mapc #'kill-buffer bufs))))) | 1830 | (mapc #'kill-buffer bufs))))) |
| 1830 | 1831 | ||
| 1832 | ;;;###autoload | ||
| 1833 | (defun project-save-some-buffers (arg) | ||
| 1834 | "Like `save-some-buffers', but only for this project's buffers." | ||
| 1835 | (interactive "P") | ||
| 1836 | (save-some-buffers arg (save-some-buffers-root))) | ||
| 1837 | |||
| 1831 | 1838 | ||
| 1832 | ;;; Project list | 1839 | ;;; Project list |
| 1833 | 1840 | ||