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, 04 Dec 2023 13:33:25 -0500 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="32658"; 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 Dec 04 19:35:16 2023 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 1rADml-00088m-Pz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Dec 2023 19:35:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rADmO-0007sL-Oj; Mon, 04 Dec 2023 13:34:52 -0500 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 1rADmN-0007ry-G6 for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 13:34:51 -0500 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 1rADmN-0006Jq-7Y for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 13:34:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rADmX-0006hM-S1 for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 13:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Dec 2023 18:35: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.170171484325674 (code B ref 67455); Mon, 04 Dec 2023 18:35:01 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 4 Dec 2023 18:34:03 +0000 Original-Received: from localhost ([127.0.0.1]:35693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rADla-0006g1-GW for submit@debbugs.gnu.org; Mon, 04 Dec 2023 13:34:02 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rADlZ-0006fZ-CT for 67455@debbugs.gnu.org; Mon, 04 Dec 2023 13:34:01 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 43E25100068; Mon, 4 Dec 2023 13:33:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1701714824; bh=D2CtDjg1nFCQxwN1bKAyoQ8U52PBE9ESuGs2dgE1Mtk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mp+fLueb0ODA+g3GU4E/uQUctcBE4Ncw/0Mu/K6+hTbnE9eetkz9kyBcwfkS7jvYv 8dsWObXbFcML9jVn8iQ/WWDVACNS+4bUptO5g2MBWM5nDLtH5FBTZAqUZOOKdbtuON ty0s1yyhc+ZCMbPnQOxJ8gmXgaHxOmS3T5FGI+JWwAjCHMTiW2QY4wmKBfJC4cmFrw LD3afEtVv/M3ttkno6DAUFP2Lmc7XtyKRk9I64tSAJk6EcqfIySMAKFoQ75pby4thx OF7u0gUnb7Z+2HhVLeZKqlU8WZjKr66VrSnYSUJGe/StEZnjHHPj0YqtSY18wlIaKa JZsvq4gLBBLwQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9A7F8100033; Mon, 4 Dec 2023 13:33:44 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 83CF91203A2; Mon, 4 Dec 2023 13:33:44 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Mon, 4 Dec 2023 17:36:36 +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:275527 Archived-At: > I've committed the first stage of this implementation in the new git > branch feature/positioned-lambdas. Haven't had enough time to look closely, so just some quick early comment. > It creates for compiled functions (but not yet for interpreted ones) doc > strings starting with a specially formatted string containing the > defining symbol, the source file name, Why include the file name? Presumably we will rely on a `(FILE . POS)` to find that docstring so including FILE in there is rather redundant (and in addition to that, this file name can be wrong if it's absolute since files often get moved between compilation and use). > the position of the defining symbol in the file, and the position of > the lambda (should we be in one) in the file. Why two positions? Why not use the same position info as used in `byte-compile-warn-x`? > To instruct a defining macro to set a defining-symbol, it is only > necessary to add a clause like (defining-symbol 1) Sounds good. [ Hopefully we can eventually use that info for `font-lock` so we can get rid of ad-hoc rules for `defun` and friends. It would require an additional piece of info (not only the position but also the kind of definition, to distinguish `defun` from `defvar`). ] > or (defining-symbol (if (consp struct) (car struct) struct)) [ Haven't seen that yet. ] Stefan