aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Kaludercic2026-02-01 19:41:04 +0100
committerPhilip Kaludercic2026-02-01 19:41:04 +0100
commit9b1935dc2e600d47fff9250b052dd80cc658b34f (patch)
treeea94dd4648f0c3d15b2a52c16e451c23443ba9ea
parent24f45c85ea0d9ac90e7be96712ac23b3e80bd1d3 (diff)
downloademacs-9b1935dc2e600d47fff9250b052dd80cc658b34f.tar.gz
emacs-9b1935dc2e600d47fff9250b052dd80cc658b34f.zip
Explain why package suggestions match
* lisp/emacs-lisp/package.el (package--autosugest-prompt): Go through all suggestions for the same package and mention why a package suggestion was relevant.
-rw-r--r--lisp/emacs-lisp/package.el19
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 23a95c73416..d587c8bbfd9 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -4679,12 +4679,25 @@ Emacs can provide the editor support for these kinds of files:" nl)
4679 (insert nl "(Note that there are multiple candidate packages, 4679 (insert nl "(Note that there are multiple candidate packages,
4680so you have to select which to install!)" nl)) 4680so you have to select which to install!)" nl))
4681 4681
4682 (pcase-dolist ((and sug `(,pkg . ,_)) packages) 4682 (pcase-dolist (`(,pkg . ,sugs) (seq-group-by #'car packages))
4683 (insert nl "* " (buttonize "Install" 4683 (insert nl "* " (buttonize "Install"
4684 (lambda (_) 4684 (lambda (_)
4685 (package--autosuggest-install-and-enable sug) 4685 (package--autosuggest-install-and-enable
4686 (car sugs))
4686 (quit-window))) 4687 (quit-window)))
4687 " \"" (buttonize (symbol-name pkg) #'describe-package pkg) "\".") 4688 " \"" (buttonize (symbol-name pkg) #'describe-package pkg) "\" (")
4689 (dolist (sug sugs)
4690 (unless (eq (char-before) ?\()
4691 (insert ", "))
4692 (pcase sug
4693 (`(,_ auto-mode-alist . ,_)
4694 (insert "matches file extension "))
4695 (`(,_ magic-mode-alist . ,_)
4696 (insert "matches magic bytes"))
4697 (`(,_ interpreter-mode-alist . ,_)
4698 (insert "matches interpreter "))))
4699 (delete-horizontal-space) (insert ")")
4700
4688 (add-to-list 'package--autosuggest-suggested pkg)) 4701 (add-to-list 'package--autosuggest-suggested pkg))
4689 4702
4690 (insert nl "* " (buttonize "Do not install anything" (lambda (_) (quit-window))) "." 4703 (insert nl "* " (buttonize "Do not install anything" (lambda (_) (quit-window))) "."