From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: scratch/command 064f146 1/2: Change command to interactive ... modes Date: Sun, 14 Feb 2021 11:23:42 -0600 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> <87h7metx0w.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7085"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org, Dmitry Gutov To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 14 18:24:52 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 1lBL8e-0001kx-9C for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 18:24:52 +0100 Original-Received: from localhost ([::1]:59290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBL8d-0006Pp-BS for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 12:24:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBL7Z-0005NJ-Rb for emacs-devel@gnu.org; Sun, 14 Feb 2021 12:23:45 -0500 Original-Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:44777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBL7Y-00081J-3L for emacs-devel@gnu.org; Sun, 14 Feb 2021 12:23:45 -0500 Original-Received: by mail-pg1-x52f.google.com with SMTP id a4so1339433pgc.11 for ; Sun, 14 Feb 2021 09:23:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc; bh=hzMH6/1pIAjZIi8cx60gFUICN3QwMQg4DSDeIrFEkwE=; b=sNhFDqtoActWUh/6yXKHEQ5ITaIx6ZL0t1DJyfFvJpEElnYd35uD6yl0x257lPvVSs e4ljws4pmNzWBMRhvtGMIlQBqpQFwU4SHVvIjxjZEOI92YXNRCb2vcXvv1QmSzQTJl2Z Es56oeVd4fcTyMRgD8qwl2bk+URjtI3RCXakkIDHQ5uCsPMHzpEymvJif8pKpbkTfXFR QQyHymprmmrVktlaCQpgHUiEPyrWJN5iWCvHC8cdTYImjQnbWYXLedR2BatEleFtSraf /KHdh7xITW/VmWuuofB+PNoY8MWbhEIqBMVW0++NtTBi7jjkjFgQbOdcC9meYOSJFPpK QO5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=hzMH6/1pIAjZIi8cx60gFUICN3QwMQg4DSDeIrFEkwE=; b=DfrDiGEAdX+fwj1UpHfIrraBYe42SG8lPMWsGxUdwVFMYTLY6IDkwlGw3nJ8/lUXcU fq/HIg2icT74UmqdqBENN+j7JoCBnohM7xUXoDQMy+MLpWEHp0bunfcTnjcq+QCdL0CU Vc3uiC/H6XzWCpFMUytXltvrz3fuULb5SXXmdlKBB0Wig6PXLbfGpTM+0mZr/fEd6tIH WvKVd8EYsBGhNFixmNJ6hhihEGd3/ftn7FOpHEw6e2p1SVqkU0p2kUjnG/CalxDpRl3t u1m5DRM2UTMSDQeXmN4TiD0NPWDwG3KKmWrncne6UQ64KuJFMSXnYbyATDYa10Ap+n2c K0KQ== X-Gm-Message-State: AOAM533B+wnYpHXk4Z0jyuT/N4Vy9Up1Y1U5tCDx4KGxK45YAkHcqZPV ek+QMZ/YZq446qPOeu5Cg5D/IR4+jJfoxmlJN9E= X-Google-Smtp-Source: ABdhPJx6/9KkxbYNZtok0qVAT5zQu1hEtfwf7NzGU2iKkKl2im7SkO/n0KXUT5z3WA4YpOzFpqVRexnADqmxcYiRPJI= X-Received: by 2002:a63:df11:: with SMTP id u17mr11866528pgg.345.1613323422596; Sun, 14 Feb 2021 09:23:42 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 14 Feb 2021 11:23:42 -0600 In-Reply-To: <87h7metx0w.fsf@tcd.ie> Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=stefankangas@gmail.com; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:264735 Archived-At: "Basil L. Contovounesios" writes: > Stefan Kangas writes: > >> 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)))) > > Why is the eval necessary? Because the correct interactive form is: (interactive ... foo-mode) Rather than: (interactive ... 'foo-mode) >> (defun foo (arg) >> (future-interactive "P" 'fundamental-mode) >> (message "P was %s" arg)) > > I thought (declare (modes ...)) was the intended way of achieving this > in packages that need to support older Emacsen too. Hmm, I suppose that could work. I have no strong opinion, but it might be a bit messier than the macro. OTOH, you don't need the macro for that. Maybe we could support both?