Skip to content

Instantly share code, notes, and snippets.

@stesla
Created October 19, 2010 04:37
Show Gist options
  • Save stesla/633620 to your computer and use it in GitHub Desktop.
Save stesla/633620 to your computer and use it in GitHub Desktop.
(defun muon-input-send-lines (start end)
(let ((proc (start-process "muon-quote" nil
"perl" "-ne" "print; sleep(1)")))
(lexical-let ((buffer (current-buffer)))
(set-process-filter proc (lambda (proc string)
(with-current-buffer buffer
(muon-input-send-line string)))))
(let ((lines (muon-region-lines start end)))
(mapc (lambda (line)
(process-send-string proc (concat line "\n")))
(remove-if (lambda (x) (string-match-p "^[[:space:]]*$" x)) lines)))
(process-send-eof proc)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment