[slime-devel] Enhanced slime-list-connections

Okay, so you gave me commit privileges and I'm taking advantage of them. I just checked in a change that makes slime-list-connections a bit more useful: now you can use it to switch to the REPL (hit enter on the line you want) for a particular connection and to change the default connection (hit "d") on the appropriate line. "q" still gets you out of the buffer. If someone wants to look over my change and let me know if I violated any SLIME norms that'd be fine. -Peter -- Peter Seibel peter@javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp

Peter Seibel <peter@javamonkey.com> writes:
Okay, so you gave me commit privileges and I'm taking advantage of them. I just checked in a change that makes slime-list-connections a bit more useful: now you can use it to switch to the REPL (hit enter on the line you want) for a particular connection and to change the default connection (hit "d") on the appropriate line. "q" still gets you out of the buffer.
Nice! I always wanted those commands, but was to lazy to write them.
If someone wants to look over my change and let me know if I violated any SLIME norms that'd be fine.
The only thing I don't like is this: +(defun slime-extract-type-name-from-line () + (save-excursion + (beginning-of-line) + (search-forward-regexp "[0-9]\\s *\\([0-9a-zA-Z]+\\)") + (match-string 1))) Try to avoid regexps, if you can. "Text properties" are the Emacs way of adding auxiliary data to regions. You should define a text property, say 'slime-connection', and set it for each line when you initialize the buffer with something like (add-text-properties line-start line-end 'slime-connection <connection>) To extract the connection for the line you can then use (get-text-property (point) 'slime-connection). The debugger code or the apropos command contain plenty of examples for text properties. Helmut.

Helmut Eller <e9626484@stud3.tuwien.ac.at> writes:
Try to avoid regexps, if you can. "Text properties" are the Emacs way of adding auxiliary data to regions. You should define a text property, say 'slime-connection', and set it for each line when you initialize the buffer with something like
(add-text-properties line-start line-end 'slime-connection <connection>)
To extract the connection for the line you can then use (get-text-property (point) 'slime-connection). The debugger code or the apropos command contain plenty of examples for text properties.
Fixed. -Peter -- Peter Seibel peter@javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp
participants (2)
-
Helmut Eller
-
Peter Seibel