GNU bug report logs - #67455
Record source position, etc., in doc strings, and use this in *Help* and backtraces.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sun, 26 Nov 2023 14:31:02 UTC

Severity: wishlist

Full log


Message #178 received at 67455 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: 67455 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: 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
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).




This bug report was last modified 1 year and 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.