Close emacs when view/mode is closed

This commit is contained in:
2025-09-09 07:32:07 +02:00
parent 7cc80e8cf4
commit 8567e48c4c
5 changed files with 66 additions and 2 deletions

View File

@@ -11,6 +11,14 @@ if [ $# -eq 0 ]; then
(package-refresh-contents)
(package-install 'magit))
(require 'magit)
;; Quit Emacs when magit status buffer is killed
(add-hook 'magit-status-mode-hook
(lambda ()
(add-hook 'kill-buffer-hook
(lambda ()
(when (eq major-mode 'magit-status-mode)
(kill-emacs)))
nil t)))
(magit-status))"
else
# Use specified directory
@@ -25,5 +33,13 @@ else
(package-refresh-contents)
(package-install 'magit))
(require 'magit)
;; Quit Emacs when magit status buffer is killed
(add-hook 'magit-status-mode-hook
(lambda ()
(add-hook 'kill-buffer-hook
(lambda ()
(when (eq major-mode 'magit-status-mode)
(kill-emacs)))
nil t)))
(magit-status))"
fi