Hi there,
I just posted an "Issue" on GitHub (https://github.com/slime/slime/issues/420 https://github.com/slime/slime/issues/420), and then saw in the README that questions are better directed to this list. I'm not sure how to search the email archives so I'm not sure if this has been asked before. The question (repeated from GitHub) is:
I've wondered about this for a while. Is it possible to print with ANSI colors in a Slime repl buffer?
If I load the cl-ansi-text library from Quicklisp (ql:quickload :cl-ansi-text), and I run (cl-ansi-text:yellow "yellow") in the Slime REPL the output is: "[33myellow[0m". When I run the same commands directly in an SBCL REPL, it prints as expected "yellow" in a yellow color.
Is it possible to use ANSI colors in Slime? Or maybe there's some workaround?
Thanks, Ben
On Fri, Dec 22, 2017 at 10:24 PM, Ben Lambert belambert@mac.com wrote:
I just posted an "Issue" on GitHub (https://github.com/slime/slime/issues/420), and then saw in the README that questions are better directed to this list. I'm not sure how to search the email archives so I'm not sure if this has been asked before. The question (repeated from GitHub) is:
Yeah, I guess we like email better for discussions but posting to both places doesn't help anyone. :-)
I've wondered about this for a while. Is it possible to print with ANSI colors in a Slime repl buffer?
If I load the cl-ansi-text library from Quicklisp (ql:quickload :cl-ansi-text), and I run (cl-ansi-text:yellow "yellow") in the Slime REPL the output is: " [33myellow [0m". When I run the same commands directly in an SBCL REPL, it prints as expected "yellow" in a yellow color.
Is it possible to use ANSI colors in Slime? Or maybe there's some workaround?
https://github.com/deadtrickster/slime-repl-ansi-color implements what you're looking for. If you're comfortable with emacs lisp, you're quite welcome to send a pull request to implement this functionality in slime-repl without resorting to defadvice.
Cheers,
I've wondered about this for a while. Is it possible to print with ANSI colors in a Slime repl buffer?
If I load the cl-ansi-text library from Quicklisp (ql:quickload :cl-ansi-text), and I run (cl-ansi-text:yellow "yellow") in the Slime REPL the output is: " [33myellow [0m". When I run the same commands directly in an SBCL REPL, it prints as expected "yellow" in a yellow color.
Is it possible to use ANSI colors in Slime? Or maybe there's some workaround?
https://github.com/deadtrickster/slime-repl-ansi-color implements what you're looking for. If you're comfortable with emacs lisp, you're quite welcome to send a pull request to implement this functionality in slime-repl without resorting to defadvice.
Awesome thanks!
I got that code to work, although I'm not sure if the "how to use" instructions are quite right.
I'm not very familiar with Emacs Lisp, but I took a stab at it anyway. I wasn't quite able to get it to work. I'm not sure I understand how the buffer positions and markers. Perhaps you have any tips for what's wrong? https://github.com/belambert/slime/commit/68074c9e096e65ddd1f70fd271907d4692... https://github.com/belambert/slime/commit/68074c9e096e65ddd1f70fd271907d4692244f27
(Presumably, you would also want to be able to turn on/off the colors, but I didn't try to figure that out yet).
Thanks, Ben
Cheers,
-- Luís Oliveira http://kerno.org/~luis/
On Dec 23, 2017, at 2:22 PM, Ben Lambert belambert@mac.com wrote:
I've wondered about this for a while. Is it possible to print with ANSI colors in a Slime repl buffer?
If I load the cl-ansi-text library from Quicklisp (ql:quickload :cl-ansi-text), and I run (cl-ansi-text:yellow "yellow") in the Slime REPL the output is: " [33myellow [0m". When I run the same commands directly in an SBCL REPL, it prints as expected "yellow" in a yellow color.
Is it possible to use ANSI colors in Slime? Or maybe there's some workaround?
<https://github.com/deadtrickster/slime-repl-ansi-color https://github.com/deadtrickster/slime-repl-ansi-color> implements what you're looking for. If you're comfortable with emacs lisp, you're quite welcome to send a pull request to implement this functionality in slime-repl without resorting to defadvice.
Awesome thanks!
I got that code to work, although I'm not sure if the "how to use" instructions are quite right.
I'm not very familiar with Emacs Lisp, but I took a stab at it anyway. I wasn't quite able to get it to work. I'm not sure I understand how the buffer positions and markers. Perhaps you have any tips for what's wrong? https://github.com/belambert/slime/commit/68074c9e096e65ddd1f70fd271907d4692... https://github.com/belambert/slime/commit/68074c9e096e65ddd1f70fd271907d4692244f27
Bump. Any idea how to make this work?
Thanks, Ben
(Presumably, you would also want to be able to turn on/off the colors, but I didn't try to figure that out yet).
Thanks, Ben
Cheers,
-- Luís Oliveira http://kerno.org/~luis/ http://kerno.org/~luis/
Ben,
On Sun, Jan 7, 2018 at 5:15 PM Ben Lambert belambert@mac.com wrote:
I'm not very familiar with Emacs Lisp, but I took a stab at it anyway. I wasn't quite able to get it to work. I'm not sure I understand how the buffer positions and markers. Perhaps you have any tips for what's wrong? https://github.com/belambert/slime/commit/68074c9e096e65ddd1f70fd271907d4692...
https://github.com/luismbo/slime/commit/2fd618bacc686cebb1e523e689afc907cdfb75a5 seems to work.
Moving forward, I suppose a buffer-local defcustom slime-repl-ansi-color for toggling this (perhaps nil by default) seems like the way to go, what do you think?
Cheers, Luís