diff options
| author | Philip Kaludercic | 2022-10-06 21:45:36 +0200 |
|---|---|---|
| committer | Philip Kaludercic | 2022-10-06 22:03:15 +0200 |
| commit | 7c11398ca0a77eaf97448f0760800d6ec05fe22c (patch) | |
| tree | cf85ba2224181962913c28957d36b0a000c51700 | |
| parent | b6132d84e94e317a8eea13a7a71a1b2d6f94153e (diff) | |
| download | emacs-7c11398ca0a77eaf97448f0760800d6ec05fe22c.tar.gz 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.
| -rw-r--r-- | lisp/emacs-lisp/package.el | 32 |
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." | |||
| 2964 | "~" #'package-menu-mark-obsolete-for-deletion | 2964 | "~" #'package-menu-mark-obsolete-for-deletion |
| 2965 | "w" #'package-browse-url | 2965 | "w" #'package-browse-url |
| 2966 | "m" #'package-contact-maintainer | 2966 | "m" #'package-contact-maintainer |
| 2967 | "b" #'package-report-bug | ||
| 2967 | "x" #'package-menu-execute | 2968 | "x" #'package-menu-execute |
| 2968 | "h" #'package-menu-quick-help | 2969 | "h" #'package-menu-quick-help |
| 2969 | "H" #'package-menu-hide-package | 2970 | "H" #'package-menu-hide-package |
| @@ -4516,6 +4517,37 @@ DESC must be a `package-desc' object." | |||
| 4516 | (string-trim (substring-no-properties (buffer-string)))) | 4517 | (string-trim (substring-no-properties (buffer-string)))) |
| 4517 | (format "[%s] %s" name subject)))) | 4518 | (format "[%s] %s" name subject)))) |
| 4518 | 4519 | ||
| 4520 | (defun package-report-bug (desc) | ||
| 4521 | "Prepare a message to send to the maintainers of a package. | ||
| 4522 | DESC must be a `package-desc' object." | ||
| 4523 | (interactive (list (package--query-desc package-alist)) | ||
| 4524 | package-menu-mode) | ||
| 4525 | (unless desc | ||
| 4526 | (user-error "Package must be non-nil")) | ||
| 4527 | (let* ((extras (package-desc-extras desc)) | ||
| 4528 | (maint (alist-get :maintainer extras)) | ||
| 4529 | vars) | ||
| 4530 | (unless maint | ||
| 4531 | (user-error "Package %s has no explicit maintainer" | ||
| 4532 | (package-desc-name desc))) | ||
| 4533 | (let ((check (apply-partially #'file-equal-p (package-desc-dir desc)))) | ||
| 4534 | (dolist-with-progress-reporter (group custom-current-group-alist) | ||
| 4535 | "Scanning for modified user options..." | ||
| 4536 | (dolist (ent (get (cdr group) 'custom-group)) | ||
| 4537 | (when (and (custom-variable-p (car ent)) | ||
| 4538 | (boundp (car ent)) | ||
| 4539 | (not (eq (custom--standard-value (car ent)) | ||
| 4540 | (default-toplevel-value (car ent)))) | ||
| 4541 | (locate-dominating-file (car group) check)) | ||
| 4542 | (push (car ent) vars))))) | ||
| 4543 | (dlet ((reporter-prompt-for-summary-p t)) | ||
| 4544 | (reporter-submit-bug-report | ||
| 4545 | (with-temp-buffer | ||
| 4546 | (package--print-email-button maint) | ||
| 4547 | (string-trim (substring-no-properties (buffer-string)))) | ||
| 4548 | (symbol-name (package-desc-name desc)) | ||
| 4549 | vars)))) | ||
| 4550 | |||
| 4519 | ;;;; Introspection | 4551 | ;;;; Introspection |
| 4520 | 4552 | ||
| 4521 | (defun package-get-descriptor (pkg-name) | 4553 | (defun package-get-descriptor (pkg-name) |