From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Make format-spec accept a function as the substitution Date: Thu, 29 Sep 2022 15:02:56 +0000 Message-ID: <87zgeixly7.fsf@posteo.net> 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="40205"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thierry Volpiatto , Stefan Kangas , Eli Zaretskii , visuweshm@gmail.com, luangruo@yahoo.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 29 17:54:10 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 1odvrW-000A9a-C1 for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Sep 2022 17:54:10 +0200 Original-Received: from localhost ([::1]:34042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odvrV-0002q3-8f for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Sep 2022 11:54:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odv49-0003Ts-4H for emacs-devel@gnu.org; Thu, 29 Sep 2022 11:03:09 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:49301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odv46-0002Pm-IP for emacs-devel@gnu.org; Thu, 29 Sep 2022 11:03:08 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 8CA8E240029 for ; Thu, 29 Sep 2022 17:03:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1664463784; bh=SckzXjwgp3o6EEafkvDkkXDFKPuQPZ3eFK+TiyuYJbY=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=OGzPCSfge6hhvCt5hxEckvjFIdKU6piE5x1KbvtgMJkcrG6r9iO1EIMII+KMCqwWF YUyQvFiTihJ0TEqhGe/NKgyQrqUnzyf9KC2Bgjej3Ne7CbqaTOuImb9w9AeiV6pec4 SQX7bkyXNa4BSjc/LCOUDO9neKo6OnT0zVQ3kIAH1HMN/7Ez4Bcx3nDyfCp9o2zLkv UqZY+TEUlc7B59VXn2sGT7Obu/BRyUbYP5HXmwjmQ2m/JMgJxROMBdVwyBs+iPWMuh hCbviGwDglguLZB6xdZDLRFyXveeKL83P+02O9yJqI1yQzLGZsZtVflBx2CuI4jG3h RYkBAZu6ssTRA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Mdc6t37jVz6tnW; Thu, 29 Sep 2022 17:03:02 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Thu, 29 Sep 2022 08:36:49 -0400") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, 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:296464 Archived-At: Stefan Monnier writes: > 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: "))))) Is there no worthwhile information to pass the lambda function? (I like the =CE=BB notation by the way, would be nice to have a (defalias '= =CE=BB #'lambda) in subr.el). > > -- Stefan