From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.devel Subject: Re: 29.0.60; keymap-local-set and keymap-global-set became less strict Date: Wed, 1 Feb 2023 15:11:02 +0100 Message-ID: <01093ff6-213e-6486-609f-d80b779f8ac3@daniel-mendler.de> References: <5876987d-2479-f512-5767-218c8c16a909@daniel-mendler.de> <875ycngyji.fsf@gnus.org> <87zg9zvzuc.fsf@gmail.com> <831qna3frm.fsf@gnu.org> <87mt5yogct.fsf@gmail.com> <83y1pi1wz4.fsf@gnu.org> <87ilgmodk4.fsf@gmail.com> <83mt5y1r5u.fsf@gnu.org> <87bkmdo8e4.fsf@gmail.com> <831qn91qo0.fsf@gnu.org> <137753af-777d-2da3-c111-7e2d414633f1@daniel-mendler.de> <877cx1o5z9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14812"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , larsi@gnus.org, emacs-devel@gnu.org, monnier@iro.umontreal.ca To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 01 15:11:58 2023 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 1pNDqA-0003bV-9m for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Feb 2023 15:11:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNDpV-00035m-9i; Wed, 01 Feb 2023 09:11:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNDpS-00035K-Pm for emacs-devel@gnu.org; Wed, 01 Feb 2023 09:11:14 -0500 Original-Received: from server.qxqx.de ([2a01:4f8:121:346::180] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNDpP-0006rS-Cr; Wed, 01 Feb 2023 09:11:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=58HpwyhHryrAGaizQBat/YFdOEXKLUPvJRnAeMzBb+A=; b=y+hs7f8i8Lqibm3Yehn57oEafa MeMvw8IfLMEUpaYvJH3xMviZmwuuuV1qFFKkpWhMDFwgV/chVz0q6/9qrnEEF5MWReF2EYHLT8yT3 hUsgvmGN7WMxRqsrNl19pUMbdBzRU+ZdTMmyru/Zoq4SAWzwA5lNsXHiIl8M/6OpVDy4=; Content-Language: en-US In-Reply-To: <877cx1o5z9.fsf@gmail.com> Received-SPF: pass client-ip=2a01:4f8:121:346::180; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302863 Archived-At: On 2/1/23 14:44, Robert Pluim wrote: >>>>>> On Wed, 1 Feb 2023 14:13:25 +0100, Daniel Mendler said: > > >> Yes, exactly. Thanks. > >> > >> Unless anyone else objects, please install this in a day or two. > > Daniel> I object. With this change the non-interactive implementation is > Daniel> polluted with an unnecessary INTERACTIVE argument, which would then > Daniel> allow the non-interactive caller to still pass vector arguments. You > Daniel> could as well call the argument ALLOW-VECTOR. If the non-interactive > Daniel> function gets extended at some point with additional arguments how > Daniel> should we proceed then? I also argue that the primary use case of these > Daniel> functions is non-interactive and that should be prioritized. > > I use `local-set-key' interactively all the time, so Iʼm not convinced > thatʼs generally true. I base my argument on the fact that many users modify keybindings in their user configuration. However this applies more to `keymap-globl-set' or `global-set-key'. But there is not much point in arguing about such statistics since we want to have both non-interactive and interactive use supported. My point is that in a newly designed keymap API there should not be a place for such superfluous arguments which are only a leak of the underlying implementation to support the interactive use case. > Daniel> Why can you not just move the whole conversion business into the > Daniel> `interactive' form? This means we cannot use a string as interactive > Daniel> form but we have to implement our own `keymap--read` function which is > Daniel> then used like this: `(interactive (list (keymap--read ...) ...))`. It > Daniel> is not as concise as the string form but would avoid any problems. > > Thatʼs basically my previous patch with the repetitive code moved into > a separate function as Stefan suggested. Or we could avoid the extra > arg by using `called-interactively-p' Yes, your patch plus Stefan's improvement proposal seems like a reasonable solution to me. > Daniel> As better alternative we could also go with Stefan's proposal to allow > Daniel> vectors as arguments in the first place. This would resolve this issue > Daniel> cleanly without any extra code. > > And this goes against Larsʼ intentions for the new keymap code, so I > donʼt think thatʼs a good idea. Yes, it does. But I am neutral with respect to that decision. I would be okay if all keymap functions accepted vectors as I would be if they don't. But given that we have to jump through hoops to achieve our goal, maybe relaxing the strictness would indeed be better as Stefan proposed. Daniel