- (if (zerop (length patch-names))
- (error "No patches to delete")
- (when (yes-or-no-p (format "Really delete %d patches? "
- (length patch-names)))
- (stgit-capture-output nil
- (apply 'stgit-run "delete" patch-names))
- (stgit-reload))))
-
-(defun stgit-coalesce (patch-names)
- "Run stg coalesce on the named patches."
- (interactive (list (stgit-marked-patches)))
+ (let ((npatches (length patchsyms)))
+ (if (zerop npatches)
+ (error "No patches to delete")
+ (when (yes-or-no-p (format "Really delete %d patch%s? "
+ npatches
+ (if (= 1 npatches) "" "es")))
+ (stgit-capture-output nil
+ (apply 'stgit-run "delete" patchsyms))
+ (stgit-reload)))))
+
+(defun stgit-coalesce (patchsyms)
+ "Coalesce the patches in PATCHSYMS.
+Interactively, coalesce the marked patches."
+ (interactive (list stgit-marked-patches))
+ (when (< (length patchsyms) 2)
+ (error "Need at least two patches to coalesce"))