;;; cmulisp.el --- improved version of standard inferior-lisp mode
;;; Copyright Olin Shivers (1988).
+
+;; Keywords: processes, lisp
+
;;; Please imagine a long, tedious, legalistic 5-page gnu-style copyright
;;; notice appearing here to the effect that you may use this code any
;;; way you like, as long as you don't charge money for it, remove this
;;; notice, or hold me liable for its results.
+;;; Commentary:
+
;;; This replaces the standard inferior-lisp mode.
;;; Hacked from tea.el by Olin Shivers (shivers@cs.cmu.edu). 8/88
;;; Please send me bug reports, bug fixes, and extensions, so that I can
;; '((lambda ()
;; (define-key cmulisp-mode-map "\C-ct" 'favorite-cmd))))
-\f
-;;; Brief Command Documentation:
-;;;============================================================================
-;;; Comint Mode Commands: (common to cmulisp and all comint-derived modes)
-;;;
-;;; m-p comint-previous-input Cycle backwards in input history
-;;; m-n comint-next-input Cycle forwards
-;;; m-c-r comint-previous-input-matching Search backwards in input history
-;;; return comint-send-input
-;;; c-a comint-bol Beginning of line; skip prompt.
-;;; c-d comint-delchar-or-maybe-eof Delete char unless at end of buff.
-;;; c-c c-u comint-kill-input ^u
-;;; c-c c-w backward-kill-word ^w
-;;; c-c c-c comint-interrupt-subjob ^c
-;;; c-c c-z comint-stop-subjob ^z
-;;; c-c c-\ comint-quit-subjob ^\
-;;; c-c c-o comint-kill-output Delete last batch of process output
-;;; c-c c-r comint-show-output Show last batch of process output
-;;; send-invisible Read line w/o echo & send to proc
-;;; comint-continue-subjob Useful if you accidentally suspend
-;;; top-level job.
-;;; comint-mode-hook is the comint mode hook.
-
-;;; CMU Lisp Mode Commands:
-;;; c-m-x lisp-send-defun This binding is a gnu convention.
-;;; c-c c-l lisp-load-file Prompt for file name; tell Lisp to load it.
-;;; c-c c-k lisp-compile-file Prompt for file name; tell Lisp to kompile it.
-;;; Filename completion is available, of course.
-;;;
-;;; Additionally, these commands are added to the key bindings of Lisp mode:
-;;; c-m-x lisp-eval-defun This binding is a gnu convention.
-;;; c-c c-e lisp-eval-defun Send the current defun to Lisp process.
-;;; c-x c-e lisp-eval-last-sexp Send the previous sexp to Lisp process.
-;;; c-c c-r lisp-eval-region Send the current region to Lisp process.
-;;; c-c c-c lisp-compile-defun Compile the current defun in Lisp process.
-;;; c-c c-z switch-to-lisp Switch to the Lisp process buffer.
-;;; c-c c-l lisp-load-file (See above. In a Lisp file buffer, default
-;;; c-c c-k lisp-compile-file is to load/compile the current file.)
-;;; c-c c-d lisp-describe-sym Query Lisp for a symbol's description.
-;;; c-c c-a lisp-show-arglist Query Lisp for function's arglist.
-;;; c-c c-f lisp-show-function-documentation Query Lisp for a function's doc.
-;;; c-c c-v lisp-show-variable-documentation Query Lisp for a variable's doc.
-
-;;; cmulisp Fires up the Lisp process.
-;;; lisp-compile-region Compile all forms in the current region.
-;;;
-;;; CMU Lisp Mode Variables:
-;;; cmulisp-filter-regexp Match this => don't get saved on input hist
-;;; inferior-lisp-program Name of Lisp program run-lisp executes
-;;; inferior-lisp-load-command Customises lisp-load-file
-;;; cmulisp-mode-hook
-;;; inferior-lisp-prompt Initialises comint-prompt-regexp.
-;;; Backwards compatibility.
-;;; lisp-source-modes Anything loaded into a buffer that's in
-;;; one of these modes is considered Lisp
-;;; source by lisp-load/compile-file.
+;; Brief Command Documentation:
+;;============================================================================
+;; Comint Mode Commands: (common to cmulisp and all comint-derived modes)
+;;
+;; m-p comint-previous-input Cycle backwards in input history
+;; m-n comint-next-input Cycle forwards
+;; m-c-r comint-previous-input-matching Search backwards in input history
+;; return comint-send-input
+;; c-a comint-bol Beginning of line; skip prompt.
+;; c-d comint-delchar-or-maybe-eof Delete char unless at end of buff.
+;; c-c c-u comint-kill-input ^u
+;; c-c c-w backward-kill-word ^w
+;; c-c c-c comint-interrupt-subjob ^c
+;; c-c c-z comint-stop-subjob ^z
+;; c-c c-\ comint-quit-subjob ^\
+;; c-c c-o comint-kill-output Delete last batch of process output
+;; c-c c-r comint-show-output Show last batch of process output
+;; send-invisible Read line w/o echo & send to proc
+;; comint-continue-subjob Useful if you accidentally suspend
+;; top-level job.
+;; comint-mode-hook is the comint mode hook.
+
+;; CMU Lisp Mode Commands:
+;; c-m-x lisp-send-defun This binding is a gnu convention.
+;; c-c c-l lisp-load-file Prompt for file name; tell Lisp to load it.
+;; c-c c-k lisp-compile-file Prompt for file name; tell Lisp to kompile it.
+;; Filename completion is available, of course.
+;;
+;; Additionally, these commands are added to the key bindings of Lisp mode:
+;; c-m-x lisp-eval-defun This binding is a gnu convention.
+;; c-c c-e lisp-eval-defun Send the current defun to Lisp process.
+;; c-x c-e lisp-eval-last-sexp Send the previous sexp to Lisp process.
+;; c-c c-r lisp-eval-region Send the current region to Lisp process.
+;; c-c c-c lisp-compile-defun Compile the current defun in Lisp process.
+;; c-c c-z switch-to-lisp Switch to the Lisp process buffer.
+;; c-c c-l lisp-load-file (See above. In a Lisp file buffer, default
+;; c-c c-k lisp-compile-file is to load/compile the current file.)
+;; c-c c-d lisp-describe-sym Query Lisp for a symbol's description.
+;; c-c c-a lisp-show-arglist Query Lisp for function's arglist.
+;; c-c c-f lisp-show-function-documentation Query Lisp for a function's doc.
+;; c-c c-v lisp-show-variable-documentation Query Lisp for a variable's doc.
+
+;; cmulisp Fires up the Lisp process.
+;; lisp-compile-region Compile all forms in the current region.
+;;
+;; CMU Lisp Mode Variables:
+;; cmulisp-filter-regexp Match this => don't get saved on input hist
+;; inferior-lisp-program Name of Lisp program run-lisp executes
+;; inferior-lisp-load-command Customises lisp-load-file
+;; cmulisp-mode-hook
+;; inferior-lisp-prompt Initialises comint-prompt-regexp.
+;; Backwards compatibility.
+;; lisp-source-modes Anything loaded into a buffer that's in
+;; one of these modes is considered Lisp
+;; source by lisp-load/compile-file.
+
+;;; Code:
+
+(require 'comint)
;;; Read the rest of this file for more information.
\f
+
+;;; Code:
+
(defvar cmulisp-filter-regexp "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'"
"*What not to save on inferior Lisp's input history
Input matching this regexp is not saved on the input history in cmulisp
(defvar cmulisp-mode-map nil)
(cond ((not cmulisp-mode-map)
(setq cmulisp-mode-map
- (full-copy-sparse-keymap comint-mode-map))
- (lisp-mode-commands cmulisp-mode-map)
+ (nconc (full-copy-sparse-keymap comint-mode-map)
+ shared-lisp-mode-map))
(define-key cmulisp-mode-map "\C-x\C-e" 'lisp-eval-last-sexp)
(define-key cmulisp-mode-map "\C-c\C-l" 'lisp-load-file)
(define-key cmulisp-mode-map "\C-c\C-k" 'lisp-compile-file)
(define-key lisp-mode-map "\C-c\C-f" 'lisp-show-function-documentation)
(define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation)
+(defvar cmulisp-buffer)
;;; This function exists for backwards compatibility.
;;; Previous versions of this package bound commands to C-c <letter>
(setq major-mode 'cmulisp-mode)
(setq mode-name "CMU Lisp")
(setq mode-line-process '(": %s"))
- (if (string-match "^18.4" emacs-version) ; hack.
- (lisp-mode-variables) ; This is right for 18.49
- (lisp-mode-variables t)) ; This is right for 18.50
+ (lisp-mode-variables t)
(use-local-map cmulisp-mode-map) ;c-c c-k for "kompile" file
(setq comint-get-old-input (function lisp-get-old-input))
(setq comint-input-filter (function lisp-input-filter))
(t (let ((pos (string-match "[^ \t]" string)))
(if (null pos)
nil
- (cmulsip-args-to-list (substring string pos
+ (cmulisp-args-to-list (substring string pos
(length string)))))))))
(defun lisp-eval-region (start end &optional and-go)