From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: ctl-x-map key binding conventions for new major/minor modes Date: Sat, 13 May 2017 14:16:46 +0000 Message-ID: References: <83vap58c4t.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1cc54283c56a054f68791a" X-Trace: blaine.gmane.org 1494685068 6521 195.159.176.226 (13 May 2017 14:17:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 May 2017 14:17:48 +0000 (UTC) Cc: drew.adams@oracle.com, emacs-devel@gnu.org To: Eli Zaretskii , Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 13 16:17:44 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9Xra-0001ZM-Ls for ged-emacs-devel@m.gmane.org; Sat, 13 May 2017 16:17:42 +0200 Original-Received: from localhost ([::1]:57770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Xrg-00071N-5k for ged-emacs-devel@m.gmane.org; Sat, 13 May 2017 10:17:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Xqw-0006zX-Rn for emacs-devel@gnu.org; Sat, 13 May 2017 10:17:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Xqw-00078V-1A for emacs-devel@gnu.org; Sat, 13 May 2017 10:17:02 -0400 Original-Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]:35995) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Xqu-00075D-E7; Sat, 13 May 2017 10:17:00 -0400 Original-Received: by mail-lf0-x231.google.com with SMTP id h4so13226631lfj.3; Sat, 13 May 2017 07:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RxpM6/xgmBn49DI76SX4FXl08nm/t2jgP5hCFJvZQ0I=; b=hY9aNo5aL+BlNPnQg7L615ohbK/2SaXcEzDuMfruohkKNHmR4KQfRZgmVy6JVcXaHU 95j0O0e9lGzxQA/kfILPbx+Fffw/AnOj0MJYJ1+isWZyEXPBMiXR2lV2cZMM/BpnSUUv Itk3M/s3IPJbJm7koldQwXIZc69zEzLp+uXCdIoBzmQSq5xlzNPQWkyl8B42JyX/fdAQ 714vxWKXlE7dYWt4hV8FJwUG4NnbGoRHx19YsmvBayq3qRqRAoz7K2PnOMzRzyC2dmYe oQK2BqevucGR8lVegR7Rw85wvxINeUHqwChO5p33s7IT8J8ZFm104JHGfgDhbXg0mwXQ EdEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RxpM6/xgmBn49DI76SX4FXl08nm/t2jgP5hCFJvZQ0I=; b=po+OYaOhlD5O6wPbyneUpNfz1DLh1d5ojOSuAGSv/gLQBZ7Fa5bsI8qBwlViga6W9Q uESUAeoVaB7/q/aFzxcRS7AyojgHsAkic8nyB3SIEuptBDYAoVh5WIcXLM3vxMgHKjKt XExLjj9u9W88qdrF/hY4rYCmOgTUJ4ysLz3cROd8ly780lP/QG5pY/uGgU3iFCPyWXHe RIK+wYF8BScbFkQARokB5w/gqRN6p8SpgKAdYKbdKZYg3rZHnbfr4T1CGbSeuELuJ22P HijU8nHQZsFuGtzvipaQ8miECAvzwPICeknK5iSyt9pa73iwlpXx1ZEPkcZtR/i9vfP+ 1DzA== X-Gm-Message-State: AODbwcAikLDxEh2XilZSZBK3sf5XCH2Sa88bbj6Sxkjyo+OnE4XSODGu 90GtzoHd0Z7Q491szhFCGIKy3OqURw== X-Received: by 10.46.21.28 with SMTP id s28mr3613843ljd.112.1494685017423; Sat, 13 May 2017 07:16:57 -0700 (PDT) In-Reply-To: <83vap58c4t.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214817 Archived-At: --94eb2c1cc54283c56a054f68791a Content-Type: text/plain; charset="UTF-8" On Sat, May 13, 2017 at 3:11 AM Eli Zaretskii wrote: > 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? If so, I believe that would cause an annoyance for a lot of users who might have already shadowed bindings. What if define-key is instead made to throw a message or a warning? In addition, current signature of define-key is: (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. -- Kaushal Modi --94eb2c1cc54283c56a054f68791a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, May 13= , 2017 at 3:11 AM Eli Zaretskii <eliz@gn= u.org> wrote:
Perhaps instea= d of adding recommendations about this, we could have a
feature where define-key invoked as part as 'load' or 'require&= #39; would
check, once, if the key being rebound already has a binding,
<= div>=C2=A0
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 ha= lt emacs startup with that prompt? If so, I believe that would cause an ann= oyance for a lot of users who might have already shadowed bindings.

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

In addition, current signature of defin= e-key is:

=C2=A0 =C2=A0 (define-key KEYMAP KEY DEF= )=C2=A0

If it is made into

=C2=A0 =C2=A0 (define-key KEYMAP KEY DEF &optional ALLOW-OVERRID= E)

- 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 si= lently.
- If ALLOW-OVERRIDE is any other non-nil value, overridin= g will happen and that warning is not thrown.=C2=A0
=
--

Kaushal Modi

--94eb2c1cc54283c56a054f68791a--