On Thu, 17 Jun 2004 13:47:25 +0200, Luke Gorrie <luke@bluetail.com> said:
Luke> Martin Simmons <martin@xanalys.com> writes:
I made it use WITH-STANDARD-IO-SYNTAX originally to get all the standard bindings, in particular you must also bind *PACKAGE* because the function sets it. There is also *READ-BASE*, *READ-DEFAULT-FLOAT-FORMAT* and *READ-SUPPRESS* to consider.
Luke> True, plus any other implementation-defined reader setting (I don't Luke> know if LispWorks has any). I particularly hadn't realised that Luke> with-standard-io-syntax was binding *package*. Luke> I hacked it to use a `with-fairly-standard-io-syntax' macro. This does Luke> with-standard-io-syntax but then rebinds *package* and *readtable* as Luke> they were before executing the body. Sound reasonable? Yes, sound good.
What binds *READTABLE* when you do M-. anyway? It doesn't seem to be bound for me when DSPEC-STREAM-POSITION is reached via FIND-DEFINITIONS-FOR-EMACS.
Luke> [Just read the *readtable-alist* code for the first time.] Luke> Nobody sets it for definition-finding. That's reasonable in swank.lisp Luke> since it doesn't know what package the definition will be in. Perhaps Luke> ideal would be for dspec-stream-position to set the right readtable Luke> (from *readtable-alist*) when it sees IN-PACKAGE. I'm not sure if the Luke> other backends can/should do this too. We'd have to move Luke> *readtable-alist* into swank-backend.lisp. Luke> But I suspect the main issue right now is to make sure that a Luke> custom-hacked readtable that one installs globally as *READTABLE* will Luke> be used by `M-.'. That's how I do my readtable'ery, at least. It looks like using SWANK::WITH-BUFFER-SYNTAX somewhere might be the right thing, since *BUFFER-READTABLE* and *BUFFER-PACKAGE* are already bound. __Martin