unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Drew Adams <drew.adams@oracle.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
	Philip Kaludercic <philipk@posteo.net>,
	Gregory Heytings <gregory@heytings.org>
Subject: Re: [External] : Re: PROPOSAL: Repurpose one key (why only one?) and reserve it for third-party packages
Date: Sun, 14 Feb 2021 22:21:12 +0300	[thread overview]
Message-ID: <YCl4KPbgD120wIAJ@protected.rcdrun.com> (raw)
In-Reply-To: <SA2PR10MB44742D71BA3A91E1F5B35705F3899@SA2PR10MB4474.namprd10.prod.outlook.com>

Maybe Emacs itself could have detection for a package that needs a
prefix, something like:

(need-prefix-key 'my-key-map) where `need-prefix-key' is the future
imaginary Emacs built-in function.

and then Emacs can on first invocation of the package function ask
user: This package requires a prefix key, please press some of the
keys like C-c and some letter or Super and some letter to choose
it. It could tell user that key is already bound and if user is unsure
or not.

User could also customize the option `ask-me-for-prefix-keys' if user
wish to be asked for those prefix keys.

That would be very hand solution, no package would need to set a key
globally, just make a map, and Emacs itself would be notified by the
package that package needs a prefix key. Emacs would then ask user for
prefix key if user has set the variable `ask-me-for-prefix-key'.

That solves the whole problem for many third party packages.

* Drew Adams <drew.adams@oracle.com> [2021-02-14 21:31]:
> (I haven't read all of your long message here.
> And I wouldn't have bothered to reply to it,
> if I hadn't noticed that you mention me in
> passing, and you did so inaccurately.)
> ___
> 
> > There are no package authors except of Drew, who
> > asked for "some key" to be re-purposed for their
> > specific package.
> 
> No, I never, ever, asked for any Emacs keys to
> be repurposed for any of my libraries.
> 
> I asked that keys that were _not_ yet bound by
> Emacs by default, continue to NOT be bound by
> Emacs by default.  That's all.  No repurposing
> - for my benefit or for any other reason.

Yes, that is what I meant despite inaccurate description.

> Not sure what you're referring to, but there is
> a very real problem of Emacs binding more and
> more keys by default - the set of keys still
> unbound by default is dwindling to extinction.

I understand your opinion but contrary to it, I found there are many
available key bindings, we mentioned here Super key, key prefixes or
maps, so it amounts in thousands. Keyboard will die sooner as physical
keyboard then the available key bindings.

> This is not a problem for _users_.  At least not
> directly.  Users can always bind any keys they
> like.  It's a problem for 3rd-party code (and
> thus indirectly for its users).  There need be
> no discussion about what users can do - they
> are welcome to do anything, and the conventions
> explicitly say so.

Even third parties are welcome to do anything.

What repercussion is there for third party if they actually break the
convention? Maybe such package would not be accepted in ELPA, but that
is about all. They are free to bind as they wish. But they don't and
follow the convention.

I have not found real conflict, like nobody said so far (that I have
spotted) that some key bindings seriously conflict with something
else. It is hypothetical problem, but not practical.

> It's not helpful for people here to simply
> ignore the discussion that's taken place (in
> emacs-devel and bug threads), and instead add
> repetition of Q&A and arguments.  Please read
> the discussion, so arguments aren't repeated
> here needlessly, wasting everyone's time and
> energy.

Maybe not. First one has to list the real problem, practical specific
problem. Let us solve that.

Put hypothetical problems on side, just disregard them. Recursive grep
in few thousands of MELPA packages has shown that almost none of them
binds C-c LETTER by default, there are those binding other keys by
default. But none of people complained.

Why reserve anything, if there is neither practical problem at hand to
be solved, neither almost none person to say I NEED THIS KEY X FOR
PACKAGE Y. One person I know is you that you need it, and your request
was ignored, I have not seen explanation why and how.

anx-api package:

