From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: scratch/command 064f146 1/2: Change command to interactive ... modes Date: Sun, 14 Feb 2021 16:58:13 +0000 Message-ID: References: <20210213141225.11309.86562@vcs0.savannah.gnu.org> <20210213141226.EEDFE20999@vcs0.savannah.gnu.org> <47209379-76df-4c97-e5ff-b3b04da0db1d@yandex.ru> <87zh07of0e.fsf@gnus.org> <0605ed62-a785-d190-caf2-2232e1db3b0f@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30846"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org, Dmitry Gutov To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 14 18:02:21 2021 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 1lBKmr-0007uN-2v for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 18:02:21 +0100 Original-Received: from localhost ([::1]:55644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBKmp-0006Yt-OG for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 12:02:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBKiy-0004zS-Fi for emacs-devel@gnu.org; Sun, 14 Feb 2021 11:58:20 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:56632 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1lBKiv-00049h-V2 for emacs-devel@gnu.org; Sun, 14 Feb 2021 11:58:20 -0500 Original-Received: (qmail 85643 invoked by uid 3782); 14 Feb 2021 16:58:15 -0000 Original-Received: from acm.muc.de (p2e5d5f6c.dip0.t-ipconnect.de [46.93.95.108]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 14 Feb 2021 17:58:14 +0100 Original-Received: (qmail 7749 invoked by uid 1000); 14 Feb 2021 16:58:13 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=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.23 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" Xref: news.gmane.io gmane.emacs.devel:264730 Archived-At: On Sun, Feb 14, 2021 at 10:03:57 -0600, Stefan Kangas wrote: > Stefan Kangas writes: > > Dmitry Gutov writes: > >> If it's not backward-compatible at all, however, I wouldn't feel > >> comfortable with using it in my packages for years to come. > > Could we write a macro `future-interactive' that will expand to the > > correct thing depending on the version of Emacs? We could put something > > like that in GNU ELPA. (I'm not sure the order in which things are > > expanded, so this might not work.) > This seems to work as expected on both master and Emacs 27: > (defmacro future-interactive (arg-descriptor &rest modes) > (if (< emacs-major-version 28) > `(interactive ,arg-descriptor) > `(interactive ,arg-descriptor ,@(mapcar #'eval modes)))) It won't work in Emacsen before Emacs 28, because it doesn't exist on those systems. This idea would mean having to distribute the macro with every package, with all the evils that would entail. > (defun foo (arg) > (future-interactive "P" 'fundamental-mode) > (message "P was %s" arg)) Please, can't we just halt all this and take stock? `interactive' specifies how to call a lisp function interactively. This new stuff being put it has nothing to do with the interactive call. It will foul things up horribly. Why can't this new feature be implemented without introducing incompatibilities? What am I missing? -- Alan Mackenzie (Nuremberg, Germany).