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: Sun, 24 Mar 2024 11:21:10 +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="28978"; 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 Sun Mar 24 12:22:12 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 1roLvX-0007NV-Nt for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Mar 2024 12:22:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1roLvC-00043Z-Hb; Sun, 24 Mar 2024 07:21:50 -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 1roLul-0003we-AT for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2024 07:21:26 -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 1roLuk-00034v-7a for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2024 07:21:23 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1roLvP-0002GG-Sh for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2024 07:22:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Mar 2024 11:22:03 +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.17112793218652 (code B ref 67455); Sun, 24 Mar 2024 11:22:03 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 24 Mar 2024 11:22:01 +0000 Original-Received: from localhost ([127.0.0.1]:50245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roLvN-0002FO-5L for submit@debbugs.gnu.org; Sun, 24 Mar 2024 07:22:01 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:36021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roLvL-0002Et-6y for 67455@debbugs.gnu.org; Sun, 24 Mar 2024 07:21:59 -0400 Original-Received: (qmail 26008 invoked by uid 3782); 24 Mar 2024 12:21:11 +0100 Original-Received: from acm.muc.de (p4fe15d23.dip0.t-ipconnect.de [79.225.93.35]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 24 Mar 2024 12:21:11 +0100 Original-Received: (qmail 11661 invoked by uid 1000); 24 Mar 2024 11:21:10 -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:282021 Archived-At: Hello, Stefan. On Tue, Mar 19, 2024 at 21:40:12 +0000, Alan Mackenzie wrote: > On Tue, Mar 19, 2024 at 16:47:46 -0400, Stefan Monnier wrote: > > > This might work. What do you think? > > I don't know what is the problem you're trying to fix, so it's hard for > > me to have an opinion. > > Could you clarify what is the problem when backquote is not changed > > at all (after all, this is the problem that will also occur if the > > programmer happened to use `cons/list` instead of backquote)? > When Lisp gets read for interpretation, defined symbols (e.g. folliowing > defun or cl-defgneric) get positioned, as do lambdas. When there are ,s > or ,@s on the arg list or the doc string of the lambda, the lambda > currently gets posified by the new code in backquote-process. Without > the new code, the "complicated" lambdas retain their positions, which > cause errors in pdump, which doesn't (and shouldn't) handle SWPs. I was possibly too dogmatic about this. I've actually amended pdumper.c to handle SWPs, and this appears to be working well. The SWPs from "complicated" lambdas get recorded in the dumped image, and later used in ME2. I've reverted my changes to backquote.el. :-) > You're right about my sketched approach not working if the programmer > uses cons/list instead of `, ,, and ,@. (Thanks!) Maybe I can somehow > wait until (cons 'lambda (cons args body)) has been evaluated in ME2, > before posifying the lambda. And also take the change out of > backquote-process. Now coded up. > With this idea, most of the new code would go into the (`(function ,(and > f `(lambda ,_ . ,_))) ...) pcase arm of macrexp--expand-all, with > possibly a new arm to catch and "neutralise" the remaining lambdas, which > aren't functions. It turns out there was little (?nothing) to change in macroexp--expand-all. The code was there already. > > Stefan -- Alan Mackenzie (Nuremberg, Germany).