diff options
| author | Luc Teirlinck | 2005-04-20 23:08:12 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-04-20 23:08:12 +0000 |
| commit | 7bf23e1990a181de2861ad08e1987ba5fb6705cd (patch) | |
| tree | 799bcc11249c2203e223ff13fa6e3daf4cb050e9 | |
| parent | fcd9d5258a3e51c8d96f3c2fe400b72a89652d43 (diff) | |
| download | emacs-7bf23e1990a181de2861ad08e1987ba5fb6705cd.tar.gz emacs-7bf23e1990a181de2861ad08e1987ba5fb6705cd.zip | |
(inferior-lisp): New defgroup.
(inferior-lisp-filter-regexp, inferior-lisp-program)
(inferior-lisp-load-command, inferior-lisp-prompt)
(inferior-lisp-mode-hook, lisp-source-modes)
(inferior-lisp-load-hook): defvar->defcustom.
(inferior-lisp-program, inferior-lisp-prompt)
(inferior-lisp-load-hook): Doc fixes.
(inferior-lisp-install-letter-bindings): Small change in introductory comment.
| -rw-r--r-- | lisp/progmodes/inf-lisp.el | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 83a0c9d3e20..06ad2d591ad 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el | |||
| @@ -66,12 +66,20 @@ | |||
| 66 | (require 'lisp-mode) | 66 | (require 'lisp-mode) |
| 67 | 67 | ||
| 68 | 68 | ||
| 69 | (defgroup inferior-lisp nil | ||
| 70 | "Run an outside Lisp in an Emacs buffer." | ||
| 71 | :group 'lisp | ||
| 72 | :version "22.1") | ||
| 73 | |||
| 69 | ;;;###autoload | 74 | ;;;###autoload |
| 70 | (defvar inferior-lisp-filter-regexp "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'" | 75 | (defcustom inferior-lisp-filter-regexp |
| 76 | "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'" | ||
| 71 | "*What not to save on inferior Lisp's input history. | 77 | "*What not to save on inferior Lisp's input history. |
| 72 | Input matching this regexp is not saved on the input history in Inferior Lisp | 78 | Input matching this regexp is not saved on the input history in Inferior Lisp |
| 73 | mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword | 79 | mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword |
| 74 | \(as in :a, :c, etc.)") | 80 | \(as in :a, :c, etc.)" |
| 81 | :type 'regexp | ||
| 82 | :group 'inferior-lisp) | ||
| 75 | 83 | ||
| 76 | (defvar inferior-lisp-mode-map nil) | 84 | (defvar inferior-lisp-mode-map nil) |
| 77 | (unless inferior-lisp-mode-map | 85 | (unless inferior-lisp-mode-map |
| @@ -111,7 +119,7 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword | |||
| 111 | ;;;where they are more accessible. C-c <letter> bindings are reserved for the | 119 | ;;;where they are more accessible. C-c <letter> bindings are reserved for the |
| 112 | ;;;user, so these bindings are non-standard. If you want them, you should | 120 | ;;;user, so these bindings are non-standard. If you want them, you should |
| 113 | ;;;have this function called by the inferior-lisp-load-hook: | 121 | ;;;have this function called by the inferior-lisp-load-hook: |
| 114 | ;;; (setq inferior-lisp-load-hook '(inferior-lisp-install-letter-bindings)) | 122 | ;;; (add-hook 'inferior-lisp-load-hook 'inferior-lisp-install-letter-bindings) |
| 115 | ;;;You can modify this function to install just the bindings you want." | 123 | ;;;You can modify this function to install just the bindings you want." |
| 116 | (defun inferior-lisp-install-letter-bindings () | 124 | (defun inferior-lisp-install-letter-bindings () |
| 117 | (define-key lisp-mode-map "\C-ce" 'lisp-eval-defun-and-go) | 125 | (define-key lisp-mode-map "\C-ce" 'lisp-eval-defun-and-go) |
| @@ -133,23 +141,26 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword | |||
| 133 | (define-key inferior-lisp-mode-map "\C-cv" | 141 | (define-key inferior-lisp-mode-map "\C-cv" |
| 134 | 'lisp-show-variable-documentation)) | 142 | 'lisp-show-variable-documentation)) |
| 135 | 143 | ||
| 136 | |||
| 137 | ;;;###autoload | 144 | ;;;###autoload |
| 138 | (defvar inferior-lisp-program "lisp" | 145 | (defcustom inferior-lisp-program "lisp" |
| 139 | "*Program name for invoking an inferior Lisp with for Inferior Lisp mode.") | 146 | "*Program name for invoking an inferior Lisp in Inferior Lisp mode." |
| 147 | :type 'string | ||
| 148 | :group 'inferior-lisp) | ||
| 140 | 149 | ||
| 141 | ;;;###autoload | 150 | ;;;###autoload |
| 142 | (defvar inferior-lisp-load-command "(load \"%s\")\n" | 151 | (defcustom inferior-lisp-load-command "(load \"%s\")\n" |
| 143 | "*Format-string for building a Lisp expression to load a file. | 152 | "*Format-string for building a Lisp expression to load a file. |
| 144 | This format string should use `%s' to substitute a file name | 153 | This format string should use `%s' to substitute a file name |
| 145 | and should result in a Lisp expression that will command the inferior Lisp | 154 | and should result in a Lisp expression that will command the inferior Lisp |
| 146 | to load that file. The default works acceptably on most Lisps. | 155 | to load that file. The default works acceptably on most Lisps. |
| 147 | The string \"(progn (load \\\"%s\\\" :verbose nil :print t) (values))\\n\" | 156 | The string \"(progn (load \\\"%s\\\" :verbose nil :print t) (values))\\n\" |
| 148 | produces cosmetically superior output for this application, | 157 | produces cosmetically superior output for this application, |
| 149 | but it works only in Common Lisp.") | 158 | but it works only in Common Lisp." |
| 159 | :type 'string | ||
| 160 | :group 'inferior-lisp) | ||
| 150 | 161 | ||
| 151 | ;;;###autoload | 162 | ;;;###autoload |
| 152 | (defvar inferior-lisp-prompt "^[^> \n]*>+:? *" | 163 | (defcustom inferior-lisp-prompt "^[^> \n]*>+:? *" |
| 153 | "Regexp to recognise prompts in the Inferior Lisp mode. | 164 | "Regexp to recognise prompts in the Inferior Lisp mode. |
| 154 | Defaults to \"^[^> \\n]*>+:? *\", which works pretty good for Lucid, kcl, | 165 | Defaults to \"^[^> \\n]*>+:? *\", which works pretty good for Lucid, kcl, |
| 155 | and franz. This variable is used to initialize `comint-prompt-regexp' in the | 166 | and franz. This variable is used to initialize `comint-prompt-regexp' in the |
| @@ -163,7 +174,9 @@ Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" | |||
| 163 | franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" | 174 | franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" |
| 164 | kcl: \"^>+ *\" | 175 | kcl: \"^>+ *\" |
| 165 | 176 | ||
| 166 | This is a fine thing to set in your .emacs file.") | 177 | This is a fine thing to set in your .emacs file or through Custom." |
| 178 | :type 'regexp | ||
| 179 | :group 'inferior-lisp) | ||
| 167 | 180 | ||
| 168 | (defvar inferior-lisp-buffer nil "*The current inferior-lisp process buffer. | 181 | (defvar inferior-lisp-buffer nil "*The current inferior-lisp process buffer. |
| 169 | 182 | ||
| @@ -201,8 +214,10 @@ processes, you can change `inferior-lisp-buffer' to another process | |||
| 201 | buffer with \\[set-variable].") | 214 | buffer with \\[set-variable].") |
| 202 | 215 | ||
| 203 | ;;;###autoload | 216 | ;;;###autoload |
| 204 | (defvar inferior-lisp-mode-hook '() | 217 | (defcustom inferior-lisp-mode-hook '() |
| 205 | "*Hook for customising Inferior Lisp mode.") | 218 | "*Hook for customising Inferior Lisp mode." |
| 219 | :type 'hook | ||
| 220 | :group 'inferior-lisp) | ||
| 206 | 221 | ||
| 207 | (put 'inferior-lisp-mode 'mode-class 'special) | 222 | (put 'inferior-lisp-mode 'mode-class 'special) |
| 208 | 223 | ||
| @@ -427,11 +442,13 @@ With argument, positions cursor at end of buffer." | |||
| 427 | This holds a cons cell of the form `(DIRECTORY . FILE)' | 442 | This holds a cons cell of the form `(DIRECTORY . FILE)' |
| 428 | describing the last `lisp-load-file' or `lisp-compile-file' command.") | 443 | describing the last `lisp-load-file' or `lisp-compile-file' command.") |
| 429 | 444 | ||
| 430 | (defvar lisp-source-modes '(lisp-mode) | 445 | (defcustom lisp-source-modes '(lisp-mode) |
| 431 | "*Used to determine if a buffer contains Lisp source code. | 446 | "*Used to determine if a buffer contains Lisp source code. |
| 432 | If it's loaded into a buffer that is in one of these major modes, it's | 447 | If it's loaded into a buffer that is in one of these major modes, it's |
| 433 | considered a Lisp source file by `lisp-load-file' and `lisp-compile-file'. | 448 | considered a Lisp source file by `lisp-load-file' and `lisp-compile-file'. |
| 434 | Used by these commands to determine defaults.") | 449 | Used by these commands to determine defaults." |
| 450 | :type '(repeat symbol) | ||
| 451 | :group 'inferior-lisp) | ||
| 435 | 452 | ||
| 436 | (defun lisp-load-file (file-name) | 453 | (defun lisp-load-file (file-name) |
| 437 | "Load a Lisp file into the inferior Lisp process." | 454 | "Load a Lisp file into the inferior Lisp process." |
| @@ -573,9 +590,10 @@ See variable `lisp-describe-sym-command'." | |||
| 573 | 590 | ||
| 574 | ;;; Do the user's customisation... | 591 | ;;; Do the user's customisation... |
| 575 | ;;;=============================== | 592 | ;;;=============================== |
| 576 | (defvar inferior-lisp-load-hook nil | 593 | (defcustom inferior-lisp-load-hook nil |
| 577 | "This hook is run when the library `inf-lisp' is loaded. | 594 | "This hook is run when the library `inf-lisp' is loaded." |
| 578 | This is a good place to put keybindings.") | 595 | :type 'hook |
| 596 | :group 'inferior-lisp) | ||
| 579 | 597 | ||
| 580 | (run-hooks 'inferior-lisp-load-hook) | 598 | (run-hooks 'inferior-lisp-load-hook) |
| 581 | 599 | ||