From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: 29.0.60; keymap-local-set and keymap-global-set became less strict Date: Fri, 03 Feb 2023 04:56:48 -0500 Message-ID: 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> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3162"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@daniel-mendler.de, eliz@gnu.org, 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 Fri Feb 03 10:57:48 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 1pNspH-0000Xp-Ck for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Feb 2023 10:57:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNsoO-0002wT-OQ; Fri, 03 Feb 2023 04:56:52 -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 1pNsoN-0002wK-4D for emacs-devel@gnu.org; Fri, 03 Feb 2023 04:56:51 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNsoL-0004Zk-9Z; Fri, 03 Feb 2023 04:56:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=24EQTLmTMBtyCao07QXtDIGVYtg1yigJ8akX+qUARMU=; b=iyGY9iLuI73q SKELz19+ojXs3/+J+B7nFanogr/iC+PNZa5LbZOa6/huYyit36OnbuMq6dpn74gwrkGYVxuFNLIz6 HSZBbRMNFgSYhxRC8Az8bGQznuzFqpOEp4i7KJABUt2ATaqkfPHIw492mrPNj1AamohXJFfH6zsDQ h5nlyIWX1VcGSlCxN9YAKsKGqi/dyS8OwjUSB6yP1Y5cABGFPs6Fdqn3Wt7dp1bgxPqqRqpJ3puPB UZL45JSIH9llrSeqrU73Wjh5w0a0oTWZO+TLtf+A7DryycLUrQ7P1y+WEJQ2JMT5obgJRvNMz9yYa 5Vg3Kms2P7EUi+kYqUZYOg==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1pNsoK-0005zU-U2; Fri, 03 Feb 2023 04:56:48 -0500 In-Reply-To: (message from Stefan Monnier on Wed, 01 Feb 2023 17:42:04 -0500) 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:302921 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > `called-interactive[ly]-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 wrote the recommendation to use an extra argument to distinguish interactive calls because it is simple, reliable, and understandable. It uses mechanisms that we use all the time in other ways. When you look at code which does that, you will understand what it does. `called-interactively-p' can't help being complex because it needs to figure out retroactively how the call took place. The extra argument method instead arranges to remember how the call took place, Ideally, we should obsolete `called-interactively-p' and then eliminate it. Hwever, first we'd have to replace all the uses of it and thus verify that absolutely all of them can be replaced. I'm not sure it is worth the effort to do this just to make things cleaner. The recommended method replaces (called-interactively-p 'any). Is there an easy way to use this approach to replace (called-interactively-p 'interactive)? If not, we could create one: define an interactive spec which supplies the proper value for the distinguishing argument. Is there already a way to do that? > The problem with the hidden INTERACTIVE (or ALLOW-VECTOR) argument is > that it is still somewhat exposed to non-interactive callers. For > example, in the context of the Compat library, should this argument be > made available, since non-interactive callers may want to use it? What > if callers start to use it if they want to pass vector arguments? I don't know enough about that code to follow the argument here. Could someone tell me what the Compat library does? Is it in Emacs -- if so, what is the file name? > To come back to `keymap-local-set' - the good thing is that we can avoid > both kludges, advertised calling conventions and `call-interactively-p'. > All we have to do is move the key reading entirely to the interactive > form, which also seems to be semantically most correct. If I would rate > the possible solutions: > 1. Just allow vector arguments for all the functions. Simplest solution, > least amount of code. If the change this advocates is what I think it is, it would inconvenience users by making them change their old code. If someone thinks that the extra-argument solution has a flaw in this case, would you please present reasons for that conclusion> -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)