From 4b2e57e396314e63d70558e0aa5ad32c1cf87532 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 14 Jan 2022 17:20:23 -0600 Subject: David Bowie --- lisp/user-save.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lisp/user-save.el') diff --git a/lisp/user-save.el b/lisp/user-save.el index 63fe424..1284547 100644 --- a/lisp/user-save.el +++ b/lisp/user-save.el @@ -28,6 +28,12 @@ Emacs is killed." "Keymap for `user-save-mode'. This map shadows the default map for `save-buffer'.") +(defun user-save-run-hooks (&rest _) + "Run the hooks in `user-save-hook'. +This does /not/ also save the buffer." + (with-demoted-errors "User-save-hook error: %S" + (run-hooks 'user-save-hook))) + (defun user-save-buffer (&optional arg) "Save current buffer in visited file if modified. This function is precisely the same as `save-buffer', but with @@ -40,10 +46,10 @@ run all the time, put them in `user-save-hook'. ARG is passed directly to `save-buffer'." (interactive '(called-interactively)) - (message "Saving the buffer...") - (with-demoted-errors (run-hooks 'user-save-hook)) + (message "User-Saving the buffer...") + (user-save-run-hooks) (save-buffer arg) - (message "Saving the buffer...Done.")) + (message "User-Saving the buffer...Done.")) (defun user-save-some-buffers (&optional pred) "Save some buffers as though the user saved them. -- cgit 1.4.1-21-gabe81