Sometimes I am interrupted while coding and forget to commit. I would like to be warned about this next time I open a file with uncommited changes.
I tried
(defun my/magit-check-file-and-popup (file)
"If the file is version controlled with git and has uncommitted
changes, open the magit status popup."
(require 'magit-core)
(when (and file (magit-anything-modified-p t file))
(magit-status)))
(add-hook 'after-load-functions 'my/magit-check-file-and-popup)
which worked for a while, but after recent package updates it goes into recursive require
, so I guess it is not the right approach. Using Emacs 25.2.2 if that matters, and latest magit
from MELPA.
(require 'magit)
?