Luke Gorrie wrote:
[...] Clicky things
A wise man. But if I ever meet him, I'm gonna punch him in the nose for all the time I've spent porting stuff to XEmacs ;-)
Hmmm, yes....
I was thinking about how to not have to use regexps on the train. How about this:
Currently, slime get's a form "(:ok "#<FUNCTION FOO>")", and READs it on the Emacs side before parsing it and displaying it to the user.
I thought one might be able to, on the swank side, specialise PRINT-OBJECT, or PRINT-UNREADABLE-OBJECT to add some extra information, perhaps something of the form:
"(:ok (:unreadable "#<FUNCTION FOO>" :type 'function :name 'foo))"
Then, Emacs could have more information about said object, and, when parsing and inserting it in the REPL, could add text properties appropriately.
The way I envisage this happening is to have dispatching in the printer on object types to add extra info.
Something like:
(defgeneric object-info (object))
(defmethod object-info ((object function)) (do-stuff-to-extract-info))
(defmethod object-info ((object pathname)) ...)
This has the advantage that one doesn't need to use regexps on the Emacs side to parse stuff (when most of the introspection capabilities are already gone), and one can add object-info for arbitrary types, e.g. CONSes or something.
A very quick glance at the CLIM listener's presentations approach makes me think that it does it a similar way. Perhaps I should ask Andy Hefner.
Does this sound at all workable, it made sense on paper, whether or not it would work might be a different matter. Comments?
Lawrence