annotate lisp/ilisp/ilisp-prc.el @ 164:4e0740e5aab2

Added tag r20-3b8 for changeset 0132846995bd
author cvs
date Mon, 13 Aug 2007 09:43:39 +0200
parents b82b59fe008d
children
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.
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
6 ;;; Version: 5.8
0
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
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
10 ;;; 1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
11 ;;; 1996 Marco Antoniotti and Rick Campbell
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; Other authors' names for which this Copyright notice also holds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; may appear later in this file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;;
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
16 ;;; Send mail to 'ilisp-request@naggum.no' to be included in the
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
17 ;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; mailing list were bugs and improvements are discussed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; ILISP is freely redistributable under the terms found in the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; COPYING.
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 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; ILISP process handling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (defun ilisp-process ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 "Return the current ILISP process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (get-buffer-process (ilisp-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (defvar ilisp-buffer-function 'ilisp-recent-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 "A function of no arguments which returns the current ilisp buffer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;;%Buffer and process selection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (defun ilisp-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "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
41 (if (memq major-mode ilisp-modes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (let ((buffer (funcall ilisp-buffer-function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (or buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (error "You must start an inferior LISP with run-ilisp.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defun ilisp-recent-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Return the most-recently selected ilisp buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (if ilisp-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (or (get-buffer ilisp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (get-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (setq ilisp-buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (lisp-del (substring ilisp-buffer 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (1- (length ilisp-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ilisp-buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (function (lambda (s1 s2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (string= s1 (car s2)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ilisp-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (format "*%s*" (car (car ilisp-buffers))))))))
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 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (defun select-ilisp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 "Select the current ILISP buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (let ((new (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (if ilisp-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (format "Buffer [%s]: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (substring ilisp-buffer 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (1- (length ilisp-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 "Buffer: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ilisp-buffers nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (if (not (zerop (length new)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (setq ilisp-buffer (format "*%s*" new)))))