[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[eev] eethrow
From: |
rubikitch |
Subject: |
[eev] eethrow |
Date: |
Wed, 14 Dec 2005 17:28:59 +0900 (JST) |
Hi,
I thought up `eethrow-do-this-line', which is similar to
`eechannel-do-this-line' but throws an input to a buffer not a
communication channel. Before using `eethrow-do-this-line', `eethrow'
displays a buffer on other window.
(defmacro eethrow (&rest body)
`(let ((pop-up-windows t)
(same-window-buffer-names nil))
(save-window-excursion
,@body
(setq eethrow-send-buffer (current-buffer)))
(display-buffer eethrow-send-buffer)))
(defun eethrow-do-this-line () (interactive)
(let ((line (buffer-substring (ee-bol) (ee-eol)))) ; contents of this line
(if (string-match "^\\(.*\\)" line) ; lines with a red star
(ee-eval-string (match-string 1 line)) ; are eval'ed
(save-selected-window
(select-window (get-buffer-window eethrow-send-buffer))
(insert line) ; other lines are "typed"
(call-interactively (key-binding "\r")))) ; and then we do a RET
(next-line 1)))
(define-key eev-mode-map [f8] 'eethrow-do-this-line)
Here is an example.
Type F8, F8...
(eethrow (shell))
echo foo
echo bar
--
rubikitch
http://www.rubyist.net/~rubikitch/
- [eev] eethrow,
rubikitch <=