branch: externals/vc-got commit eacbf767c64ccb8c469698044c691c7baa3b20a4 Author: Omar Polo <o...@omarpolo.com> Commit: Omar Polo <o...@omarpolo.com>
don't hardcode got questions match and relay them to the user --- vc-got-stage.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vc-got-stage.el b/vc-got-stage.el index baf0e43..489c18f 100644 --- a/vc-got-stage.el +++ b/vc-got-stage.el @@ -25,6 +25,7 @@ ;;; Code: +(require 'rx) (require 'vc) (defvar vc-got-program) ;vc-got.el @@ -86,11 +87,12 @@ PROC is the process, STRING part of its output." (insert string) (save-excursion (beginning-of-line) - (let ((msg (cond ((looking-at "^stage this change?") - "Stage this change? ") - ((looking-at "^stage this addition?") - "Stage this addition? ")))) - (when msg + (when (looking-at (rx bol + (group (zero-or-one "un") + "stage" + (zero-or-more anychar) + "?"))) + (let ((msg (match-string 1))) (kill-line) (process-send-string buf (if (y-or-n-p msg) "y\n" "n\n")) (erase-buffer)))))))))