unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Gregory Heytings <gregory@heytings.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: PROPOSAL: Repurpose one key and reserve it for third-party packages
Date: Fri, 12 Feb 2021 18:25:56 +0100	[thread overview]
Message-ID: <87czx5gpuj.fsf@posteo.net> (raw)
In-Reply-To: <329d68a5ed0dcd10a78a@heytings.org> (Gregory Heytings's message of "Fri, 12 Feb 2021 16:04:17 +0000")

[-- Attachment #1: Type: text/plain, Size: 4172 bytes --]

Gregory Heytings <gregory@heytings.org> writes:

>>>> The only real solution that I see is something along the lines of
>>>> what I recommended: Packages suggest customizations, and
>>>> package-install may either ignore, ask for confirmation or accept
>>>> them by default, if there are no problems with what is suggested
>>>> (eg. collisions).
>>>
>>> And that solution cannot be implemented if there is no key space
>>> reserved for third-party libraries.  Which is what the proposal is 
>>> about.  The proposal is not about the particular mechanisms that
>>> could be used to bind keys in that reserved area.
>>
>> I argue it can be done, and that the proposal to have packages
>> suggest keys to bind would avoid the need to designate a special key
>> space for third-party packages.
>
> I must have misunderstood something in your solution.  What are the
> possible keys a package could suggest, with your solution?  What is
> the set of keys in which package developers can choose keys to suggest
> to their users?

My apologies if I was unclear, I'll try to rephrase it so that you
understand where I'm coming from (and sorry, again, for the wall of
text):

Beginning from the fact, that I don't see any key that is common, unused
AND practical, I think we must accept that packages are actually limited
to those keys reserved for users (or user-configurations).

Usually, packages like Magit, Org, elfeed, etc. can only informally
propose a key-binding to use, users have to read this and install it
themselves. Works for you and me, but can be confusing to others.

My suggestion is based on the introduction of two variables: One for
packages to formally specify their suggestions for what keys to bind,
what hooks to modify, what options to set, etc. and one for users to
declare if they are interested or not.

The patch I added to a message proposed that eg. Magit wouldn't write
something like

        ;;;###autoload
        (global-set-key (kbd "C-x g") #'magit-status)

(I'm oversimplifying, their code is more complex), but instead they add
a line like

        ;;;###autoload
        (add-to-list 'pacakge-configuration-suggestions
                     '(magit            ; package name
                       (key             ; what type of suggestion 
                        "C-x g"         ; what key to bind the following to
                        magit-status    ; what command to bind
                        )))

This is one way, another one would be to use the header, but that's a
bit more complicated.

Now that the package has been installed and the suggestion has been
noted, Emacs would check a user-option I've named
`package-ignore-suggestions' but could be more general if the user is
interested in recommended key-binding suggestions. If this is the case,
package-install would immediately query ask the user if something like

                (global-set-key (kbd "C-x g") #'magit-status)

should be added to the user configuration. In my patch this was just a
yes or no question, but a more serious implementation could also
support a list of key-chords, only suggesting those that have not been
bound yet, and allowing the user to set their own key-binding. Ideally,
every suggestion should also have a justification explaining why it
proposes this modification.

As I've implied, `package-ignore-suggestions' could be transformed to
just accept anything a package proposes, notifying the user that after
installing, e.g. Magit, C-x g has been bound.

So, this modifies as little as possible (just noting suggestions that
don't interest the user) in a program-friendly format that can be
expanded to code in the user-configuration. This can then be modified,
and these configurations wouldn't be changed by package
updated. Package.el ensures that the user isn't confused, is notified of
changes and gets to decide what he or she wants. 

It seems to me that this is the minimal abstraction layer necessary for
packages to configure themselves while maintaining good style, or at
least what I understand good style to be.

-- 
	Philip K.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

  reply	other threads:[~2021-02-12 17:25 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7ef75c33936136eb3a20@heytings.org>
     [not found] ` <8735y56naf.fsf@posteo.net>
     [not found]   ` <8ed9b43502ae9a36b057@heytings.org>
     [not found]     ` <87tuqk6d9d.fsf@posteo.net>
     [not found]       ` <3966473cc1ab9f104724@heytings.org>
2021-02-10 23:35         ` PROPOSAL: Repurpose one key and reserve it for third-party packages Philip K.
2021-02-11  8:45           ` Gregory Heytings
2021-02-11 13:53             ` Philip K.
2021-02-11 15:47               ` Philip K.
2021-02-11 15:59               ` Gregory Heytings
2021-02-11 16:20                 ` Philip K.
2021-02-11 17:48                   ` Gregory Heytings
2021-02-11 18:34                     ` Philip K.
2021-02-11 21:15                       ` Gregory Heytings
2021-02-11 22:48                         ` Philip K.
2021-02-12  0:01                           ` Gregory Heytings
2021-02-12 10:27                             ` Philip K.
2021-02-12 11:59                               ` Gregory Heytings
2021-02-12 13:23                                 ` Philip K.
2021-02-12 13:54                                   ` Gregory Heytings
2021-02-12 14:09                                     ` Philip Kaludercic
2021-02-12 16:04                                       ` Gregory Heytings
2021-02-12 17:25                                         ` Philip Kaludercic [this message]
2021-02-12 17:54                                           ` Gregory Heytings
2021-02-12 18:16                                             ` Philip Kaludercic
2021-02-12 21:48                                               ` Gregory Heytings
2021-02-13  0:37                                                 ` Philip Kaludercic
2021-02-13  8:33                                                   ` Gregory Heytings
2021-02-13  9:09                                                     ` Philip Kaludercic
2021-02-13 13:06                                                       ` Gregory Heytings
2021-02-13 14:28                                                         ` Philip Kaludercic
2021-02-13 15:01                                                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-13 16:08                                                             ` Philip Kaludercic
2021-02-13 15:02                                                           ` Gregory Heytings
2021-02-13 15:21                                                             ` Jean Louis
2021-02-13 15:28                                                               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-13 15:39                                                                 ` Nothing is the list - " Jean Louis
2021-02-13 20:14                                                             ` Philip Kaludercic
2021-02-13 20:58                                                               ` Jean Louis
2021-02-13 21:18                                                               ` Gregory Heytings
2021-02-13 21:32                                                                 ` Philip Kaludercic
2021-02-13 21:37                                                                 ` PROPOSAL: Repurpose one key (why only one?) " Jean Louis
2021-02-13 23:55                                                                   ` Philip Kaludercic
2021-02-14  6:19                                                                     ` Jean Louis
2021-02-14  6:33                                                                       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-14  8:06                                                                         ` Jean Louis
2021-02-14 18:30                                                                       ` [External] : " Drew Adams
2021-02-14 19:21                                                                         ` Jean Louis
2021-02-14 19:44                                                                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-14 23:30                                                                           ` Drew Adams
2021-02-15  0:33                                                                             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-15  5:59                                                                             ` Jean Louis
2021-02-14 17:59                                                                     ` Gregory Heytings
2021-02-14 18:14                                                                       ` libraries (was: Re: PROPOSAL: Repurpose one key (why only one?) and reserve it for third-party packages) Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-14 18:23                                                                       ` PROPOSAL: Repurpose one key (why only one?) and reserve it for third-party packages Philip Kaludercic
2021-02-14 21:37                                                                         ` Gregory Heytings
2021-02-15  0:28                                                                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-15  5:02                                                                           ` Robert Thorpe
2021-02-15 11:08                                                                             ` Gregory Heytings
2021-02-17  9:07                                                                               ` Robert Thorpe
2021-02-20 17:50                                                                                 ` Gregory Heytings
2021-02-14 18:30                                                                       ` [External] : " Drew Adams
2021-02-14 18:50                                                                         ` Gregory Heytings
2021-02-14 19:24                                                                           ` Jean Louis
2021-02-14 19:41                                                                             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-14 23:30                                                                           ` [External] : " Drew Adams
2021-02-13 10:05                                                     ` PROPOSAL: Repurpose one key " Jean Louis
2021-02-13  8:24                                                 ` Jean Louis
2021-02-13 12:44                                                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-13 14:26                                                     ` Jean Louis
2021-02-13 15:09                                                       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-13 15:24                                                         ` Jean Louis
2021-02-13 15:38                                                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-13 15:45                                                             ` Jean Louis
2021-02-12  4:45                           ` Robert Thorpe
2021-02-12  9:58                             ` Philip K.
2021-02-11 16:59                 ` [External] : " Drew Adams
2021-02-11 16:58             ` Drew Adams
2021-02-11 16:59             ` Leo Butler
2021-02-15 19:01 Gregory Heytings
2021-02-15 19:55 ` Dmitry Gutov
  -- strict thread matches above, loose matches on Subject: below --
2021-02-08 10:02 Gregory Heytings
2021-02-08 16:41 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-08 22:01 ` Francis Belliveau
2021-02-09  0:05   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-10 22:54     ` Francis Belliveau
2021-02-09  6:31 ` Jean Louis
2021-02-09  9:13   ` Gregory Heytings
2021-02-10 11:17     ` Jean Louis
2021-02-09 17:13   ` [External] : " Drew Adams
2021-02-09 17:49     ` Gregory Heytings
2021-02-09 18:12       ` Drew Adams
2021-02-09 19:23         ` Gregory Heytings
2021-02-09 20:52           ` [External] : " Drew Adams
2021-02-09 21:15             ` Gregory Heytings
2021-02-09 21:47               ` [External] : " Drew Adams
2021-02-10 11:07                 ` Gregory Heytings
2021-02-10  9:05               ` Robert Thorpe
2021-02-10 14:42                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-10 14:59                   ` Gregory Heytings
2021-02-09  8:13 ` Marcin Borkowski
2021-02-09  9:13   ` Gregory Heytings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czx5gpuj.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=gregory@heytings.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).