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: Mon, 25 Mar 2024 14:23:50 -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="8635"; 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 Mon Mar 25 19:34:25 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 1rop9J-0001q0-LB for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Mar 2024 19:34:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rop9A-0001bm-0J; Mon, 25 Mar 2024 14:34:13 -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 1rop91-0001b2-ED for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2024 14:34:03 -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 1rop91-0007uY-3O for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2024 14:34:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rop90-0002lO-9J for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2024 14:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Mar 2024 18:34: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.171139162810603 (code B ref 67455); Mon, 25 Mar 2024 18:34:02 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 25 Mar 2024 18:33:48 +0000 Original-Received: from localhost ([127.0.0.1]:36249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rop8m-0002kx-FH for submit@debbugs.gnu.org; Mon, 25 Mar 2024 14:33:48 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rop8k-0002kk-Tr for 67455@debbugs.gnu.org; Mon, 25 Mar 2024 14:33:47 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9C0E4100170; Mon, 25 Mar 2024 14:26:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1711391170; bh=yQf7z4Uw/azJE8n8l7WDkGITa7SsgZ/mBFXtIyiFTJc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=C2+vENPss/gyTNdU4h5D052lhMU55294GnJWwmYLFD5btQEZOJ2c2EXgODEsKHJyu 30AynptV2bM4/At+vexkgKAJg9ewshGYMDzcQIExt6Czlq6AykUO+BganMisCp7f/7 9SphxSBl+Q/N+qHGyhTFCdyUp+3k3ThBNo6/d3WnjKUTu6Tr1mydRNoAvtLuVauEcR A6++pxLxh6M2wWHM8pRizdu7sMPxrR5D3wUa5VP8qq/lnw+CD4iGhIb/ZNa4wcoEB5 3v3EE+1K+6ze8k+7vi2O96Qfjk7/v8WGcU8jktq75FejuvwvOPhzr4y+z0JRqhYhNO RfNSxNErgq7Ow== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 70CE210004A; Mon, 25 Mar 2024 14:26:10 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6345E12046C; Mon, 25 Mar 2024 14:26:10 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Sun, 24 Mar 2024 11:04:07 +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:282068 Archived-At: >> 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. > Yes. How about binding it to nil around `load' and recursive edits, and > possibly one or two other things? You mean trying to enumerate all the places we can think of where we know that compilation is not taking place? That sounds rather ugly. I'd rather first try and define precisely what is we mean by "compilation in progress". I see the same problem with: DEFVAR_LISP ("defining-symbol", Vdefining_symbol, doc: /* The symbol currently being defined by a defining form. This variable is bound in the read-eval-print loop and certain high-level functions in the byte compiler. It is set to a value by functions and macros such as `defun', `defmacro', and `defvar'. */); Lots and lots of things can happen "during the definition" of a form, including definition of lots of other forms. So I think we'd need to define much more precisely what you meant by "currently". In addition, a definition is "intemporal" (it's declarative), so "currently being defined" is almost like an oxymoron. I'm trying to understand your code, but I clearly lack a high-level overview of the approach you decided to takes, so I don't understand what's going on there. Is that branch trying to provide function-position for compiled functions only, for interpreted functions only, or both? If both, could you split it into two, then? AFAICT doing it only for compiled functions should be significantly simpler than for interpreted functions, so it would be a good stepping stone. On the cosmetic side, you have way too much code in `byte-run.el`. I think most of this code can be moved elsewhere, e.g. somewhere where backquote can be used Stefan