]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/inf-lisp.el
(gnus-newsrc-file-version): Add defvar.
[gnu-emacs] / lisp / progmodes / inf-lisp.el
index 0ade0fd04c0401e21a03f3ec182ffa908704b03c..64845e38aeaf7a1d8cddad95f7c167a037851268 100644 (file)
@@ -1,6 +1,7 @@
 ;;; inf-lisp.el --- an inferior-lisp mode
 
-;; Copyright (C) 1988, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1993, 1994, 2001, 2002, 2003, 2004, 2005
+;; Free Software Foundation, Inc.
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
 ;; Keywords: processes, lisp
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 ;; Hacked from tea.el by Olin Shivers (shivers@cs.cmu.edu). 8/88
 
 ;; This file defines a lisp-in-a-buffer package (inferior-lisp mode)
-;; built on top of comint mode. This version is more featureful,
-;; robust, and uniform than the Emacs 18 version. The key bindings are
+;; built on top of comint mode.  This version is more featureful,
+;; robust, and uniform than the Emacs 18 version.  The key bindings are
 ;; also more compatible with the bindings of Hemlock and Zwei (the
 ;; Lisp Machine emacs).
 
 (require 'lisp-mode)
 
 \f
+(defgroup inferior-lisp nil
+  "Run an outside Lisp in an Emacs buffer."
+  :group 'lisp
+  :version "22.1")
+
 ;;;###autoload
-(defvar inferior-lisp-filter-regexp "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'"
+(defcustom inferior-lisp-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 Inferior Lisp
 mode.  Default is whitespace followed by 0 or 1 single-letter colon-keyword
-\(as in :a, :c, etc.)")
+\(as in :a, :c, etc.)"
+  :type 'regexp
+  :group 'inferior-lisp)
 
 (defvar inferior-lisp-mode-map nil)
 (unless inferior-lisp-mode-map
@@ -111,7 +120,7 @@ mode.  Default is whitespace followed by 0 or 1 single-letter colon-keyword
 ;;;where they are more accessible. C-c <letter> bindings are reserved for the
 ;;;user, so these bindings are non-standard. If you want them, you should
 ;;;have this function called by the inferior-lisp-load-hook:
-;;;    (setq inferior-lisp-load-hook '(inferior-lisp-install-letter-bindings))
+;;;  (add-hook 'inferior-lisp-load-hook 'inferior-lisp-install-letter-bindings)
 ;;;You can modify this function to install just the bindings you want."
 (defun inferior-lisp-install-letter-bindings ()
   (define-key lisp-mode-map "\C-ce" 'lisp-eval-defun-and-go)
@@ -133,37 +142,42 @@ mode.  Default is whitespace followed by 0 or 1 single-letter colon-keyword
   (define-key inferior-lisp-mode-map "\C-cv"
     'lisp-show-variable-documentation))
 
-
 ;;;###autoload
-(defvar inferior-lisp-program "lisp"
-  "*Program name for invoking an inferior Lisp with for Inferior Lisp mode.")
+(defcustom inferior-lisp-program "lisp"
+  "*Program name for invoking an inferior Lisp in Inferior Lisp mode."
+  :type 'string
+  :group 'inferior-lisp)
 
 ;;;###autoload
-(defvar inferior-lisp-load-command "(load \"%s\")\n"
+(defcustom inferior-lisp-load-command "(load \"%s\")\n"
   "*Format-string for building a Lisp expression to load a file.
 This format string should use `%s' to substitute a file name
 and should result in a Lisp expression that will command the inferior Lisp
 to load that file.  The default works acceptably on most Lisps.
 The string \"(progn (load \\\"%s\\\" :verbose nil :print t) (values))\\n\"
 produces cosmetically superior output for this application,
-but it works only in Common Lisp.")
+but it works only in Common Lisp."
+  :type 'string
+  :group 'inferior-lisp)
 
 ;;;###autoload
-(defvar inferior-lisp-prompt "^[^> \n]*>+:? *"
-  "Regexp to recognise prompts in the Inferior Lisp mode.
+(defcustom inferior-lisp-prompt "^[^> \n]*>+:? *"
+  "Regexp to recognize prompts in the Inferior Lisp mode.
 Defaults to \"^[^> \\n]*>+:? *\", which works pretty good for Lucid, kcl,
 and franz.  This variable is used to initialize `comint-prompt-regexp' in the
 Inferior Lisp buffer.
 
 This variable is only used if the variable
-`comint-use-prompt-regexp-instead-of-fields' is non-nil.
+`comint-use-prompt-regexp' is non-nil.
 
 More precise choices:
 Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\"
 franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\"
 kcl: \"^>+ *\"
 
-This is a fine thing to set in your .emacs file.")
+This is a fine thing to set in your .emacs file or through Custom."
+  :type 'regexp
+  :group 'inferior-lisp)
 
 (defvar inferior-lisp-buffer nil "*The current inferior-lisp process buffer.
 
@@ -247,7 +261,8 @@ Paragraphs are separated only by blank lines.  Semicolons start comments.
 If you accidentally suspend your process, use \\[comint-continue-subjob]
 to continue it."
   (interactive)
-  (comint-mode)
+  (delay-mode-hooks
+    (comint-mode))
   (setq comint-prompt-regexp inferior-lisp-prompt)
   (setq major-mode 'inferior-lisp-mode)
   (setq mode-name "Inferior Lisp")
@@ -256,7 +271,7 @@ to continue it."
   (use-local-map inferior-lisp-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))
-  (run-hooks 'inferior-lisp-mode-hook))
+  (run-mode-hooks 'inferior-lisp-mode-hook))
 
 (defun lisp-get-old-input ()
   "Return a string containing the sexp ending at point."
@@ -427,11 +442,13 @@ With argument, positions cursor at end of buffer."
 This holds a cons cell of the form `(DIRECTORY . FILE)'
 describing the last `lisp-load-file' or `lisp-compile-file' command.")
 
-(defvar lisp-source-modes '(lisp-mode)
+(defcustom lisp-source-modes '(lisp-mode)
   "*Used to determine if a buffer contains Lisp source code.
 If it's loaded into a buffer that is in one of these major modes, it's
 considered a Lisp source file by `lisp-load-file' and `lisp-compile-file'.
-Used by these commands to determine defaults.")
+Used by these commands to determine defaults."
+  :type '(repeat symbol)
+  :group 'inferior-lisp)
 
 (defun lisp-load-file (file-name)
   "Load a Lisp file into the inferior Lisp process."
@@ -574,8 +591,7 @@ See variable `lisp-describe-sym-command'."
 ;;; Do the user's customisation...
 ;;;===============================
 (defvar inferior-lisp-load-hook nil
-  "This hook is run when the library `inf-lisp' is loaded.
-This is a good place to put keybindings.")
+  "This hook is run when the library `inf-lisp' is loaded.")
 
 (run-hooks 'inferior-lisp-load-hook)
 
@@ -625,4 +641,5 @@ This is a good place to put keybindings.")
 
 (provide 'inf-lisp)
 
+;;; arch-tag: 5b74abc3-a085-4b91-8ab8-8da6899d3b92
 ;;; inf-lisp.el ends here