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.bugs Subject: bug#62563: [FR] Expose `interactive' arg handling as an Elisp function Date: Sun, 17 Sep 2023 04:31:57 -0700 Message-ID: References: <83lejd2wwi.fsf@gnu.org> <87bke1d3nf.fsf@web.de> 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="38110"; mail-complaints-to="usenet@ciao.gmane.io" To: Michael Heerdegen , 62563@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 17 13:33:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qhq1X-0009kU-GV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Sep 2023 13:33:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhq1I-00025j-AU; Sun, 17 Sep 2023 07:32:56 -0400 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 1qhq1G-00025F-Gn for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 07:32:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhq1G-0003Ic-97 for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 07:32:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhq1N-0005Wg-QT for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 07:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Sep 2023 11:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62563 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 62563-submit@debbugs.gnu.org id=B62563.169495033421178 (code B ref 62563); Sun, 17 Sep 2023 11:33:01 +0000 Original-Received: (at 62563) by debbugs.gnu.org; 17 Sep 2023 11:32:14 +0000 Original-Received: from localhost ([127.0.0.1]:49239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhq0b-0005VW-Kk for submit@debbugs.gnu.org; Sun, 17 Sep 2023 07:32:13 -0400 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:46248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhq0Z-0005VI-OV for 62563@debbugs.gnu.org; Sun, 17 Sep 2023 07:32:12 -0400 Original-Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2bf8b9c5ca0so58234261fa.0 for <62563@debbugs.gnu.org>; Sun, 17 Sep 2023 04:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694950318; x=1695555118; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=MjnHQtGdfvbA/YxBQkTK75Ifz4/B2vDny8tbJc4M7fQ=; b=hpLviIdAk/mtQeix/23KUwF8Ezj+Eeq/fTTclQ4MrTTn6i+SlMusak5bupFkbuFPLY uFZNmsTNB7n6cg6f75u/CRPRScgSNtukfj/Nevpxor4VSaLbvJtaQjw6tUeOKde6nqbh Fc10WjI25G5o86cXpF8OnAM+B4yJ5jTd0ew4ThuEBJCQrCfKnKamWu2lSIEz9lTkJHE0 zfEdMA2xHCf5sfYv9g9C0NDgUyLLNYj49y/1pjHGnHpThWt+DKK2YUjyqeMJQ8OeYfvz injIjz4gN9rVn4aX+F3GxS7zh0TsEz3DZXtoG3i7DWUPxwHAvb6C0E9eMbXazReOLGfh 8lIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694950318; x=1695555118; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MjnHQtGdfvbA/YxBQkTK75Ifz4/B2vDny8tbJc4M7fQ=; b=kgiaNnMeHYALyPKHKRJs5VG9MSKS/dHWr/fjX3eQtKTanLXWGBjOnQ51hcOHunFjbs wgkVDUGyTHSLJxduGip1FAYtZm4JB8KM3CPxNNVBvb+2iglCYotGU/Y+RB50cI151nNe O4L1qnvCijdHOoCnKHutYzwITtnyV6u07SA1cWoNYGKCNckTqpWl4VQzUMB2D+smvHAI nqAlLT5YbhebhXKqVisinKLQVKOQgvNK/15WxQcoGXXAHIFo2ng/1Z4/Cico9D2r5zCB cP3iY8J4VJb9O9eKsGIIBXEkO50xYhG8u0yPQo5aBC9i8BnXCUTN9K0rEpw9aipYrrMZ 335w== X-Gm-Message-State: AOJu0YyHZ/ffQlxiPkJld0z9i2Tcg36dyOk56gwjEzsmZDwBvtEi02SY BiEXc1C3/BKFRr2+/ruEie6IdtNpmCp2U+bADrE= X-Google-Smtp-Source: AGHT+IGGarfl4rNmaB9YelsoW3T8/NC7F31n7OGt0RCQ7yoj9OVLSgcejGmZ4+hZtBaegwpFR6cH2WhDHsNLx/0MZ8g= X-Received: by 2002:a05:651c:1a27:b0:2bf:f5c9:2dce with SMTP id by39-20020a05651c1a2700b002bff5c92dcemr2919546ljb.30.1694950317947; Sun, 17 Sep 2023 04:31:57 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 17 Sep 2023 04:31:57 -0700 In-Reply-To: <87bke1d3nf.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270694 Archived-At: Michael Heerdegen writes: > Stefan Kangas writes: > >> >> --8<---------------cut here---------------start------------->8--- >> >> (defun foo (fname) >> >> (interactive "f") >> >> (ignore fname)) >> >> >> >> (defun foo (fname bar) >> >> (interactive >> >> (list (simulate-interactive-f) >> >> (get-bar))) >> >> (ignore fname bar)) >> >> --8<---------------cut here---------------end--------------->8--- > > Something like this can be useful if you need to read an additional > argument in a way that involves the need to run some Lisp, where using a > normal code letter is not enough. Then you need to substitute the other > code letters you still want to have been read also with Lisp code. Is > that understandable? Yes, I think that explanation is clear. > We have `advice-eval-interactive-spec' which can be used like > (advice-eval-interactive-spec "f") - that comes very close to what is > requested here. Combined with `interactive-form' one can use this to > simulate the argument reading from a given command from Lisp. > > `advice-eval-interactive-spec' has a FIXME: > > | ;; FIXME: How about renaming this to just `eval-interactive-spec'? > | ;; It's not specific to the advice system. > > Any opinions whether we want to do that? If the implementation is not > something ugly (it probably is, a bit, though), I would vote for it. Could you point to one (or more) examples of real code that would have been made significantly simpler by this? The idea sounds good in theory, but it is important to understand if it will also be useful in practice. That will give us a better basis for deciding if this is something we would want to add or not.