Skip to content

Commit

Permalink
02.07.21
Browse files Browse the repository at this point in the history
  • Loading branch information
mullikine committed Jul 1, 2021
1 parent d15ccac commit 065b32f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
10 changes: 1 addition & 9 deletions pen-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@
(beginning-of-line)
(point)))

(defun clean-repl (&optional input)
(interactive (list (pen-preceding-text-line)))

(let ((ret
(snc "clean-repl" input)))
(if (interactive-p)
(xc ret)
ret)))
(defalias 'clean-prompt 'clean-repl)


(defun pen-preceding-text-line ()
(cond
Expand Down
30 changes: 30 additions & 0 deletions scripts/clean-repl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
export TTY

sed -e 's/^Prelude> //' \
-e 's/^Prelude.*> //' \
-e 's/^scala> //' \
-e 's/^.*[^ ]> //' \
-e 's/.*u=)$ //' \
-e 's/^.*» //' \
-e 's/^Break [0-9]\+ \[[0-9]\+\]> //' \
-e 's/^➜ ~ //' \
-e 's/^λ //' \
-e 's/^.* λ //' \
-e 's/^[+-] \([^ ]\)/\1/' \
-e 's/^> //' \
-e 's/^[~/a-zA-Z-]\+ \$ //' ` # eshell ` \
-e 's/^% //' \
-e 's/^>>> //' \
-e 's/^=> '// \
-e 's/^[a-z]\+=> '// \
-e 's/^In \[[0-9]\+\]: //' \
-e 's/^Eval: //' \
-e 's/^In\[[0-9]\+\]:= //' \
-e 's/^://' ` # Not nice for ghci because of things like :m, but good for vim. So put it before ghic ` \
-e 's/^[a-z]+> //' \
-e "s/^([a-z]*) .*\\$ //" \
-e 's/^λ> //' \
-e 's/^[a-z]\+@[a-z0-9-]\+:[^$]\+$ //' \
-e 's/^[^ ]\+% //' \
-e 's/ \[Unknown command\]$//'

0 comments on commit 065b32f

Please sign in to comment.