From bfd8247b3c438cafcd5390dcb1bfb7225076dbad Mon Sep 17 00:00:00 2001 From: josiah Date: Sat, 14 Jan 2023 11:21:40 -0600 Subject: [PATCH] Add function to force add existing buffer. This is mostly useful in the context of my ~/ dir commits. Now I dont have to shell out myself to do this! --- .emacs.d/jlj-generic.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.emacs.d/jlj-generic.el b/.emacs.d/jlj-generic.el index 84e1556..62bca83 100644 --- a/.emacs.d/jlj-generic.el +++ b/.emacs.d/jlj-generic.el @@ -261,6 +261,13 @@ (setq mu4e-view-show-images t)) +(defun magit-add-current-buffer () + "Adds (with force) the file from the current buffer to the git repo" + (interactive) + (shell-command (concat "git add -f " + (shell-quote-argument buffer-file-name)))) + + (server-start) ;;; jlj-generic.el ends here