unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: emacs-devel@gnu.org, drew.adams@oracle.com, tino.calancha@gmail.com
Subject: Re: ctl-x-map key binding conventions for new major/minor modes
Date: Sat, 13 May 2017 17:33:43 +0300	[thread overview]
Message-ID: <83k25k967s.fsf@gnu.org> (raw)
In-Reply-To: <CAFyQvY2V2Nz0xqKdYf1FOJ4TDZGUZg3_1=s+ADSW1BwUf9X3qA@mail.gmail.com> (message from Kaushal Modi on Sat, 13 May 2017 14:16:46 +0000)

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Sat, 13 May 2017 14:16:46 +0000
> Cc: drew.adams@oracle.com, emacs-devel@gnu.org
> 
>  Perhaps instead of adding recommendations about this, we could have a
>  feature where define-key invoked as part as 'load' or 'require' would
>  check, once, if the key being rebound already has a binding, 
> 
>  and ask
>  the user what she would like to do about, with 3 possible answers
>  being "rebind", "don't rebind", and "error out of 'load'"?
> 
> Would that halt emacs startup with that prompt?

It would stop the load of the features which redefines the keys.

> If so, I believe that would cause an annoyance for a lot of
> users who might have already shadowed bindings.

That's why I proposed to do that only once, the first time this
ever happens for a key or a group of keys.

> What if define-key is instead made to throw a message or a warning?

What's the difference between a message and a warning?

Anyway, this could also be good, but its disadvantage is that it
doesn't let the user an opportunity to reject the rebinding.

> (define-key KEYMAP KEY DEF) 
> 
> If it is made into
> 
> (define-key KEYMAP KEY DEF &optional ALLOW-OVERRIDE)
> 
> - By default, the overriding will happen as now, but the above mentioned warning will also be put out in
> *Messages*.
> - If ALLOW-OVERRIDE is 'prevent, the overriding will be blocked silently.
> - If ALLOW-OVERRIDE is any other non-nil value, overriding will happen and that warning is not thrown. 

I think this should be an interactive feature, not a non-interactive
one.



  reply	other threads:[~2017-05-13 14:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13  3:49 ctl-x-map key binding conventions for new major/minor modes Tino Calancha
2017-05-13  5:10 ` Drew Adams
2017-05-13  5:33   ` Tino Calancha
2017-05-13  7:11     ` Eli Zaretskii
2017-05-13 14:16       ` Kaushal Modi
2017-05-13 14:33         ` Eli Zaretskii [this message]
2017-05-13 14:48           ` Kaushal Modi
2017-05-17  6:18       ` Tino Calancha

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=83k25k967s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=tino.calancha@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).