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 23:56:12 +0100 Message-ID: <21d9dd07-22f6-03be-1c8b-5d7e4fd1ff80@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> <83sffpze9h.fsf@gnu.org> <309dee07-e404-4f84-a839-8b99815376f8@daniel-mendler.de> <83mt5xz42d.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17367"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , rpluim@gmail.com, larsi@gnus.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 01 23:57:03 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 1pNM2H-0004MF-J3 for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Feb 2023 23:57:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNM1f-0001JT-K5; Wed, 01 Feb 2023 17:56:23 -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 1pNM1e-0001JK-3u for emacs-devel@gnu.org; Wed, 01 Feb 2023 17:56:22 -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 1pNM1b-00042y-LP; Wed, 01 Feb 2023 17:56:21 -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=y+kc0JoqBxsWQlto2tPMAYNW/oyhsL16rBneSHVx9Jw=; b=yShnyF7FfRhi6Fxfsp1iVOZZv0 2plOTWvBlcbecleGZQ+U25qMsZts2YNK2bANWTkEYLnndMfWJ2xwGuiMm9W9W2zetaUr00QeaEkbM kzpSZGD1DVtVT+onVBGJRD7Uxq/x1rgnYCou9vyjB1c0WE38iCPz7sNaQyoR3D3zTXEo=; Content-Language: en-US In-Reply-To: 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:302880 Archived-At: On 2/1/23 23:42, Stefan Monnier wrote: >>>> I think call-interactively-p would be better for this use case, but >>>> that's my opinion versus yours. >>> Have you ever looked at the implementation of `called-interactively-p`? >> I guess there is no doubt that we all agree that the implementation is >> not great. > > The problem is that it's not the fault of the implementation. > The idea of having it as a function is fundamentally flawed, which is > why the function can be nothing but a mess. Yes, I agree. >> But I would not consider it prohibitively bad, such that it >> should never ever be used in new code. If that is the case why is the >> function not officially deprecated? > > `called-interactive-p` is in the same category as `advice-add`. > It's great that we have it, but you should only use it when there's no > other way. I would go so far to say that `advice-add' is technically much saner than `called-interactively-p`. I wouldn't want to miss `advice-add'! >> To be clear, I was aware of the recommendation to avoid >> `called-interactively-p' and iirc I have not used it in any of my >> packages. It is a kludge to use it, but using "hidden arguments" and >> "advertised calling convention" seems as much a kludge in my eyes. > > Maybe they're kludges, but at least they have a well defined meaning. > `called-interactively-p` is in a completely different category of kludges. Well, this is where I disagree. It is a *technically* kludge, but it will only occur within the innards of the function, and it won't be exposed on the level of the function calling convention. The advised function calling convention is a kludge which is exposed to the caller of the function - hidden or not. >> The problem with the hidden INTERACTIVE (or ALLOW-VECTOR) argument is >> that it is still somewhat exposed to non-interactive callers. For > > Emacs is not in the business of imposing The Right Way, instead we > prefer to encourage it while still allowing people to shoot themselves > in the foot in all kinds of fun ways. Tell that to Eli, who seems to be in the business of preaching The Right Way and also following it. At least that's better than preaching water and drinking wine. But that's beside the point - keymap.el is a newly introduced library with a newly designed API. I would expect that such a library can be implemented according to the best practices without any kludges - without `call-interactively-p' and without advertised calling conventions. That this does not seem to be possible, leaves me unsatisfied. Well, it would actually be possible, we just have to do it differently - either allowing vectors as arguments or by using a different interactive form calling `keymap--read-key`. But these better solutions were rejected for other reasons. Daniel