annotate lisp/ilisp/ilisp-prc.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children b82b59fe008d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; -*- Mode: Emacs-Lisp -*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;; ilisp-prc.el --
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; This file is part of ILISP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; Version: 5.7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; 1993, 1994 Ivan Vasquez
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; 1994, 1995 Marco Antoniotti and Rick Busdiecker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; Other authors' names for which this Copyright notice also holds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; may appear later in this file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; Send mail to 'ilisp-request@lehman.com' to be included in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; ILISP mailing list. 'ilisp@lehman.com' is the general ILISP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; mailing list were bugs and improvements are discussed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; ILISP is freely redistributable under the terms found in the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; COPYING.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; ILISP process handling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (defun ilisp-process ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 "Return the current ILISP process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (get-buffer-process (ilisp-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (defvar ilisp-buffer-function 'ilisp-recent-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 "A function of no arguments which returns the current ilisp buffer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;;;%Buffer and process selection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (defun ilisp-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 "Return the current ILISP buffer. This is the buffer to whose process requests are sent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (if (memq major-mode ilisp-modes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (let ((buffer (funcall ilisp-buffer-function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (or buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (error "You must start an inferior LISP with run-ilisp.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defun ilisp-recent-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 "Return the most-recently selected ilisp buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (if ilisp-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (or (get-buffer ilisp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (get-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (setq ilisp-buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (lisp-del (substring ilisp-buffer 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (1- (length ilisp-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ilisp-buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (function (lambda (s1 s2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (string= s1 (car s2)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ilisp-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (format "*%s*" (car (car ilisp-buffers))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (defun select-ilisp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 "Select the current ILISP buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (let ((new (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (if ilisp-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (format "Buffer [%s]: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (substring ilisp-buffer 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (1- (length ilisp-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 "Buffer: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ilisp-buffers nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (if (not (zerop (length new)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (setq ilisp-buffer (format "*%s*" new)))))