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: Tue, 26 Mar 2024 09:40:19 -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="21200"; 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 Tue Mar 26 14:41:46 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 1rp73h-0005Io-NG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Mar 2024 14:41:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp738-0001wK-RL; Tue, 26 Mar 2024 09:41:11 -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 1rp730-0001uC-Vb for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 09:41:02 -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 1rp730-0005Kv-Lx for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 09:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rp72z-0000Yd-PV for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 09:41: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: Tue, 26 Mar 2024 13:41: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.17114604432109 (code B ref 67455); Tue, 26 Mar 2024 13:41:01 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 26 Mar 2024 13:40:43 +0000 Original-Received: from localhost ([127.0.0.1]:33070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rp72h-0000Xx-Co for submit@debbugs.gnu.org; Tue, 26 Mar 2024 09:40:43 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rp72c-0000Xd-OZ for 67455@debbugs.gnu.org; Tue, 26 Mar 2024 09:40:42 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 28E8A10004C; Tue, 26 Mar 2024 09:40:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1711460426; bh=vCKSWtCbM7aXHw35dHqb66qvL43JOucDHF0C6cKSc8A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VlCAdVEABIPtugJsbd8yypxJXBygiDQ6rg8T5OKhNDgZVW/5eMUlBMIs/AqVjrsjN kHjampIILAFKC8KXraYkK4hJ3aIBw5KytNWnz4LpKiLz9d8l1OSjOWSuv5/EGmvRUi F/+a+t9wv+d/3uVESpiy/SJy7Au4H/7cslotY8jxC71atSXgktu73ueBr8nVqVRm3T anFuPLqdR83lVPON8ndp8dTyv49pjnnGILl3EYC5m6Cmw4pZ2KfZd9KX+iiKX/UZhh NijAgbBLRu0ujxOOF4hA8mwFxXiHH55ohiJEgZVREAfOoDeLgIMOlSbX3zghbqgyAx dWMWrqUlH3R6A== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C410B100046; Tue, 26 Mar 2024 09:40:26 -0400 (EDT) Original-Received: from pastel (unknown [45.72.199.112]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9B33C120828; Tue, 26 Mar 2024 09:40:26 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Tue, 26 Mar 2024 09:48:49 +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:282082 Archived-At: >> > Sorry about that. A quick summary: defined symbols (and lambda) get >> > positioned by the new reader function read-positioning-defined symbols. >> > The new declare clause defining-symbol marks a macro such as defun or >> > cl-defgeneric as a macro which defines such symbols. Since I still don't understand the general picture, let me tell you how I would plan to do it, so you can tell me where it matches your approach and where it doesn't: - Change `load-source-file-function` so it uses `read-positioning-symbols` instead of plain `read`. [ This means that macro-expansion will now almost always have sympos, rather than only during compilation, ] - This in turn requires a strip-sympos pass after the eager-macroexpansion phase of `load-source-file-function`. - Change macros like `lambda` so as to use the extract position info from themselves/theirargs/thecontext (when available, since there will still be corner cases where it's not available, such as during non-eager macro expansion) and stash it in their docstring. This might be as simple as adding a line (setq docstring (add-pos-to-docstring docstring ARG)). - Stefan