summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/package-vc.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-10-07 18:57:00 +0200
committerPhilip Kaludercic <philipk@posteo.net>2022-10-08 11:57:38 +0200
commite092e60f1539898a42ed157b87bdd32f512109e0 (patch)
tree6d5ad3f75fcfa0e2ea73b5b77a7ef3ef3c0ee273 /lisp/emacs-lisp/package-vc.el
parenteffe1f20f58bd92443e28cda2f0f65c681f1b387 (diff)
downloademacs-e092e60f1539898a42ed157b87bdd32f512109e0.tar.gz
emacs-e092e60f1539898a42ed157b87bdd32f512109e0.tar.bz2
emacs-e092e60f1539898a42ed157b87bdd32f512109e0.zip
Add a package-vc command for submitting ptches
* lisp/emacs-lisp/package-vc.el (package-vc-read-pkg): Add auxiliary command for querying source packages. (package-vc-prepare-patch): Add it. * lisp/emacs-lisp/package.el (package-maintainers): Add an optional NO-ERROR argument.
Diffstat (limited to 'lisp/emacs-lisp/package-vc.el')
-rw-r--r--lisp/emacs-lisp/package-vc.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 2a45bacf6e9..d3850a5e2c0 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -286,5 +286,26 @@ be requested using REV."
;;;###autoload
(defalias 'package-checkout #'package-vc-fetch)
+(defun package-vc-read-pkg (prompt)
+ "Query for a source package description with PROMPT."
+ (completing-read
+ prompt
+ package-alist
+ (lambda (pkg) (package-vc-p (cadr pkg)))
+ t))
+
+(defun package-vc-prepare-patch (pkg subject revisions)
+ "Send a patch to the maintainer of a package PKG.
+SUBJECT and REVISIONS are used passed on to `vc-prepare-patch'.
+PKG must be a package description."
+ (interactive
+ (list (package-vc-read-pkg "Package to prepare a patch for: ")
+ (and (not vc-prepare-patches-separately)
+ (read-string "Subject: " "[PATCH] " nil nil t))
+ (or (log-view-get-marked)
+ (vc-read-multiple-revisions "Revisions: "))))
+ (vc-prepare-patch (package-maintainers pkg t)
+ subject revisions))
+
(provide 'package-vc)
;;; package-vc.el ends here