]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix "g" in hg&git push&pull buffers
authorSam Steingold <sds@gnu.org>
Mon, 22 May 2017 19:48:21 +0000 (15:48 -0400)
committerSam Steingold <sds@gnu.org>
Mon, 22 May 2017 19:48:21 +0000 (15:48 -0400)
lisp/vc/vc-git.el (vc-git--pushpull): Set locally
`compilation-directory' and `compilation-arguments'.
lisp/vc/vc-hg.el (vc-hg--pushpull): Likewise.

lisp/vc/vc-git.el
lisp/vc/vc-hg.el

index f70bbddbe7b5fce9303d53406220ffbaf29f5119..a4ce76ec37e4f7625df9ff162130dcd78292b111 100644 (file)
@@ -888,7 +888,15 @@ If PROMPT is non-nil, prompt for the Git command to run."
         (vc-compilation-mode 'git)
         (setq-local compile-command
                     (concat git-program " " command " "
-                            (if args (mapconcat 'identity args " ") "")))))
+                            (if args (mapconcat 'identity args " ") "")))
+        (setq-local compilation-directory root)
+        ;; Either set `compilation-buffer-name-function' locally to nil
+        ;; or use `compilation-arguments' to set `name-function'.
+        ;; See `compilation-buffer-name'.
+        (setq-local compilation-arguments
+                    (list compile-command nil
+                          (lambda (_name-of-mode) buffer)
+                          nil))))
     (vc-set-async-update buffer)))
 
 (defun vc-git-pull (prompt)
index 37ea928a9c2830a60486f070da568a8158358226..fff25ed64bf9868b844ab14daa2540592522c85d 100644 (file)
@@ -1344,7 +1344,15 @@ commands, which only operated on marked files."
             (vc-compilation-mode 'hg)
             (setq-local compile-command
                         (concat hg-program " " command " "
-                                (if args (mapconcat 'identity args " ") "")))))
+                                (if args (mapconcat 'identity args " ") "")))
+            (setq-local compilation-directory root)
+            ;; Either set `compilation-buffer-name-function' locally to nil
+            ;; or use `compilation-arguments' to set `name-function'.
+            ;; See `compilation-buffer-name'.
+            (setq-local compilation-arguments
+                        (list compile-command nil
+                              (lambda (_name-of-mode) buffer)
+                              nil))))
        (vc-set-async-update buffer)))))
 
 (defun vc-hg-pull (prompt)