From 8b3af62cc98a4eb178dd7e7529bd93ef39c86c49 Mon Sep 17 00:00:00 2001
From: Case Duckworth
Date: Tue, 27 Apr 2021 15:35:42 -0500
Subject: Add prefix arg to pull ~/.emacs from git

I could probably do better things with the output and error buffers.  Whatever.
---
 lisp/acdw.el | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lisp/acdw.el b/lisp/acdw.el
index 96b69f9..54b139c 100644
--- a/lisp/acdw.el
+++ b/lisp/acdw.el
@@ -54,9 +54,19 @@ each hook in HOOKS."
        ,@(dolist (hook hook-list hook-defun-add-hook-list)
            (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list)))))
 
-(defun refresh-emacs ()
-  "Reload Emacs's configuration files."
-  (interactive)
+(defun refresh-emacs (&optional git-pull-first)
+  "Reload Emacs's configuration files.
+
+With a prefix argument, run git pull on the repo first."
+  (interactive "P")
+  (when git-pull-first
+    (with-message "Pulling Emacs's configuration"
+      (shell-command (concat "git -C "
+                             "\"" (expand-file-name user-emacs-directory) "\""
+                             " pull")
+                     (get-buffer-create "*refresh-emacs-output*")
+                     (get-buffer-create "*refresh-emacs-error*"))))
+  
   (let ((init-files (append
                      ;; Load lisp libraries first, in case their functionality
                      ;; is used by {early-,}init.el
-- 
cgit 1.4.1-21-gabe81