From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Infrastructure for packages to suggest customizations Date: Tue, 16 Feb 2021 12:18:37 +0100 Message-ID: <8735xwb6r6.fsf@posteo.net> References: <877dn8bytq.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36130"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 16 12:20:00 2021 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 1lByOc-0009Fc-Ea for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Feb 2021 12:19:58 +0100 Original-Received: from localhost ([::1]:41914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lByOb-0007ns-HG for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Feb 2021 06:19:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lByNa-0006u7-Op for emacs-devel@gnu.org; Tue, 16 Feb 2021 06:18:55 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:50478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lByNY-000364-H8 for emacs-devel@gnu.org; Tue, 16 Feb 2021 06:18:54 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id C177A16005F for ; Tue, 16 Feb 2021 12:18:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1613474328; bh=CfQAFxehNzMUEqqrTtQsdlwhx8PP+XS/GBGrnxXXkL8=; h=From:To:Cc:Subject:Date:From; b=c+a+tzN7X8V0PMljuu2+/YJ9ta/08G0jGf8W9QjZ/vhjgHSxspcuASpbq4pRyLLts aw6Sq6MySHPF9aBM9M35kKB+Pfi1l5pzm9321O0vkgmsAgkreF2PDqYI5AvjQl3kL1 3LvlBPTjWTP5oy6wJbuRvkmvSkyH9FDjv7fEnem5wgt8ZnVYhhdQSRmtZF4zTlkn4Q c3kaHfmgdDd8Q4OGd5sK4hD/3MRDAuE5Cw4pVmLTPJVMdO6HGf+KP0di1wqNNa9lzv bwzyWCQQq9E8AyCsPqjHgN0sdqOtM/cr/y8tiex8hkifOacvq/vK0H2RFO4/8qeIQ/ MC/cfreh/+k4w== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Dfz4K1TcTz9rxS; Tue, 16 Feb 2021 12:18:40 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Mon, 15 Feb 2021 21:37:06 -0500") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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.23 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" Xref: news.gmane.io gmane.emacs.devel:264877 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Stefan Monnier writes: >> in the recent discussion on reserving a keymap for packages, I proposed >> extending package.el to support a sort of formal specification of what a >> user should or could customize. As there were some supportive comments, >> I attempted to improve on an earlier proof-of-concept[0], resulting in >> the attached patch. > > Thanks. Could we "simply" make it a Custom group? > For keys I'd imagine something like > > (defcustom avy-global-goto-key nil > :group 'suggestions > :type 'key-sequence > :options '("C-:") > :set (lambda (symbol value) > (if value (global-set-key value 'avy-goto-char)))) > >> Part of my intention was to generate code that can easily be changed >> and adapted by the user (unlike custom-set-variables), so I don't >> analyse the files themselves. This might not look nice in some cases, >> but then again, these people are probably not the ones using this >> feature > > I don't understand what you mean to say here, sorry. No, it's my mistake, I'll try to rephrase it: The suggestion you've made above was also something I considered: Relying on the customize system makes it easier to implement the functionality but it at the same time hides it behind the complexity of customize. So while the absolute beginner wouldn't notice or care, the next step of a beginner might be confused how the keys were bound, and how to change it. That is why the patch generates "real" configuration code, not "hiding" what is going on, but demonstrating what and how changing your Emacs is done. The downside to this is that because there is no interface like customize, it can't just find and replace a previous global-set-key, because that would require modifying regular code in a user configuration, that might not even be in .emacs or init.el. Hope that clarifies the intention. > Stefan > =2D-=20 Philip K. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCAAxFiEEbW+YL3e0aNnYosjIGB9bla4wszYFAmArqg0THHBoaWxpcGtA cG9zdGVvLm5ldAAKCRAYH1uVrjCzNq6zDACclxFM89dVLk69ktG6yWWTqROqK7m4 oq15KYEAhI4lEl/wO+8n0YpxS2X4UQFB/a6Mf8H9sgX1L9fZCIUpBObxeTYH58iG kEHPnSAQSzmhE31yTE6CzNCsbx/PHlMonydfwr/Noibog7iIm/QvZXoSVnwYVd/M dhfyTPVKrW/gIMDIMu7BwNvsoulXQUuiHuQmZwrEry8Qhco/VopS/daIPTH8ny9B E4UTls9ud9pNGv61l2AEYwfZHeE78wbD+L72nBgf2d3de86z8DGd1Q+sE/wMMivC NukH/Kg11DDiu2vvOLt8JmVFj2o+ImYPIBJ2yFyTLtIF0p54Hjr90EGz1CxEOh0u E3oBzlV8hc+XUvlbzJO2oI5nJGABd/eq/HN5d0G3E66Qo+A1PuuqXNpM23Eb3zFk B7cCYiMA2pf+f2n1sGez/hZwt/w/j76u50Eaf1xpjNpm0jUKgxGw3by4rIsh/rim uFxGGFSDVZBfm8qlOQLndq1hESQ3Ec+Edp4= =49jO -----END PGP SIGNATURE----- --=-=-=--