]> git.earman.xyz Git - emacsinit.git/commitdiff
Break out vc-defuns into its own feature
authorrearman <rearman@r717.net>
Fri, 22 Aug 2025 15:44:29 +0000 (11:44 -0400)
committerrearman <rearman@r717.net>
Fri, 22 Aug 2025 15:44:29 +0000 (11:44 -0400)
init.el
re/re-editing-defuns.el
re/re-vc-defuns.el [new file with mode: 0644]

diff --git a/init.el b/init.el
index de373cf0062d7a3607158539ffbdef40dacefb27..fe80ddc87ae9b8f09d419c8b1908e43ecf4fc9d4 100644 (file)
--- a/init.el
+++ b/init.el
@@ -12,6 +12,7 @@
 
 (require 're-packages)
 (require 're-editing-defuns)
+(require 're-vc-defuns)
 (require 'acme-mouse)
 (require 'fully-mono-themes)
 (require 're-os-specific)
index fdeb1e4c30468d45e42dd6948cb1574cba42ef13..902b148f8a7228f54193d166d581a9abd7abff01 100644 (file)
@@ -160,51 +160,6 @@ Taken from https://www.masteringemacs.org/article/fixing-mark-commands-transient
   (interactive)
   (set-mark-command 1))
 
-(defun re/vc-clone ()
-  "Interactively clone with vc-mode.
-Prompt for url and local dir."
-  (interactive)
-  (let* ((url (read-string "Repository URL: "))
-        (dir (read-string "Local Dir: " (file-name-base url))))
-    (vc-clone url nil dir nil)))
-
-(defun re/vc-show-branches (&optional arg)
-  "Display all Git branches in a separate buffer.
-Remotes as well when arg."
-  (interactive "P")
-  (let ((default-directory (if (boundp 'vc-dir-directory)
-                              vc-dir-directory
-                            default-directory)))
-    (vc-git-command "*git-branches*"
-                   nil
-                   nil
-                   "branch"
-                   "--verbose"
-                   (when arg "--remotes"))
-    (pop-to-buffer "*git-branches*")
-    (goto-char (point-min))
-    (special-mode)))
-
-(defun re/vc-fetch (&optional arg)
-  "Interactively fetch with vc-mode.
-Allows separate fetch in addition to pull.  Only care about git.
-With arg, ask for remote, otherwise fetch all."
-  (interactive "P")
-  (let* ((default-directory (if (boundp 'vc-dir-directory)
-                               vc-dir-directory
-                             default-directory)))
-    (vc-git-command "*vc-fetch*"
-                   nil
-                   nil
-                   "fetch"
-                   (if arg
-                       (read-string "Fetch From: " "origin")
-                     "--all")
-                   "--verbose")
-    (pop-to-buffer "*vc-fetch*")
-    (goto-char (point-min))
-    (special-mode)))
-
 (defun re/keyboard-quit ()
   "Smarter version of `keyboard-quit'.
 Close the minibuffer if not focused when hit.
diff --git a/re/re-vc-defuns.el b/re/re-vc-defuns.el
new file mode 100644 (file)
index 0000000..b5b9ab3
--- /dev/null
@@ -0,0 +1,51 @@
+;;; re-vc-defuns.el -*- lexical-binding: t; -*-
+;; This file is not part of GNU Emacs.
+
+;;; Code:
+
+(defun re/vc-clone ()
+  "Interactively clone with vc-mode.
+Prompt for url and local dir."
+  (interactive)
+  (let* ((url (read-string "Repository URL: "))
+        (dir (read-string "Local Dir: " (file-name-base url))))
+    (vc-clone url nil dir nil)))
+
+(defun re/vc-show-branches (&optional arg)
+  "Display all Git branches in a separate buffer.
+Remotes as well when arg."
+  (interactive "P")
+  (let ((default-directory (if (boundp 'vc-dir-directory)
+                              vc-dir-directory
+                            default-directory)))
+    (vc-git-command "*git-branches*"
+                   nil
+                   nil
+                   "branch"
+                   "--verbose"
+                   (when arg "--remotes"))
+    (pop-to-buffer "*git-branches*")
+    (goto-char (point-min))
+    (special-mode)))
+
+(defun re/vc-fetch (&optional arg)
+  "Interactively fetch with vc-mode.
+Allows separate fetch in addition to pull.  Only care about git.
+With arg, ask for remote, otherwise fetch all."
+  (interactive "P")
+  (let* ((default-directory (if (boundp 'vc-dir-directory)
+                               vc-dir-directory
+                             default-directory)))
+    (vc-git-command "*vc-fetch*"
+                   nil
+                   nil
+                   "fetch"
+                   (if arg
+                       (read-string "Fetch From: " "origin")
+                     "--all")
+                   "--verbose")
+    (pop-to-buffer "*vc-fetch*")
+    (goto-char (point-min))
+    (special-mode)))
+
+;;; re-vc-defuns.el ends here