From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Make format-spec accept a function as the substitution Date: Thu, 29 Sep 2022 08:36:49 -0400 Message-ID: References: <166336105908.23797.12319380359602540227@vcs2.savannah.gnu.org> <20220916204419.B124FC00872@vcs2.savannah.gnu.org> <87edwavjyc.fsf@yahoo.com> <87wna1tr7z.fsf@yahoo.com> <87y1u51ddf.fsf@posteo.net> <87edvwrfg7.fsf@gmail.com> <83wn9oixdr.fsf@gnu.org> <83tu4sivtq.fsf@gnu.org> <87fsgatzvo.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24365"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Stefan Kangas , Eli Zaretskii , visuweshm@gmail.com, luangruo@yahoo.com, emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 29 16:44:41 2022 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 1odumG-00068P-9U for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Sep 2022 16:44:40 +0200 Original-Received: from localhost ([::1]:41706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odumE-0004Uy-Fn for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Sep 2022 10:44:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odswN-0004G6-Ib for emacs-devel@gnu.org; Thu, 29 Sep 2022 08:47:01 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:61234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odswK-0004CE-PX; Thu, 29 Sep 2022 08:46:58 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5B714442419; Thu, 29 Sep 2022 08:36:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 14FD344209B; Thu, 29 Sep 2022 08:36:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664455010; bh=90Up1mjIvThbFsOoo5wYsNwrl4rmW/0Gqw7A48K7GAE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DKy1XTKOJT9BT6Tvf+xwyZqK9FSlqIonnD1xVvHTRdaeRjqVNeMfeqGUUxg/jKsUP EahpYmXkwOsfnSDNL5msI6Ff4zfE5CWnq/XXKnt3pFJMPeW9kCbTO2huvhIP17Vuv2 UDFWYNhPP9EUM8IuhN8faWBiEt6zkSz7H05N0fiiQ5TBwKWaRrHs+K33Myly03Tm5u tbfSoFDLP3sW2e5/yTJ3PYDVJ6KeKadQAuVR+J4C//IB+ZFB7CVNwAj2q/N+wr2lVQ T0zXFE5dpBwL9hS8fD/OUOLS8kDri+HHL7tdQh7/6e8w2X+o0NTcWsPPOMGgIIGIEt Ls99lHPtdWZZA== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D0E7F120974; Thu, 29 Sep 2022 08:36:49 -0400 (EDT) In-Reply-To: <87fsgatzvo.fsf@posteo.net> (Thierry Volpiatto's message of "Thu, 29 Sep 2022 06:57:07 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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.29 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:296460 Archived-At: Thierry Volpiatto [2022-09-29 06:57:07] wrote: > After thinking at it, it would be great to allow using interactive calls > in specs without wrapping them inside a function: > > Using this should ask for line number and file: > (format-spec "Go to line %n in file %f %g" '((?n . (read-number "Number: = ")) > (?g . "now") > (?f . (read-file-name "File:= ")))) ELisp forms under a quote make me cringe. Code should be quoted with `lambda` (which you run with `funcall` or `apply`), not with `quote` (for which you need to use `eval`). So we should aim for a source code of the form: (format-spec "Go to line %n in file %f %g" `((?n . ,(=CE=BB () (read-number "Number: "))) (?g . "now") (?f . ,(=CE=BB () (read-file-name "File: "))))) -- Stefan