remove all my madots stuff. giving up on that whole thing

This commit is contained in:
Miranda Marquez 2024-10-20 09:15:08 -08:00
parent c5a6cb7833
commit f8ae2a6225

33
init.el
View File

@ -1089,41 +1089,12 @@ Return nil if DIR is not in a hugo project at all."
(use-package transient :ensure t) (use-package transient :ensure t)
(use-package magit (use-package magit
:after seq :after seq
:commands (madots magit-status magit) :commands (magit-status magit)
:hook (magit-mode . turn-off-line-numbers) :hook (magit-mode . turn-off-line-numbers)
:custom (vc-follow-symlinks t) :custom (vc-follow-symlinks t)
(transient-history-file (transient-history-file
(expand-file-name "transient/history.el" backup-directory)) (expand-file-name "transient/history.el" backup-directory))
:config )
(defun madots--magit-buffers-p ()
(not (not ; converts all non-nil values to t
(remove nil ; clean useless elements
(mapcar (lambda (buffer)
(if (string-match-p "magit: " (buffer-name buffer))
buffer))
(buffer-list))))))
(defun madots--kill-all-magit-buffers ()
(mapcar (lambda (buffer)
(if (string-match-p "^magit" (buffer-name buffer))
(kill-buffer buffer)))
(buffer-list)))
(defun madots--cleanup ()
"Remove modifications made for `madots' once all magit buffers are killed."
(if (not (madots--magit-buffers-p))
(progn
(setq magit-git-executable madots--old-magit-exe)
(setq magit-bury-buffer-function madots--old-magit-bury-buf-func)
(cancel-function-timers #'madots--cleanup))))
(defun madots (&optional exe)
"Magit but with custom EXE, default \"dots\"."
(interactive)
(require 'magit)
(setq madots--old-magit-exe magit-git-executable)
(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)
(run-with-timer 5 3 #'madots--cleanup)))
;; ;; broken bc of hl-todo version issue ;; ;; broken bc of hl-todo version issue
;; (use-package magit-todos ;; (use-package magit-todos
;; :after magit ;; :after magit