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:17:15 -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> <87mtw6d480.fsf@gnus.org> 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="7894"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Dmitry Gutov To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 14 17:18:55 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 1lBK6o-0001yW-TB for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 17:18:54 +0100 Original-Received: from localhost ([::1]:57414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBK6n-0000Qk-P4 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 11:18:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBK5J-0007Yj-Hc for emacs-devel@gnu.org; Sun, 14 Feb 2021 11:17:22 -0500 Original-Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:43301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBK5G-000865-2J for emacs-devel@gnu.org; Sun, 14 Feb 2021 11:17:21 -0500 Original-Received: by mail-pf1-x432.google.com with SMTP id c11so2717651pfp.10 for ; Sun, 14 Feb 2021 08:17:16 -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=xHXKwekoCMy0ejo78G5TRIxpmroGXIxkUnoOtdjFm44=; b=MAU0yC2sy+GVJmGQR00FqVIAHXI3DG6x0n48oPb6SMubzw3yLh4DLUPuE+GSz1DC4T prcOWOi2PrEwR4G+m26tksN0a0UMYVNKJDnwFVQkyYmoFTZ7L0HLav0qfRkRPJm8ozVV gSMPOu6m5XyLzKF0Vd0wGIYM6F8FxRJpsXIrD+f02cdRjeIzhLCIWl3OajJc4Qp2ok3J qm9Df6fX4DgR3m6WIGHmLD8z8XQQfavkiHbBl+oXROJXVTsIGJX/7xotw0XAuMRVJX9E S1/z1BSHaqRf96VQh1RpniLR+jyEa0wvzwyzVBqKBLP44vGfcg1rnuYs3He+GBvq/vq5 u0IA== 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=xHXKwekoCMy0ejo78G5TRIxpmroGXIxkUnoOtdjFm44=; b=tIiMuVnF/H5dz1unl7YMJVp1CSrfqtk4dWBvyJwCFtxN62ZZ07jEbJlE1jMHdNtcSH sdnMd0p58r403aAJPgIFotpa7sTUImiAACl4FuN3eG2SG2FR4WyDv2lLIRS1h3YuWWkk XbF5vdza1OYxnHzVaIZZqjI1vwO89mguycIBwCGqNMzQvZ7CAXEfiYL4BgWzWRXcjRaM zKKnNqIRKkWgkhj+wcgCqrmnKt0UPiPW8dmglFS6OrAG1bIosf50QhrZeTehh7LviHpn xsX3bsuunCHj9jPIl7tQIHvUKyiS5A+/zbbNPL6cTc+q0/0lDj2TeAFXq/j8WFlATZ8m HSpA== X-Gm-Message-State: AOAM532kWch7+WmvkP6HNL4gBhDq1inIXZ4cw6bGLFYXvEpQEpJyARxN EKp6ibfIS3+3vvF0DU+qT4v6PtgAnJVDeH/2YlU= X-Google-Smtp-Source: ABdhPJxV5vnOI19acuXbXgttWAoBpL9OYWZIeUhnfJDzSclRCY/ctD/kD6dzljb7AHds9hs1V8oXi3J1sOeqqqpJktY= X-Received: by 2002:aa7:86d8:0:b029:1b5:1121:729a with SMTP id h24-20020aa786d80000b02901b51121729amr11840540pfo.57.1613319435975; Sun, 14 Feb 2021 08:17:15 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 14 Feb 2021 10:17:15 -0600 In-Reply-To: <87mtw6d480.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=stefankangas@gmail.com; helo=mail-pf1-x432.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:264722 Archived-At: Lars Ingebrigtsen 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)))) >> >> (defun foo (arg) >> (future-interactive "P" 'fundamental-mode) >> (message "P was %s" arg)) > > Cool! Does it survive byte compilation, too? Hm... I guess so, > because macros should be expanded by that time, I guess? It seems to survive, yes. Byte-code on Emacs 27: (defalias 'foo #[(arg) "\301\302^H\"\207" [arg message "P was %s"] 3 nil "P"]) Byte-code on master: (defalias 'foo #[(arg) "\301\302^H\"\207" [arg message "P was %s"] 3 nil ["P" (fundamental-mode)]]) So I could pack it up as a new GNU ELPA package `future-interactive', and anyone who wants to use it, can. Or should it be a core package perhaps?