branch: externals/do-at-point
commit 5cc48caa8ce061b8020178f74d21c00dbcdfbe4a
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>

    Improve robustness of Git command for URLs
---
 do-at-point.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/do-at-point.el b/do-at-point.el
index a98d7963d0..d1d2538388 100644
--- a/do-at-point.el
+++ b/do-at-point.el
@@ -153,8 +153,12 @@ of this variable.")
      (?b "Browse" ,#'browse-url)
      (?d "Download" ,#'(lambda (url)
                          (start-process "*Download*" nil "wget" "-q" "-c" 
url)))
-     (?G "Git" ,#'(lambda (url)
-                    (start-process "*Git*" nil "git" "clone" url "/tmp/")))
+     (?g "git-clone into temp"
+         ,(lambda (url)
+            (let ((dir (make-temp-file (file-name-base url) t))
+                  (default-directory temporary-file-directory))
+              (call-process "git" nil nil nil "clone" url dir)
+              (find-file-other-window dir))))
      (?e "eww" ,#'eww-browse-url))
     (number
      (?* "Calc" ,(lambda () (calc-embedded '(t)))))

Reply via email to