diff options
author | Philip Kaludercic <philipk@posteo.net> | 2022-10-07 18:57:00 +0200 |
---|---|---|
committer | Philip Kaludercic <philipk@posteo.net> | 2022-10-08 11:57:38 +0200 |
commit | e092e60f1539898a42ed157b87bdd32f512109e0 (patch) | |
tree | 6d5ad3f75fcfa0e2ea73b5b77a7ef3ef3c0ee273 /lisp/emacs-lisp/package.el | |
parent | effe1f20f58bd92443e28cda2f0f65c681f1b387 (diff) | |
download | emacs-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.el')
-rw-r--r-- | lisp/emacs-lisp/package.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 9ac94fa6bca..6e891fede1f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4516,20 +4516,23 @@ DESC must be a `package-desc' object." (funcall browse-url-secondary-browser-function url) (browse-url url)))) -(defun package-maintainers (pkg-desc) +(defun package-maintainers (pkg-desc &optional no-error) "Return an email address for the maintainers of PKG-DESC. The email address may contain commas, if there are multiple maintainers. If no maintainers are found, an error will be -thrown." +signalled. If the optional argument NO-ERROR is non-nil no error +will be signalled in that case." (unless pkg-desc - (user-error "Invalid package description")) + (error "Invalid package description")) (let* ((extras (package-desc-extras pkg-desc)) (maint (alist-get :maintainer extras))) - (unless maint + (cond + ((and (null maint) (null no-error)) (user-error "Package has no explicit maintainer")) - (with-temp-buffer - (package--print-email-button maint) - (string-trim (substring-no-properties (buffer-string)))))) + ((not (null maint)) + (with-temp-buffer + (package--print-email-button maint) + (string-trim (substring-no-properties (buffer-string)))))))) ;; TODO: Allow attaching a patch to send directly to the maintainer. ;; Ideally this should be able to detect the local changes, convert |