summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-10-06 21:45:36 +0200
committerPhilip Kaludercic <philipk@posteo.net>2022-10-06 22:03:15 +0200
commit7c11398ca0a77eaf97448f0760800d6ec05fe22c (patch)
treecf85ba2224181962913c28957d36b0a000c51700 /lisp/emacs-lisp
parentb6132d84e94e317a8eea13a7a71a1b2d6f94153e (diff)
downloademacs-7c11398ca0a77eaf97448f0760800d6ec05fe22c.tar.gz
emacs-7c11398ca0a77eaf97448f0760800d6ec05fe22c.tar.bz2
emacs-7c11398ca0a77eaf97448f0760800d6ec05fe22c.zip
Add a generic bug reporting command for packages
* lisp/emacs-lisp/package.el (package-menu-mode-map): Bind 'package-report-bug'. (package-report-bug): Add new command.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el32
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 2de5056475d..e0fb4b05723 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2964,6 +2964,7 @@ either a full name or nil, and EMAIL is a valid email address."
"~" #'package-menu-mark-obsolete-for-deletion
"w" #'package-browse-url
"m" #'package-contact-maintainer
+ "b" #'package-report-bug
"x" #'package-menu-execute
"h" #'package-menu-quick-help
"H" #'package-menu-hide-package
@@ -4516,6 +4517,37 @@ DESC must be a `package-desc' object."
(string-trim (substring-no-properties (buffer-string))))
(format "[%s] %s" name subject))))
+(defun package-report-bug (desc)
+ "Prepare a message to send to the maintainers of a package.
+DESC must be a `package-desc' object."
+ (interactive (list (package--query-desc package-alist))
+ package-menu-mode)
+ (unless desc
+ (user-error "Package must be non-nil"))
+ (let* ((extras (package-desc-extras desc))
+ (maint (alist-get :maintainer extras))
+ vars)
+ (unless maint
+ (user-error "Package %s has no explicit maintainer"
+ (package-desc-name desc)))
+ (let ((check (apply-partially #'file-equal-p (package-desc-dir desc))))
+ (dolist-with-progress-reporter (group custom-current-group-alist)
+ "Scanning for modified user options..."
+ (dolist (ent (get (cdr group) 'custom-group))
+ (when (and (custom-variable-p (car ent))
+ (boundp (car ent))
+ (not (eq (custom--standard-value (car ent))
+ (default-toplevel-value (car ent))))
+ (locate-dominating-file (car group) check))
+ (push (car ent) vars)))))
+ (dlet ((reporter-prompt-for-summary-p t))
+ (reporter-submit-bug-report
+ (with-temp-buffer
+ (package--print-email-button maint)
+ (string-trim (substring-no-properties (buffer-string))))
+ (symbol-name (package-desc-name desc))
+ vars))))
+
;;;; Introspection
(defun package-get-descriptor (pkg-name)