diff options
author | Gustav Hållberg <gustav@gmail.com> | 2010-04-23 16:18:34 +0200 |
---|---|---|
committer | Gustav Hållberg <gustav@gmail.com> | 2010-04-30 00:28:34 +0200 |
commit | 1b47104494b3f0371ece396a00bda59adbd3ffd9 (patch) | |
tree | f953b8f447dd20630eb1164615fc7fa9f5779014 | |
parent | 137b315bc8556b63bcaeff5993a572e8ae048589 (diff) | |
download | stgit-1b47104494b3f0371ece396a00bda59adbd3ffd9.tar.gz |
stgit.el: Add stgit-inhibit-messages
Signed-off-by: Gustav Hållberg <gustav@gmail.com>
-rw-r--r-- | contrib/stgit.el | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/contrib/stgit.el b/contrib/stgit.el index c4b78e2..11f370e 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -410,27 +410,37 @@ Returns nil if there was no output." (error "Bad element in stgit-make-run-args args: %S" x)))) args)) -(defun stgit-run-silent (&rest args) - (setq args (stgit-make-run-args args)) - (apply 'call-process "stg" nil standard-output nil args)) +(defvar stgit-inhibit-messages nil + "Set to non-nil to inhibit messages when running `stg' commands. +See also `stgit-message'.") +(defun stgit-message (format-spec &rest args) + "Call `message' on the arguments unless `stgit-inhibit-messages' is non-nil." + (unless stgit-inhibit-messages + (apply 'message format-spec args))) (defun stgit-run (&rest args) (setq args (stgit-make-run-args args)) (let ((msgcmd (mapconcat #'identity args " "))) - (message "Running stg %s..." msgcmd) - (apply 'call-process "stg" nil standard-output nil args) - (message "Running stg %s...done" msgcmd))) + (stgit-message "Running stg %s..." msgcmd) + (prog1 + (apply 'call-process "stg" nil standard-output nil args) + (stgit-message "Running stg %s...done" msgcmd)))) + +(defun stgit-run-silent (&rest args) + (let ((stgit-inhibit-messages t)) + (apply 'stgit-run args))) (defun stgit-run-git (&rest args) (setq args (stgit-make-run-args args)) (let ((msgcmd (mapconcat #'identity args " "))) - (message "Running git %s..." msgcmd) - (apply 'call-process "git" nil standard-output nil args) - (message "Running git %s...done" msgcmd))) + (stgit-message "Running git %s..." msgcmd) + (prog1 + (apply 'call-process "git" nil standard-output nil args) + (stgit-message "Running git %s...done" msgcmd)))) (defun stgit-run-git-silent (&rest args) - (setq args (stgit-make-run-args args)) - (apply 'call-process "git" nil standard-output nil args)) + (let ((stgit-inhibit-messages t)) + (apply 'stgit-run-git args))) (defun stgit-index-empty-p () "Returns non-nil if the index contains no changes from HEAD." |