From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: package-autosuggest Date: Thu, 31 Aug 2023 10:34:43 +0200 Message-ID: References: <87il9kksqz.fsf@dfreeman.email> <4874df51-9652-f9fd-0576-9dd6a4cba31a@gutov.dev> <3d5ef276-ce6b-9ff0-0c60-1da6b887b365@gutov.dev> <1070e416-2a13-49e0-90d4-fbc526cd461c@app.fastmail.com> <83ttskia84.fsf@gnu.org> <97c96b72-ebba-4853-98d2-86e3ba8bbc05@app.fastmail.com> <83sf84i9ix.fsf@gnu.org> <837cpfhzdm.fsf@gnu.org> <83zg2agjp8.fsf@gnu.org> <87ttshk3ns.fsf@posteo.net> <83il8whjig.fsf@gnu.org> <87fs40oiie.fsf@posteo.net> <838r9shgtz.fsf@gnu.org> <871qfkogy7.fsf@posteo.net> <835y4whd0m.fsf@gnu.org> <87r0nks55d.fsf_-_@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33367"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , monnier@iro.umontreal.ca, stefankangas@gmail.com, yandros@gmail.com, bozhidar@batsov.dev, dmitry@gutov.dev, rms@gnu.org, danny@dfreeman.email, emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 31 10:35:50 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qbd9a-0008T7-3M for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Aug 2023 10:35:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbd8f-0007As-1D; Thu, 31 Aug 2023 04:34:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbd8d-0007AB-B1 for emacs-devel@gnu.org; Thu, 31 Aug 2023 04:34:51 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbd8b-0001gp-62; Thu, 31 Aug 2023 04:34:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1693470887; bh=DXidEi3qqpnXgrahtBUCaDOXgK3uyN65kPWJSXAtads=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mk3kqFwtniFdtPeWsGYjF13+DXjxFnnJVZaB369PJKIcB8EDoPFedAlVf+raWX4vq MCHR3MqzVHWx7+XeCWB6P5OFD+xK9/mxTtWdjOH15fQKR3QwHBkKYMMBGKNEYVBgv0 J7nypRrtKdK4ZDNPyZD8J2OnpA79sNCM1WJC3ot7bOR/qU4FV0RWQVOh12koh9xxr3 cZZ8gj0DGo4fTjv1nAhHH3IZBgbO+lfAGXFXxHyhBWVQiagw8/BxghK2N30mP8/2DW 3UkAnu3IBinmdiAU1DL1atWc9rNBlbJlqontqVhOdk+Fj0JtfmiLfqtEvEhEAZiXok nHabQPYn06f/g== In-Reply-To: <87r0nks55d.fsf_-_@posteo.net> (Philip Kaludercic's message of "Wed, 30 Aug 2023 19:26:38 +0000") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309606 Archived-At: 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 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