今年最後の書き込みになるだろうか
(defun __git_ps1 ()
(let ((branch (with-output-to-string
(call-process "git" nil (list standard-output nil) nil
"describe" "--contains" "--all" "HEAD"))))
(if (string< "" branch)
(concat "("
(if (string-match "[\n\r]+\\'" branch)
(replace-match "" t t branch)
branch)
")")
branch)))
最近シェルのプロンプトに(master)とか出すのが流行りだが
Emacs用に最低限の実装をするとこんな感じだな

Emacs用に色々探したがまともな実装が無かったから自分で作った
適当にプロンプトに組み込んでみてくれ (俺はeshellのプロンプトに組み込んでる)