From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#67455: (Record source position, etc., in doc strings, and use this in *Help* and backtraces.) Date: Tue, 19 Mar 2024 16:18:43 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18567"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , 67455@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 19 17:21:19 2024 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 1rmcDH-0004j0-D8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Mar 2024 17:21:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmcBR-0005RI-Bq; Tue, 19 Mar 2024 12:19:25 -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 1rmcBQ-0005Qd-3H for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2024 12:19:24 -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 1rmcBP-00048k-Qp for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2024 12:19:23 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rmcC2-0005d2-Bt for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2024 12:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Mar 2024 16:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67455 X-GNU-PR-Package: emacs Original-Received: via spool by 67455-submit@debbugs.gnu.org id=B67455.171086517221446 (code B ref 67455); Tue, 19 Mar 2024 16:20:02 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 19 Mar 2024 16:19:32 +0000 Original-Received: from localhost ([127.0.0.1]:51231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmcBX-0005Zp-Kh for submit@debbugs.gnu.org; Tue, 19 Mar 2024 12:19:31 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:18581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmcBV-0005Za-6o for 67455@debbugs.gnu.org; Tue, 19 Mar 2024 12:19:29 -0400 Original-Received: (qmail 40253 invoked by uid 3782); 19 Mar 2024 17:18:44 +0100 Original-Received: from acm.muc.de (pd953ae04.dip0.t-ipconnect.de [217.83.174.4]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 19 Mar 2024 17:18:44 +0100 Original-Received: (qmail 27244 invoked by uid 1000); 19 Mar 2024 16:18:43 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.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:281839 Archived-At: Hello Stefan. On Wed, Mar 13, 2024 at 07:52:50 -0400, Stefan Monnier wrote: > > OK, so it seems like I'll need a new pcase arm in macroexp--expand-all, > > and this new code will need to handle (function (cons 'lambda ...)), and > > the like. > If macroexp--expand-all receives code of the form > (function (cons 'lambda ...)) > it means it received broken code. > IOW, such an arm will never do anything useful (the best it can do is > emit a warning). > I suspect what you're looking for is yet different. How about the following (as yet vague) idea? (i) Amend backquote slightly so that the integer part of the result of backquote-process gets transmitted to the caller, somehow. This would let macroexp--expand-all know it's dealing with smething awkward like `#'(lambda ,@args . ,body). (ii) On encountering such, m--e-all would insert a call to (new macro) macroexp--maybe-posify-lamda-form at ME1 time. (iii) At ME2 time, m--e-all should be able to tell whether or not the lambda form is "real". In this case the macro would be replaced by a call to (existing) byte-run--posify-lambda-position. Whether or not this is done, the SWP lambda would be stripped of its position. This might work. What do you think? > Stefan -- Alan Mackenzie (Nuremberg, Germany)