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: Sat, 1 Jun 2024 17:40:47 +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="21288"; mail-complaints-to="usenet@ciao.gmane.io" To: 67455@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 01 19:42:15 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 1sDSkA-0005Qg-S9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Jun 2024 19:42:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sDSjo-00061b-5X; Sat, 01 Jun 2024 13:41:52 -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 1sDSjm-00061K-Se for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2024 13:41:50 -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 1sDSjm-0002Qu-Hl for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2024 13:41:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sDSjy-0003sm-1z for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2024 13:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Jun 2024 17:42: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.171726367014865 (code B ref 67455); Sat, 01 Jun 2024 17:42:02 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 1 Jun 2024 17:41:10 +0000 Original-Received: from localhost ([127.0.0.1]:57334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDSj7-0003rg-R7 for submit@debbugs.gnu.org; Sat, 01 Jun 2024 13:41:10 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:32433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDSj4-0003r4-Oa for 67455@debbugs.gnu.org; Sat, 01 Jun 2024 13:41:07 -0400 Original-Received: (qmail 51341 invoked by uid 3782); 1 Jun 2024 19:40:48 +0200 Original-Received: from muc.de (pd953a4de.dip0.t-ipconnect.de [217.83.164.222]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 01 Jun 2024 19:40:48 +0200 Original-Received: (qmail 2282 invoked by uid 1000); 1 Jun 2024 17:40:47 -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:286339 Archived-At: Hello, Stefan and Eli. On Mon, Mar 04, 2024 at 15:38:14 +0000, Alan Mackenzie wrote: [ .... ] > I've just pushed a large commit to feature/positioned-lambdas, a work > in progress commit for bug#67455, putting source position information at > the start of doc strings. master was merged into it just before the > commit. I've just pushed another large commit, which now works, for generous values of "works". [ .... ] > Still missing is position information for defvars and defconsts, along > with the same for cl-defmethods (which are complicated because the doc > string has no fixed position). This is now implemented. > Also missing is the handling of Oclosures. This is still missing. [ .... ] What has held me back over the last weeks was handling ambiguous constructs - things that might be evaluated, but might not. Things like '(defun ...) or (lambda ...) in the middle of a constant, or things like (memq (car form) '(defun defsubst)) in elint.el, where defsubst is definitely not a function being defined. Currently, I have coped with this using heuristics. For example that '(defun ...) is not a function definition because of the '. Or that (list 'lambda (list foo bar) ....) is the expansion of a backquote form, thus must be an evaluatable form. This is clearly unsatisfactory. I think a moderately radical change in approach is needed. Something like the following: (i) "Ambiguous" constructs should be left with symbols with position. (ii) We should enhance the evaluator to handle these symbols with position. (iii) For the sake of run time speed, typical SWPs will be posified as they are at the moment, the details getting written into their doc strings. (iv) We'll need a read syntax for symbols with position, and they will get written to .elc files with this syntax. (v) SWPs may need enhancing with a new element representing the buffer the symbol occurred in. Or, we could have an alist (or hash table) associating the SWPs with their buffers. Such currently exists for lambdas. .... or something like that. What do you think? -- Alan Mackenzie (Nuremberg, Germany).