From dbf2280e54b060beb1f29b96a358b2ab248dffd0 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 26 Apr 2012 20:51:03 +0900 Subject: [PATCH] my-git-ps1 seems to work fine --- emacs.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/emacs.el b/emacs.el index 50ebf59..1af8c43 100644 --- a/emacs.el +++ b/emacs.el @@ -1565,10 +1565,17 @@ when SEC is nil, stop auto save if enabled." (point-at-eol)))) ""))) (defun my-git-ps1 (str) - (shell-command-to-string (concat "bash -c " - (shell-quote-argument (concat ". /etc/bash_completion.d/git; __git_ps1 " - (shell-quote-argument str) - ";"))))) + (with-temp-buffer + (insert ". /etc/bash_completion.d/git; __git_ps1 " + (shell-quote-argument str) + ";") + (shell-command-on-region (point-min) + (point-max) + "bash -s" + nil + t) + (buffer-substring-no-properties (point-min) + (point-max)))) (defun my-git-shell-command (cmd) "" (interactive (list (read-shell-command (format "[%s]%s $ git : "