MaDots: kill buffers (doesn't totally work but does help)

This commit is contained in:
MitchMarq42 2023-01-03 12:01:43 -09:00
parent 0ac1e0d7b4
commit 04722d635b

View File

@ -814,6 +814,7 @@ Return nil if DIR is not in a hugo project at all."
(if (not (madots--magit-buffers-p)) (if (not (madots--magit-buffers-p))
(progn (progn
(setq magit-git-executable madots--old-magit-exe) (setq magit-git-executable madots--old-magit-exe)
(setq magit-bury-buffer-function madots--old-magit-bury-buf-func)
(cancel-function-timers #'madots--cleanup)))) (cancel-function-timers #'madots--cleanup))))
(defun madots (&optional exe) (defun madots (&optional exe)
"Magit but with custom EXE, default \"dots\"." "Magit but with custom EXE, default \"dots\"."
@ -821,6 +822,8 @@ Return nil if DIR is not in a hugo project at all."
(require 'magit) (require 'magit)
(setq madots--old-magit-exe magit-git-executable) (setq madots--old-magit-exe magit-git-executable)
(setq magit-git-executable (or exe "dots")) (setq magit-git-executable (or exe "dots"))
(setq madots--old-magit-bury-buf-func magit-bury-buffer-function)
(setq magit-bury-buffer-function #'kill-buffer-and-window)
(magit-status) (magit-status)
(run-with-timer 5 3 #'madots--cleanup))) (run-with-timer 5 3 #'madots--cleanup)))