1 ;;; -*- Mode: Emacs-Lisp -*-
4 ;;; ILISP process handling.
6 ;;; This file is part of ILISP.
7 ;;; Please refer to the file COPYING for copyrights and licensing
9 ;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
10 ;;; of present and past contributors.
12 ;;; $Id: ilisp-prc.el,v 1.3 2001-07-02 09:40:48 youngs Exp $
15 (defun ilisp-process ()
16 "Return the current ILISP process."
17 (get-buffer-process (ilisp-buffer)))
20 (defvar ilisp-buffer-function 'ilisp-recent-buffer
21 "A function of no arguments which returns the current ilisp buffer")
24 ;;;%Buffer and process selection
25 (defun ilisp-buffer ()
26 "Return the current ILISP buffer.
27 This is the buffer to whose process requests are sent."
28 (if (memq major-mode ilisp-modes)
30 (let ((buffer (funcall ilisp-buffer-function)))
32 (error "You must start an inferior LISP with run-ilisp.")))))
35 (defun ilisp-recent-buffer ()
36 "Return the most-recently selected ilisp buffer."
38 (or (get-buffer ilisp-buffer)
41 (delete* (substring ilisp-buffer
43 (1- (length ilisp-buffer)))
45 :test (function (lambda (s1 s2)
46 (string= s1 (car s2)))))
48 (format "*%s*" (car (car ilisp-buffers))))))))
52 (defun select-ilisp ()
53 "Select the current ILISP buffer."
55 (let ((new (completing-read
57 (format "Buffer [%s]: "
58 (substring ilisp-buffer 1
59 (1- (length ilisp-buffer))))
61 ilisp-buffers nil t)))
62 (if (not (zerop (length new)))
63 (setq ilisp-buffer (format "*%s*" new)))))
65 ;;; end of file -- ilisp-prc.el --