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 10:03:57 -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> 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="30052"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov , Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 14 17:05:14 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 1lBJtZ-0007iB-Gk for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 17:05:13 +0100 Original-Received: from localhost ([::1]:43350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBJtY-0001FJ-AM for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 11:05:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBJsP-0000ZI-0o for emacs-devel@gnu.org; Sun, 14 Feb 2021 11:04:01 -0500 Original-Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:45679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBJsN-0005Pn-Fy for emacs-devel@gnu.org; Sun, 14 Feb 2021 11:04:00 -0500 Original-Received: by mail-pf1-x431.google.com with SMTP id j12so2694938pfj.12 for ; Sun, 14 Feb 2021 08:03:58 -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=dgdGy2fxBB3yu//MkYtXlhgAZfoOJvkEIO3R4MzpQAI=; b=PqpSJSldbX6i2+UGUzVpNOtuUHDIDZxQ0l0rWG2gJBC+cJ4AsmWcKGo+eBucHolN11 TYGA/BHYtMt4BmXESiGrq1RQDdZ5S8H+6gRe0oWGQd3hIwxBNO8/x6i8HyWjKFiOW3WR KpQ4Yj4Uutk1YZRP+BdP8wipeMAoj2TwOfPU+bMocGi3bvUZtGxSpeF2+BuW11JrYarD wHq413gAAxflTsOICkqQ4R20kyeTIScdBtSFjtl7cYL10GZHpetEJ12H+NXylOnmfgkN WGHsz/qq07/B0RFgDfqHJ1OGwTrE4aRMzntRHzWru8mOJ5A2E0SSiheQRrbHJa09pSn/ uwVw== 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=dgdGy2fxBB3yu//MkYtXlhgAZfoOJvkEIO3R4MzpQAI=; b=gbGJV0gx7xL9YMopS+aCW7tfnuf/JbberTYkhkuu4MvFsNWij1wrIKdIub6eML5vf3 aU4Dpyy4imup9AcRmRDfMgssFvSkSZ8XY5MnZoXJS4KgPf8ipwUsG7Wy0T2nCLJcaacf D6kHBxjyYCbAUX9VsoalQISVbaOcrRpfH30mzaLZga2nB7OahkrLnlq/1RBIEQ9mcAU3 BDvq/JsQu3xCjxwB0JAYj4eG827bJdtMDONKLiFyCi7NPdkquzBKbgTpxUSysyWvm9Jz J1l7alyRhwTv5c0kJnLZRomlSdoh69XXHtgBNwRPQ1hfSbqn5VlxGAR2SJJMfoT0468k qpTg== X-Gm-Message-State: AOAM533i4kJpHhSRAOCAufdbWI239l5bLwwHOAf3Er95NgG71YSxJ8JJ hJJ0ul5BDJQ1IbkXf6ciEIdXCzuMKdglf85Dogk= X-Google-Smtp-Source: ABdhPJyH00xx6P1wKKF8RVIydmuigUoBmXDTzZi0hRZni3ImEi14CrbPLahC0o7oVtjNBhKaMf1ZfAFQV44/mGU0Mxg= X-Received: by 2002:a63:e108:: with SMTP id z8mr11539132pgh.363.1613318637493; Sun, 14 Feb 2021 08:03:57 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 14 Feb 2021 10:03:57 -0600 In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=stefankangas@gmail.com; helo=mail-pf1-x431.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:264717 Archived-At: 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)))) (defun foo (arg) (future-interactive "P" 'fundamental-mode) (message "P was %s" arg))