annotate lisp/ilisp/ilisp-kil.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-kil.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 Panic/Reset/Status commands
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 ;;;%% Panic/Reset/Status commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (defun status-lisp (showp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 "Show the message of the current command being executed in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 inferior LISP. With a prefix show pending sends as well."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (set-buffer (ilisp-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (comint-current-send showp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (defun reset-ilisp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 "Reset the inferior LISP top level."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (message "Reset LISP to top level")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (comint-simple-send (ilisp-process) (ilisp-value 'ilisp-reset)))
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 abort-commands-lisp (&optional message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 "Abort the commands sent to the current ilisp."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (if (ilisp-value comint-aborting t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (message "Already aborted commands")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (message (or message "Aborted commands"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (comint-abort-sends (ilisp-process))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (defun panic-lisp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 "Panic reset for the inferior LISP."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (if (y-or-n-p "Panic reset LISP? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (set-buffer (ilisp-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (comint-setup-ipc t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (message "LISP is reset, state is unknown"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (message ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (defun repair-ilisp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 "If ilisp is not listening to you in the lisp interaction buffer, you might try this."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (set-buffer (ilisp-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (comint-setup-ipc t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (insert "()")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (return-ilisp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (message "ILISP is working again (maybe)"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (defun interrupt-subjob-ilisp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 "Interrupt the current top level command in the inferior LISP."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (if (not (eq comint-send-queue comint-end-queue))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (if (y-or-n-p "Abort commands before interrupting top level? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (abort-commands-lisp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (message "Waiting for commands to finish")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (while (not (eq comint-send-queue comint-end-queue))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (accept-process-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (sit-for 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (message "Interrupted top level")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (comint-interrupt-subjob))