diff options
| author | jao <jao@gnu.org> | 2026-04-26 19:50:45 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-04-26 19:50:45 +0100 |
| commit | 185191df527b51ce521084f8c32030e87dabb5e9 (patch) | |
| tree | 44c49cd9de10aa19a2f625923281aee2b0b65c6d /elisp/geiser-base.el | |
| parent | df9a3d3d8ae10417294c076d5804643441a1efca (diff) | |
| download | geiser-185191df527b51ce521084f8c32030e87dabb5e9.tar.gz geiser-185191df527b51ce521084f8c32030e87dabb5e9.tar.bz2 | |
It all seems to boil down to ansi-color-filter not recognising the format used
by guile-colorized, and leaving behind some control characters that we're
cleaning manually after the fact.
This is not a great solution, as it applies a guile bandage to all
implementations: we should define an implementation-dependent filter for input
coming from a remote repl, but the fact that it has also to be applied to
connections complicates matters.
Diffstat (limited to 'elisp/geiser-base.el')
| -rw-r--r-- | elisp/geiser-base.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/elisp/geiser-base.el b/elisp/geiser-base.el index 4194da5..71aa8b4 100644 --- a/elisp/geiser-base.el +++ b/elisp/geiser-base.el @@ -41,9 +41,14 @@ ;;; Utilities: +(require 'ansi-color) + (defsubst geiser--chomp (str) (if (string-match-p ".*\n$" str) (substring str 0 -1) str)) +(defsubst geiser--strip-ansi (s) + (replace-regexp-in-string "" "" (ansi-color-filter-apply s))) + (defun geiser--shorten-str (str len &optional sep) (let ((str-len (length str))) (if (<= str-len len) |
