[Ecls-list] Line Number of errors ?

Tobias C. Rittweiler tcr at freebits.de
Tue Apr 22 20:26:32 UTC 2008

"Juan Jose Garcia-Ripoll" writes:

> Ok, but in the meantime here is the change. It is still missing the
> required code so that the debugger uses this information.
> Incidentally, I have thought that it might be more useful to remember
> the file position instead of the form number, but perhaps this is not
> so useful for Slime if emacs uses other conventtions for file position
> or we introduce support for UTF-8 an similar things.

File positions are more likely to change than form numbers:

  (defun foo (x)

  (defun bar (y)       ; 2nd tlf, 4th line

This gets then changed to

  (defun foo (x)
    (let ((z (* x x)))
      (+ z z)))

  (defun bar (y)       ; still 2nd tlf, but 5th line.

The swank related code is in SOURCE-PATH-FILE-POSITION,
SOURCE-PATH-STRING-POSITION in swank-source-path-parser.lisp. These
functions take a source path, which in its simplest form is just a
list consisting of the toplevel number.

Because storing toplevel numbers requires files to be read in each time
a user executes M-., there's a cache implemented in
swank-source-file-cache.lisp. Look into swank-sbcl.lisp for inspiration
on how to this and the above functions are supposed to be used.

Geo Carncross seems to be the fellow who at the moment cares most about
ECL's slime backend. I don't have time to hack on this for the time
being, but if you, Geo, want to give this a shoot, I'll try to provide
as much help as time permits.

I can be reached either via mail, or in #lisp on freenode.org.


More information about the ecl-devel mailing list