Patient_Chance_3795

joined 11 months ago
[–] Patient_Chance_3795@alien.top 1 points 10 months ago

Some answers here
https://stackoverflow.com/questions/75103221/emacs-remove-python-el-eval-message

(defun python-comint-filter (output)
  (let* ((regexp "^.*__PYTHON_EL_\\(.*\\)\\(.*\\)[[:space:]]*$")
         (lines (split-string output "\n"))
         (filtered-lines (remove-if (lambda (line)
                                      (or (string-match-p regexp line)
                                          (string-match-p "^\\s-*$" line))) 
                                    lines)))

    (if (equal (length lines) (length filtered-lines))
        output
      (mapconcat 'identity filtered-lines "\n"))))