summary refs log tree commit diff stats
path: root/lisp/user-save.el
diff options
context:
space:
mode:
authorCase Duckworth2022-01-14 17:20:23 -0600
committerCase Duckworth2022-01-14 17:20:23 -0600
commit4b2e57e396314e63d70558e0aa5ad32c1cf87532 (patch)
treebcd7ccb4c2fac92f7b93702e2c9ec5fa21e4a068 /lisp/user-save.el
parentMerge branch 'main' of https://tildegit.org/acdw/emacs (diff)
downloademacs-4b2e57e396314e63d70558e0aa5ad32c1cf87532.tar.gz
emacs-4b2e57e396314e63d70558e0aa5ad32c1cf87532.zip
David Bowie
Diffstat (limited to 'lisp/user-save.el')
-rw-r--r--lisp/user-save.el12
1 files changed, 9 insertions, 3 deletions
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."
28 "Keymap for `user-save-mode'. 28 "Keymap for `user-save-mode'.
29This map shadows the default map for `save-buffer'.") 29This map shadows the default map for `save-buffer'.")
30 30
31(defun user-save-run-hooks (&rest _)
32 "Run the hooks in `user-save-hook'.
33This does /not/ also save the buffer."
34 (with-demoted-errors "User-save-hook error: %S"
35 (run-hooks 'user-save-hook)))
36
31(defun user-save-buffer (&optional arg) 37(defun user-save-buffer (&optional arg)
32 "Save current buffer in visited file if modified. 38 "Save current buffer in visited file if modified.
33This function is precisely the same as `save-buffer', but with 39This function is precisely the same as `save-buffer', but with
@@ -40,10 +46,10 @@ run all the time, put them in `user-save-hook'.
40 46
41ARG is passed directly to `save-buffer'." 47ARG is passed directly to `save-buffer'."
42 (interactive '(called-interactively)) 48 (interactive '(called-interactively))
43 (message "Saving the buffer...") 49 (message "User-Saving the buffer...")
44 (with-demoted-errors (run-hooks 'user-save-hook)) 50 (user-save-run-hooks)
45 (save-buffer arg) 51 (save-buffer arg)
46 (message "Saving the buffer...Done.")) 52 (message "User-Saving the buffer...Done."))
47 53
48(defun user-save-some-buffers (&optional pred) 54(defun user-save-some-buffers (&optional pred)
49 "Save some buffers as though the user saved them. 55 "Save some buffers as though the user saved them.