bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67455: Record source position, etc., in doc strings, and use this in


From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13)

> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]