From 3b9b91686f15492bfe7652c26a9698b3ef6524ae Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 7 Feb 2022 13:14:10 -0600 Subject: Unglobify user-save-mode --- lisp/user-save.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/user-save.el b/lisp/user-save.el index 1284547..8e01af1 100644 --- a/lisp/user-save.el +++ b/lisp/user-save.el @@ -73,9 +73,16 @@ whether the buffer needs to be saved." (define-minor-mode user-save-mode "Mode to enable an an extra user-save hook." :lighter " US" - :global t - :keymap 'user-save-mode-map - (if user-save-mode + :keymap user-save-mode-map) + +;;;###autoload +(defun turn-off-user-save-mode () + "Turn off `user-save-mode' in the current buffer." + (user-save-mode -1)) + +;;;###autoload +(define-globalized-minor-mode user-save-global-mode user-save-mode user-save-mode + (if user-save-global-mode (when user-save-hook-into-kill-emacs (add-hook 'kill-emacs-hook #'user-save-some-buffers)) (remove-hook 'kill-emacs-hook #'user-save-some-buffers))) -- cgit 1.4.1-21-gabe81