emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: package-autosuggest


From: Eshel Yaron
Subject: Re: package-autosuggest
Date: Thu, 31 Aug 2023 10:34:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Thanks for putting together a concrete proposal, Philip.

I really like this idea, I think it could be really useful for new
users.  A couple of thoughts:

Philip Kaludercic <philipk@posteo.net> writes:

> Here is a quick and rough draft of how this feature could look like:
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index e1172d69bf0..723900318c5 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -4534,6 +4534,116 @@ package-get-version
>              (or (lm-header "package-version")
>                  (lm-header "version")))))))))
>
> +
> +;;;; Autosuggest
> +
> +(defvar package-autosuggest-database
> +  '((sml-mode auto-mode-alist "\\.sml\\'")
> +    (lua-mode auto-mode-alist "\\.lua\\'" )
> +    (ada-mode auto-mode-alist "\\.ada\\'")
> +    ;; ...
> +    ;;
> +    ;; this is just for testing, in practice I think this data should
> +    ;; be generated and bundled with Emacs, and would ideally be
> +    ;; loaded in at compile-time.  When the "archive-contents" file
> +    ;; format is updated, we can include more information in there
> +    ;; that would be added to this database.
> +    )
> +  "Database of hints for packages to suggest installing.")
> +

IMO, the suggestions "database" should be slightly more sophisticated,
and manually curated:

- Sophisticated: each hint should have a confidence/certainty indicator,
  possibly a symbol among `certain`, `probable`, `possible`.  Some
  "hint" (detection mechanisms for missing packages) rely on stronger
  signals than others, and that affects the probability of false
  positives.  Consider, for example, `sxhkdrc-mode` from GNU ELPA.  If a
  user opens a file named `sxhkdrc`, it's almost certain they could
  benefit from this package and Emacs should assertively suggest it.  On
  the other hand, the extensions `.sml` is used for many file formats
  other than Standard ML, so it's a relatively weaker signal for
  suggesting `sml-mode`.  These confidence levels can help Emacs use the
  correct UI/wording for different package suggestions.

- Manually curated: Emacs should only push suggestions for packages that
  the project whole-heartedly recommends.  Crucially, it's not enough
  for a package to declare that it provides a major mode for a certain
  file format to guarantee that it actually provides a good user
  experience.  The only way I see for guaranteeing the quality of these
  suggestions is by manually curating them, similarly to the way GNU and
  NonGNU ELPA are curated.


Best,

Eshel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]