From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62563: [FR] Expose `interactive' arg handling as an Elisp function Date: Fri, 31 Mar 2023 10:38:21 +0300 Message-ID: <83lejd2wwi.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20467"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62563@debbugs.gnu.org To: Ruijie Yu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 31 09:39:24 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 1pi9M3-00058o-SD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Mar 2023 09:39:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pi9Lk-0002w1-0i; Fri, 31 Mar 2023 03:39:04 -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 1pi9Li-0002vn-68 for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 03:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pi9Lh-0006Q0-Ti for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 03:39:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pi9Lh-0004ev-Pb for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 03:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Mar 2023 07:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62563 X-GNU-PR-Package: emacs Original-Received: via spool by 62563-submit@debbugs.gnu.org id=B62563.168024829717857 (code B ref 62563); Fri, 31 Mar 2023 07:39:01 +0000 Original-Received: (at 62563) by debbugs.gnu.org; 31 Mar 2023 07:38:17 +0000 Original-Received: from localhost ([127.0.0.1]:60272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pi9Kz-0004dx-AN for submit@debbugs.gnu.org; Fri, 31 Mar 2023 03:38:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pi9Kw-0004di-T3 for 62563@debbugs.gnu.org; Fri, 31 Mar 2023 03:38:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pi9Kr-00068p-AK; Fri, 31 Mar 2023 03:38:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=GA5PplCPGQMnupKwpcfvRcoDIjaym5ug263+sU8QdBQ=; b=dML/GSPa8p2X NQH1+K1TfBsA4Dx9DBR8PNvLPXHO6tQyQWPtznmdwyD4JLgWzJH8dzX4Oy7fJflBLHxTHMbMkpzGM RqHPHJUrADtgCKYPd5YK3ma3694GQLObo2ne+oMU02AuNMLAfEYCjJJ30AhkPnPiK3ZqHRFi+paL6 oRRr+LBhsS8t87vH9helu2gWyyK9lPN+qfgRTF4W/RKe0aYf0Fod12e6K5mrNTppaknWSdLjRSqiR 3/JFSlo7QeuSkgZWfhiBMFnZTYHEKsz+/hC4DPN+WtCAQueTBmy0lGqaKtmih912ZA2bnRp1JFNtF JHsI58zBWRGcIXx5bt+0Kw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pi9Kq-0005TH-CR; Fri, 31 Mar 2023 03:38:08 -0400 In-Reply-To: (bug-gnu-emacs@gnu.org) 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:258977 Archived-At: > Date: Fri, 31 Mar 2023 15:27:47 +0800 > From: Ruijie Yu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I find myself sometimes needing to manually write code that do the same > job as the string-form `interactive' would do, like "read for an > existing file name" (the "f" form), etc. This happens because I want to > do the following conversion. > > --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--- > > In short, this is useful when I need to add an interactive argument that > is not already covered by interactive codes, so I have to use the more > verbose interactive list form. I don't think I understand the rationale, so please tell more. The interactive spec can be used like this: (interactive "bBuffer to rename: \nsRename buffer %s to: ") So basically, you can prompt for anything using the 's' descriptor and the following prompt string with %-constructs. In what use cases is this not enough, so much so that it would require exposing the guts of this to Lisp?