(if anx-use-global-keybindings
    (progn
      (global-set-key (kbd "C-x C-a A") 'anx-authenticate)
      (global-set-key (kbd "C-x C-a a") 'anx-get-user-authentication-credentials)
      (global-set-key (kbd "C-x C-a S") 'anx-switch-users)

pager-default-keybindings has some defaults set. Logical by name.

seethru package recommends some keyboards through a function, does not
bind by default (I guess).

cssh package bind C-= and C-M-=

move-text package has function to bind some keys

cycbuf package as well

better-defaults has some global bindings, logical to its purpose.

From 2400+ packages the above shows that there are no conflicts so
far. Majority of packages recommend bindings to user to make it by
their own will.

So which real world, practical conflict is there at hand to be solved?

I would not say discussion is useless and that people have to follow
arguments carefully especially as we talk about key bindings that
practically do not affect users, nor cause problems.

> (That is, do that if you're really interested
> in the question/problem.  If you're not, then
> don't bother.

I have asked already before few days, what is the practical, specific,
real world problem to be solved? I do not see any after the analysis
of the discussion. I know your case, OK and I know you will find
solution to it. But you have not started discussion, you are proposing
constructive things.

Nevertheless, I see no real world problem.

I see hypothetical problems.

> But please don't just repeat questions or arguments here that have
> already been made in the more general discussion.)

I may mention, I am not a database that collects each piece of details
ever mentioned on all mailing lists and excludes those that have been
mentioned. That is life.

> > But people wish to solve the problem for
> > imaginary package authors who did not even
> > complain. The one who complained is Drew Adams
> 
> Actually, several people have argued that the
> problem exists.  You seem to be ignoring the
> general discussion and just imagining things.

If problem exist, then which real world problem is it?

Is it hypothetical problem with imaginary future packages?

Short analysis has shown that packages do not even bind keys, they
just recommend key bindings. That is the solution that existed before
and exists now. There is proposal that it may become little more
sensitive, program could recommend bindings by detecting which keys
are bound to what and let user just type or choose a new key for new
functions instead of advising users in the README or comment section.

So if packages do not bind keys by large, where is the real problem?

With "real problem" let us know the package name that bound some keys
and where it conflict with some other key, or where package author
does not have a solution to make package functional for the user.

> I spoke up then because that change affected
> me and users of my library directly.  I asked
> politely that they choose some other prefix
> key to grab for Project.  My request was
> rejected summarily, just because my code is
> 3rd-party.

That I have seen, it does not look nice. Did you solve the problem?

You can make a function that asks user on which key user wish to put a
prefix key. That would be solved with it. No need to dwell with
global-set-key, just let users decide themselves.

1. Press your preferred prefix key for this package

2. That key you have chosen is bound to `this-other-function', are you
   sure you wish to re-purpose the key for this package?

3. If no, press other prefix key and try again.

4. If yes, you may again customize the prefix key by invoking function
   "my-package-customize-prefix"

It should be that simple. Or do it as majority to advise user to set
bindings as they wish in the comments section.

Majority of packages do not bind keys for packages. That is simple
solution.

Package invocation like first time running of a function could detect
if a key has been defined as prefix and run the wizard to customize
the global prefix key. Some packages show that they have similar
functions, not really wizardry, but there are similar functions where
user invokes a function and package binds global keys.

Packages define various keys and let user make the prime decision. I
have seen with M-x rgrep that packages do similar to that.

This comes from anx-api package:

- it looks like if user defined `anx-use-global-keybindings' that it
  would automatically set some global keys.

(if anx-use-global-keybindings
    (progn
      (global-set-key (kbd "C-x C-a A") 'anx-authenticate)
      (global-set-key (kbd "C-x C-a a") 'anx-get-user-authentication-credentials)
      (global-set-key (kbd "C-x C-a S") 'anx-switch-users)

but they will mostly suggest to users to use some of C-c combinations
in the comment section. I think that is old fashioned and that wizard
functions should do that work.

Jean



  reply	other threads:[~2021-02-14 19:21 UTC|newest]

Thread overview: 74+ 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
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 [this message]
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

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=YCl4KPbgD120wIAJ@protected.rcdrun.com \
    --to=bugs@gnu.support \
    --cc=drew.adams@oracle.com \
    --cc=gregory@heytings.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=philipk@posteo.net \
    /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).