5 (defvar *lisp-eval-buffer
* "")
6 (defvar *backtrack-locations
* nil
)
7 (defvar *y-or-n-p-map
* nil
)
12 (add-hook 'ilisp-init-hook
'(lambda () (install-bridge)))))
16 (setq bridge-source-insert nil
)
17 (setq bridge-destination-insert nil
)
18 (setq bridge-handlers
'((".*" . catch-lisp-eval
)))))
20 (defun catch-lisp-eval (process string
)
22 (setq *lisp-eval-buffer
* (concat *lisp-eval-buffer
* string
))
23 (let ((buffer (current-buffer))
24 (eval-string *lisp-eval-buffer
*))
25 (setq *lisp-eval-buffer
* "")
27 (eval (read eval-string
))
28 (error (message "Bridge Error: %s on eval of: %s" err eval-string
)))
29 (set-buffer buffer
))))
31 (defun y-or-n-p-begin ()
32 (if (not *y-or-n-p-map
*)
33 (let ((map (make-keymap)))
34 (fillarray map
'y-or-n-p-send-char
)
35 (define-key map
"\C-g" 'interactive-keys-ilisp
)
36 (setq *y-or-n-p-map
* map
)))
37 (use-local-map *y-or-n-p-map
*))
39 (defun y-or-n-p-end ()
40 (use-local-map ilisp-mode-map
))
42 (defun y-or-n-p-send-char ()
44 (goto-char (point-max))
45 (process-send-string (ilisp-process) (make-string 1 last-input-char
)))
47 (defun push-end-marker ()
49 (setq *backtrack-locations
* (cons (point) *backtrack-locations
*)))
51 (defun pop-end-marker ()
52 (if *backtrack-locations
*
53 (let ((location (car *backtrack-locations
*)))
54 (setq *backtrack-locations
* (cdr *backtrack-locations
*))
56 (delete-region location
(point)))))