[slime-devel] :charpos in swank-fancy-inspector vs :position in slime-ed

Helmut Eller heller at common-lisp.net
Fri Nov 11 08:55:11 UTC 2011


* Anton Kovalenko [2011-11-11 01:27] writes:

> Hello SLIME developers,
>
> Fancy-inspector module provides a feature that I tried to use today: for
> a stream object, it proposes to visit a file and go to current stream
> position. Unfortunately, it doesn't work in current SLIME.
>
> In swank-fancy-inspector.lisp, make-pathname-ispec passes a :charpos
> keyword, while in slime.el, slime-ed expects :position.
>
> I assume there's a real problem, not just an argument name
> incompatibility: for common CL implementations, CL:FILE-POSITION is
> measured in bytes, and slime-ed (that ends up in goto-char) expects
> character. Assuming unibyte encoding and passing :position argument from
> fancy inspector makes this feature useful most of the time, though.
>
> I'm unsure where the real problem (octets-vs-characters) should be fixed;
> a problem with argument names looks like a separate one, because what's
> passed in :charpos is a byte offset.

Since the return value of FILE-POSITION is implementation dependent it
seems that the Lisp side would be a more appropriate place.  Emacs has a
byte-to-position function but XEmacs hasn't.  Turning file positions
into line+column numbers would probably also work most of the time.

Helmut








More information about the slime-devel mailing list