From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67455: (Record source position, etc., in doc strings, and use this in *Help* and backtraces.) Date: Sun, 10 Mar 2024 17:03:28 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24693"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 67455@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 10 22:04:57 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 1rjQLp-00069J-DB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Mar 2024 22:04:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjQLO-0003JD-W2; Sun, 10 Mar 2024 17:04:31 -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 1rjQLN-0003Iv-4j for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 17:04:29 -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 1rjQLM-0002jH-T6 for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 17:04:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjQLt-00054d-SZ for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 17:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 21:05:01 +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.171010465919453 (code B ref 67455); Sun, 10 Mar 2024 21:05:01 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 10 Mar 2024 21:04:19 +0000 Original-Received: from localhost ([127.0.0.1]:38078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjQLC-00053g-P1 for submit@debbugs.gnu.org; Sun, 10 Mar 2024 17:04:19 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjQLA-00053T-P2 for 67455@debbugs.gnu.org; Sun, 10 Mar 2024 17:04:17 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 324A980B20; Sun, 10 Mar 2024 17:03:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1710104612; bh=qc9l4EalkGXztJtpgRfzLRvo9iUJu8oMmLkQJ7tXHJg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=o7tUZA0GfjLv6AJ5du4yn+UglWgOufHPLtCQT05yD6WFuIGBp0bzqz62POlpS32m0 uKevdFpNOYoHS53LVtt6ThUibW0WPcTxPeY70Odnz51JnSskP4fHHbfJ/eNPsSDm41 Vu5f+jgAkpvuVkOYjA6JvobePlf1YTgPlSjaTj3bscD72atQSP3XE63WQ+byOtEB2Q MFkt6gAG/Opv6o+H1BCxNfjitGZ14UYIljc5dL/mSAydqBbEXdY/yG3xB5ueAlLCV9 D0ppzfBhMChL2/chVjVj8gB6yMliGCvY41ZqSGViekz3ooI+OodkqhdM2LGcNK/BgV btA7BYSy5ButQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F26E98093D; Sun, 10 Mar 2024 17:03:31 -0400 (EDT) Original-Received: from alfajor (69-165-147-56.dsl.teksavvy.com [69.165.147.56]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C3D49120821; Sun, 10 Mar 2024 17:03:31 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Sun, 10 Mar 2024 19:22:04 +0000") 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:281439 Archived-At: >> >> - Testing `byte-compile-in-progress` can't be right. Do you to test >> >> whether the result of this backquote will be byte-compiled or do you >> >> really mean to test whether this backquote happens to be executed >> >> during compilation (which could be because the compiler ends up >> >> loading code while executing `eval-when-compile` or `require`)? > >> > Quite simply, during compilation, all symbols (except nil) get read with >> > position, so to strip their positions here would be wrong. > >> This isn't quite right: during compilation, some code is read with >> positions (the code that we will compile), but some code is read in the >> normal way (the code we load for the purpose of running). >> The distinction is important. > > OK, I wasn't really counting code that we load as "during compilation", > but I take the point. The point is that `byte-compile-in-progress` will be non-nil during those loads, so you can't use this variable to get the information you need. >> More generally: what goes wrong in the above example if you just treat >> that as a list of symbol (stripping them all of their position info). >> AFAICT when *that* macro is expanded (i.e. ME2) you'll presumably get >> code like > >> (mapatoms #'(lambda (FOO/p) (DO/p SOME/p (THING/p)))) > >> right? [ where "/p" means that the symbol has a sympos. ] >> Isn't that sufficient info to add a docstring with position? > > It's the lambda which has a position rather than the expanded bits from > ME2. Hmm... then I misunderstand something. How can the `lambda` have a position if you don't include any special treatment of backquote? AFAICT the `lambda` in the result of ME1 should not include position information because at that time we don't know that it will be used to build code rather than be some element of a normal list. And how come the rest doesn't have position information? Stefan