emacs/lisp/progmodes/inf-lisp.el

677 lines
27 KiB
EmacsLisp
Raw Normal View History

;;; inf-lisp.el --- an inferior-lisp mode -*- lexical-binding: t -*-
1996-01-14 07:34:30 +00:00
;; Copyright (C) 1988-2021 Free Software Foundation, Inc.
1992-07-22 04:22:42 +00:00
1992-07-16 19:23:43 +00:00
;; Author: Olin Shivers <shivers@cs.cmu.edu>
1993-03-18 21:29:42 +00:00
;; Keywords: processes, lisp
1992-07-16 19:23:43 +00:00
1996-01-14 07:34:30 +00:00
;; This file is part of GNU Emacs.
1992-07-21 23:40:16 +00:00
;; GNU Emacs is free software: you can redistribute it and/or modify
1996-01-14 07:34:30 +00:00
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
1992-07-21 23:40:16 +00:00
1996-01-14 07:34:30 +00:00
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
1992-07-21 23:40:16 +00:00
1996-01-14 07:34:30 +00:00
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
1991-05-13 21:21:58 +00:00
1992-07-16 19:23:43 +00:00
;;; Commentary:
;; Hacked from tea.el by Olin Shivers (shivers@cs.cmu.edu). 8/88
1996-01-14 07:34:30 +00:00
2002-07-03 11:24:02 +00:00
;; 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
2002-07-03 11:24:02 +00:00
;; also more compatible with the bindings of Hemlock and Zwei (the
;; Lisp Machine Emacs).
1996-01-14 07:34:30 +00:00
;; Since this mode is built on top of the general command-interpreter-in-
;; a-buffer mode (comint mode), it shares a common base functionality,
1996-01-14 07:34:30 +00:00
;; and a common set of bindings, with all modes derived from comint mode.
;; This makes these modes easier to use.
;; For documentation on the functionality provided by comint mode, and
2011-12-11 21:32:49 -08:00
;; the hooks available for customizing it, see the file comint.el.
1996-01-14 07:34:30 +00:00
;; For further information on inferior-lisp mode, see the comments below.
;; Needs fixing:
1996-01-14 07:34:30 +00:00
;; The load-file/compile-file default mechanism could be smarter -- it
;; doesn't know about the relationship between filename extensions and
;; whether the file is source or executable. If you compile foo.lisp
1996-01-14 07:34:30 +00:00
;; with compile-file, then the next load-file should use foo.bin for
;; the default, not foo.lisp. This is tricky to do right, particularly
1996-01-14 07:34:30 +00:00
;; because the extension for executable files varies so much (.o, .bin,
;; .lbin, .mo, .vo, .ao, ...).
;;
;; It would be nice if inferior-lisp (and inferior scheme, T, ...) modes
;; had a verbose minor mode wherein sending or compiling defuns, etc.
;; would be reflected in the transcript with suitable comments, e.g.
;; ";;; redefining fact". Several ways to do this. Which is right?
1996-01-14 07:34:30 +00:00
;;
;; When sending text from a source file to a subprocess, the process-mark can
1996-01-14 07:34:30 +00:00
;; move off the window, so you can lose sight of the process interactions.
;; Maybe I should ensure the process mark is in the window when I send
;; text to the process? Switch selectable?
1991-05-13 21:21:58 +00:00
1992-07-16 19:23:43 +00:00
;;; Code:
(require 'comint)
1992-07-22 01:19:00 +00:00
(require 'lisp-mode)
1991-05-13 21:21:58 +00:00
(defgroup inferior-lisp nil
"Run an outside Lisp in an Emacs buffer."
:group 'lisp
:version "22.1")
(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.)"
:type 'regexp)
1991-05-13 21:21:58 +00:00
(defvar inferior-lisp-mode-map
(let ((map (copy-keymap comint-mode-map)))
(set-keymap-parent map lisp-mode-shared-map)
(define-key map "\C-x\C-e" #'lisp-eval-last-sexp)
(define-key map "\C-c\C-l" #'lisp-load-file)
(define-key map "\C-c\C-k" #'lisp-compile-file)
(define-key map "\C-c\C-a" #'lisp-show-arglist)
(define-key map "\C-c\C-d" #'lisp-describe-sym)
(define-key map "\C-c\C-f" #'lisp-show-function-documentation)
(define-key map "\C-c\C-v" #'lisp-show-variable-documentation)
map))
1991-05-13 21:21:58 +00:00
(easy-menu-define
inferior-lisp-menu
inferior-lisp-mode-map
"Inferior Lisp Menu."
'("Inf-Lisp"
["Eval Last Sexp" lisp-eval-last-sexp t]
"--"
["Load File..." lisp-load-file t]
["Compile File..." lisp-compile-file t]
"--"
["Show Arglist..." lisp-show-arglist t]
["Describe Symbol..." lisp-describe-sym t]
["Show Documentation for Function..." lisp-show-function-documentation t]
["Show Documentation for Variable..." lisp-show-variable-documentation t]))
1991-05-13 21:21:58 +00:00
;;; These commands augment Lisp mode, so you can process Lisp code in
;;; the source files.
(define-key lisp-mode-map "\M-\C-x" #'lisp-eval-defun) ; GNU convention
(define-key lisp-mode-map "\C-x\C-e" #'lisp-eval-last-sexp) ; GNU convention
(define-key lisp-mode-map "\C-c\C-e" #'lisp-eval-defun)
(define-key lisp-mode-map "\C-c\C-r" #'lisp-eval-region)
(define-key lisp-mode-map "\C-c\C-n" #'lisp-eval-form-and-next)
(define-key lisp-mode-map "\C-c\C-p" #'lisp-eval-paragraph)
(define-key lisp-mode-map "\C-c\C-c" #'lisp-compile-defun)
(define-key lisp-mode-map "\C-c\C-z" #'switch-to-lisp)
(define-key lisp-mode-map "\C-c\C-l" #'lisp-load-file)
(define-key lisp-mode-map "\C-c\C-k" #'lisp-compile-file) ; "kompile" file
(define-key lisp-mode-map "\C-c\C-a" #'lisp-show-arglist)
(define-key lisp-mode-map "\C-c\C-d" #'lisp-describe-sym)
(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)
1991-05-13 21:21:58 +00:00
;; This function exists for backwards compatibility.
;; Previous versions of this package bound commands to C-c <letter>
;; bindings, which is not allowed by the Emacs standard.
1992-06-24 05:09:26 +00:00
;;; "This function binds many inferior-lisp commands to C-c <letter> bindings,
;;;where they are more accessible. C-c <letter> bindings are reserved for the
;;;user, so these bindings are non-standard. If you want them:
;;; (with-eval-after-load 'inf-lisp 'inferior-lisp-install-letter-bindings)
;;;You can modify this function to install just the bindings you want."
1992-07-21 23:40:16 +00:00
(defun inferior-lisp-install-letter-bindings ()
(define-key lisp-mode-map "\C-ce" #'lisp-eval-defun-and-go)
(define-key lisp-mode-map "\C-cr" #'lisp-eval-region-and-go)
(define-key lisp-mode-map "\C-cc" #'lisp-compile-defun-and-go)
(define-key lisp-mode-map "\C-cz" #'switch-to-lisp)
(define-key lisp-mode-map "\C-cl" #'lisp-load-file)
(define-key lisp-mode-map "\C-ck" #'lisp-compile-file)
(define-key lisp-mode-map "\C-ca" #'lisp-show-arglist)
(define-key lisp-mode-map "\C-cd" #'lisp-describe-sym)
(define-key lisp-mode-map "\C-cf" #'lisp-show-function-documentation)
(define-key lisp-mode-map "\C-cv" #'lisp-show-variable-documentation)
(define-key inferior-lisp-mode-map "\C-cl" #'lisp-load-file)
(define-key inferior-lisp-mode-map "\C-ck" #'lisp-compile-file)
(define-key inferior-lisp-mode-map "\C-ca" #'lisp-show-arglist)
(define-key inferior-lisp-mode-map "\C-cd" #'lisp-describe-sym)
(define-key inferior-lisp-mode-map "\C-cf" #'lisp-show-function-documentation)
(define-key inferior-lisp-mode-map "\C-cv" #'lisp-show-variable-documentation))
1992-06-24 05:09:26 +00:00
(defcustom inferior-lisp-program "lisp"
"Program name for invoking an inferior Lisp in Inferior Lisp mode."
:type 'string)
1991-05-13 21:21:58 +00:00
(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
1991-05-13 21:21:58 +00:00
and should result in a Lisp expression that will command the inferior Lisp
to load that file. The default works acceptably on most Lisps.
1995-11-25 00:28:19 +00:00
The string \"(progn (load \\\"%s\\\" :verbose nil :print t) (values))\\n\"
1991-05-13 21:21:58 +00:00
produces cosmetically superior output for this application,
but it works only in Common Lisp."
:type 'string)
1991-05-13 21:21:58 +00:00
(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.
1991-05-13 21:21:58 +00:00
2000-08-07 14:59:23 +00:00
This variable is only used if the variable
2005-04-26 23:18:05 +00:00
`comint-use-prompt-regexp' is non-nil.
2000-08-07 14:59:23 +00:00
1991-05-13 21:21:58 +00:00
More precise choices:
1995-11-25 00:28:19 +00:00
Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\"
franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\"
Update docstrings and comments to use "init file" terminology. * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. * comint.el (comint-prompt-read-only): * custom.el (defcustom): * hi-lock.el (hi-lock-mode): * ibuffer.el (ibuffer-formats): * ielm.el (ielm-prompt-read-only): * novice.el (disable-command): * saveplace.el (toggle-save-place): * speedbar.el (speedbar-supported-extension-expressions): * startup.el (auto-save-list-file-prefix, init-file-user) (after-init-hook, inhibit-startup-echo-area-message): * strokes.el (strokes-help): * time-stamp.el (time-stamp): * calendar/calendar.el (calendar, diary-file): * calendar/diary-lib.el (diary-mail-entries, diary) (diary-list-entries-hook): * calendar/holidays.el (holidays, calendar-holidays): * calendar/lunar.el (lunar-phases): * calendar/solar.el (sunrise-sunset): * emulation/edt.el (edt-load-keys): * emulation/viper.el (viper-mode): * eshell/em-alias.el (eshell-command-aliases-list): * eshell/esh-util.el (eshell-convert-numeric-arguments): * international/ogonek.el (ogonek-information): * net/tramp-cmds.el (tramp-bug): * net/quickurl.el (quickurl-reread-hook-postfix): * play/decipher.el (decipher-font-lock-keywords): * progmodes/cc-styles.el (c-set-style): * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): * progmodes/inf-lisp.el (inferior-lisp-prompt): * progmodes/octave-mod.el (octave-mode): * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): * progmodes/verilog-mode.el (verilog-read-defines): * textmodes/two-column.el (2C-mode): Likewise.
2012-09-17 13:41:04 +08:00
kcl: \"^>+ *\""
:type 'regexp)
1991-05-13 21:21:58 +00:00
(defvar inferior-lisp-buffer nil "*The current `inferior-lisp' process buffer.
MULTIPLE PROCESS SUPPORT
===========================================================================
To run multiple Lisp processes, you start the first up
with \\[inferior-lisp]. It will be in a buffer named `*inferior-lisp*'.
Rename this buffer with \\[rename-buffer]. You may now start up a new
process with another \\[inferior-lisp]. It will be in a new buffer,
named `*inferior-lisp*'. You can switch between the different process
buffers with \\[switch-to-buffer].
Commands that send text from source buffers to Lisp processes --
like `lisp-eval-defun' or `lisp-show-arglist' -- have to choose a process
to send to, when you have more than one Lisp process around. This
is determined by the global variable `inferior-lisp-buffer'. Suppose you
have three inferior Lisps running:
Buffer Process
foo inferior-lisp
bar inferior-lisp<2>
*inferior-lisp* inferior-lisp<3>
If you do a \\[lisp-eval-defun] command on some Lisp source code,
what process do you send it to?
- If you're in a process buffer (foo, bar, or *inferior-lisp*),
you send it to that process.
- If you're in some other buffer (e.g., a source file), you
send it to the process attached to buffer `inferior-lisp-buffer'.
This process selection is performed by function `inferior-lisp-proc'.
Whenever \\[inferior-lisp] fires up a new process, it resets
`inferior-lisp-buffer' to be the new process's buffer. If you only run
one process, this does the right thing. If you run multiple
processes, you might need to change `inferior-lisp-buffer' to
whichever process buffer you want to use.")
(defvar inferior-lisp-mode-hook '()
"Hook for customizing Inferior Lisp mode.")
1991-05-13 21:21:58 +00:00
(put 'inferior-lisp-mode 'mode-class 'special)
Derive from prog-mode, use derived-mode-p, and fix up various minor style issues in lisp/progmodes. * lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init) (vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable -> make-local-hook. * lisp/progmodes/sh-script.el (sh-require-final-newline): Remove. (sh-set-shell): Don't set require-final-newline since it's already done by prog-mode. * lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column since we never set it. * lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation): Use read-string and standard prompt. * lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration. * lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl. (meta-common-mode-syntax-table): Rename from meta-mode-syntax-table. (meta-common-mode-map): Rename from meta-mode-map. Remove C-m binding, which is a user preference, not mode specific. (meta-common-mode): New major mode; replace meta-common-initialization. * lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing around with font-lock. * lisp/progmodes/etags.el (select-tags-table-mode): Derive from special-mode. * lisp/progmodes/octave-mod.el (octave-mode): * lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode) (gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode) (gdb-frames-mode, gdb-locals-mode, gdb-registers-mode): Let define-derived-mode do its job. * lisp/progmodes/cpp.el (cpp-edit-mode-map): Move initialization into declaration. (cpp-edit-mode): Use define-derived-mode. (cpp-edit-load): Use derived-mode-p. * lisp/progmodes/mixal-mode.el (mixal-mode): * lisp/progmodes/f90.el (f90-mode): * lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting require-final-newline since prog-mode does it already. * lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string. * lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup. * lisp/progmodes/antlr-mode.el: Require cc-mode upfront. (antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in the declaration. (antlr-directory-dependencies, antlr-show-makefile-rules): Use derived-mode-p. (antlr-language-option): Don't assume point-min==1. (antlr-mode): Use define-derived-mode. * lisp/progmodes/ada-mode.el: Use derived-mode-p. (ada-mode): Use define-derived-mode. Use hack-local-variables-hook. * lisp/progmodes/vhdl-mode.el (vhdl-mode): * lisp/progmodes/verilog-mode.el (verilog-mode): * lisp/progmodes/vera-mode.el (vera-mode): * lisp/progmodes/sql.el (sql-mode): * lisp/progmodes/scheme.el (scheme-mode): * lisp/progmodes/perl-mode.el (perl-mode): * lisp/progmodes/octave-inf.el (inferior-octave-mode): * lisp/progmodes/autoconf.el (autoconf-mode): * lisp/progmodes/m4-mode.el (m4-mode): * lisp/progmodes/inf-lisp.el (inferior-lisp-mode): * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/icon.el (icon-mode): * lisp/progmodes/idlw-help.el (idlwave-help-mode): * lisp/progmodes/dcl-mode.el (dcl-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode) (ebrowse-member-mode, ebrowse-electric-position-mode): Use define-derived-mode. * lisp/progmodes/xscheme.el (xscheme-start) (local-set-scheme-interaction-buffer, scheme-interaction-mode): * lisp/progmodes/which-func.el (which-function): * lisp/progmodes/vhdl-mode.el (vhdl-set-style): * lisp/progmodes/verilog-mode.el (verilog-set-compile-command) (verilog-modify-compile-command, verilog-error-regexp-add-xemacs) (verilog-set-define, verilog-auto-reeval-locals): * lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode): * lisp/progmodes/simula.el (simula-mode): * lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode): * lisp/progmodes/python.el (python-check, python-mode): * lisp/progmodes/prolog.el (prolog-mode-variables): * lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions): * lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame): * lisp/progmodes/delphi.el (delphi-mode): * lisp/progmodes/cc-styles.el (c-setup-paragraph-variables): * lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init) (c-font-lock-init): Move make-local-variable to their setq. * lisp/progmodes/xscheme.el (exit-scheme-interaction-mode) (xscheme-enter-interaction-mode, xscheme-enter-debugger-mode) (xscheme-debugger-mode-p, xscheme-send-string-1): * lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word) (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/ps-mode.el (ps-run-running): * lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint): * lisp/progmodes/js.el (js--get-all-known-symbols): * lisp/progmodes/inf-lisp.el (inferior-lisp-proc): * lisp/progmodes/idlwave.el (idlwave-beginning-of-statement) (idlwave-template, idlwave-update-buffer-routine-info) (idlwave-update-current-buffer-info) (idlwave-get-routine-info-from-buffers, idlwave-choose) (idlwave-scan-class-info, idlwave-fix-keywords) (idlwave-list-buffer-load-path-shadows): * lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add) (idlwave-toolbar-remove): * lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action) (idlwave-shell-file-name, idlwave-shell-electric-debug-all-off) (idlwave-shell-menu-def): * lisp/progmodes/idlw-complete-structtag.el (idlwave-prepare-structure-tag-completion): * lisp/progmodes/gud.el (gud-set-buffer): * lisp/progmodes/f90.el (f90-backslash-not-special): * lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 15:00:25 -05:00
(define-derived-mode inferior-lisp-mode comint-mode "Inferior Lisp"
"Major mode for interacting with an inferior Lisp process.
1991-05-13 21:21:58 +00:00
Runs a Lisp interpreter as a subprocess of Emacs, with Lisp I/O through an
Emacs buffer. Variable `inferior-lisp-program' controls which Lisp interpreter
is run. Variables `inferior-lisp-prompt', `inferior-lisp-filter-regexp' and
`inferior-lisp-load-command' can customize this mode for different Lisp
1991-05-13 21:21:58 +00:00
interpreters.
For information on running multiple processes in multiple buffers, see
documentation for variable `inferior-lisp-buffer'.
1991-05-13 21:21:58 +00:00
1992-07-21 23:40:16 +00:00
\\{inferior-lisp-mode-map}
1991-05-13 21:21:58 +00:00
2006-06-02 02:07:11 +00:00
Customization: Entry to this mode runs the hooks on `comint-mode-hook' and
`inferior-lisp-mode-hook' (in that order).
1991-05-13 21:21:58 +00:00
You can send text to the inferior Lisp process from other buffers containing
Lisp source.
2006-06-02 02:07:11 +00:00
`switch-to-lisp' switches the current buffer to the Lisp process buffer.
`lisp-eval-defun' sends the current defun to the Lisp process.
`lisp-compile-defun' compiles the current defun.
`lisp-eval-region' sends the current region to the Lisp process.
`lisp-compile-region' compiles the current region.
1991-05-13 21:21:58 +00:00
1992-06-24 05:09:26 +00:00
Prefixing the lisp-eval/compile-defun/region commands with
a \\[universal-argument] causes a switch to the Lisp process buffer after sending
the text.
1991-05-13 21:21:58 +00:00
2006-06-02 02:07:11 +00:00
Commands:\\<inferior-lisp-mode-map>
\\[comint-send-input] after the end of the process' output sends the text from the
1991-05-13 21:21:58 +00:00
end of process to point.
2006-06-02 02:07:11 +00:00
\\[comint-send-input] before the end of the process' output copies the sexp ending at point
1991-05-13 21:21:58 +00:00
to the end of the process' output, and sends it.
2006-06-02 02:07:11 +00:00
\\[comint-copy-old-input] copies the sexp ending at point to the end of the process' output,
allowing you to edit it before sending it.
If `comint-use-prompt-regexp' is nil (the default), \\[comint-insert-input] on old input
copies the entire old input to the end of the process' output, allowing
you to edit it before sending it. When not used on old input, or if
`comint-use-prompt-regexp' is non-nil, \\[comint-insert-input] behaves according to
its global binding.
\\[backward-delete-char-untabify] converts tabs to spaces as it moves back.
\\[lisp-indent-line] indents for Lisp; with argument, shifts rest
1991-05-13 21:21:58 +00:00
of expression rigidly with the current line.
2006-06-02 02:07:11 +00:00
\\[indent-sexp] does \\[lisp-indent-line] on each line starting within following expression.
1991-05-13 21:21:58 +00:00
Paragraphs are separated only by blank lines. Semicolons start comments.
If you accidentally suspend your process, use \\[comint-continue-subjob]
to continue it."
(setq comint-prompt-regexp inferior-lisp-prompt)
(setq mode-line-process '(":%s"))
(lisp-mode-variables)
(set-syntax-table lisp-mode-syntax-table)
1991-05-13 21:21:58 +00:00
(setq comint-get-old-input (function lisp-get-old-input))
Derive from prog-mode, use derived-mode-p, and fix up various minor style issues in lisp/progmodes. * lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init) (vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable -> make-local-hook. * lisp/progmodes/sh-script.el (sh-require-final-newline): Remove. (sh-set-shell): Don't set require-final-newline since it's already done by prog-mode. * lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column since we never set it. * lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation): Use read-string and standard prompt. * lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration. * lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl. (meta-common-mode-syntax-table): Rename from meta-mode-syntax-table. (meta-common-mode-map): Rename from meta-mode-map. Remove C-m binding, which is a user preference, not mode specific. (meta-common-mode): New major mode; replace meta-common-initialization. * lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing around with font-lock. * lisp/progmodes/etags.el (select-tags-table-mode): Derive from special-mode. * lisp/progmodes/octave-mod.el (octave-mode): * lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode) (gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode) (gdb-frames-mode, gdb-locals-mode, gdb-registers-mode): Let define-derived-mode do its job. * lisp/progmodes/cpp.el (cpp-edit-mode-map): Move initialization into declaration. (cpp-edit-mode): Use define-derived-mode. (cpp-edit-load): Use derived-mode-p. * lisp/progmodes/mixal-mode.el (mixal-mode): * lisp/progmodes/f90.el (f90-mode): * lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting require-final-newline since prog-mode does it already. * lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string. * lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup. * lisp/progmodes/antlr-mode.el: Require cc-mode upfront. (antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in the declaration. (antlr-directory-dependencies, antlr-show-makefile-rules): Use derived-mode-p. (antlr-language-option): Don't assume point-min==1. (antlr-mode): Use define-derived-mode. * lisp/progmodes/ada-mode.el: Use derived-mode-p. (ada-mode): Use define-derived-mode. Use hack-local-variables-hook. * lisp/progmodes/vhdl-mode.el (vhdl-mode): * lisp/progmodes/verilog-mode.el (verilog-mode): * lisp/progmodes/vera-mode.el (vera-mode): * lisp/progmodes/sql.el (sql-mode): * lisp/progmodes/scheme.el (scheme-mode): * lisp/progmodes/perl-mode.el (perl-mode): * lisp/progmodes/octave-inf.el (inferior-octave-mode): * lisp/progmodes/autoconf.el (autoconf-mode): * lisp/progmodes/m4-mode.el (m4-mode): * lisp/progmodes/inf-lisp.el (inferior-lisp-mode): * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/icon.el (icon-mode): * lisp/progmodes/idlw-help.el (idlwave-help-mode): * lisp/progmodes/dcl-mode.el (dcl-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode) (ebrowse-member-mode, ebrowse-electric-position-mode): Use define-derived-mode. * lisp/progmodes/xscheme.el (xscheme-start) (local-set-scheme-interaction-buffer, scheme-interaction-mode): * lisp/progmodes/which-func.el (which-function): * lisp/progmodes/vhdl-mode.el (vhdl-set-style): * lisp/progmodes/verilog-mode.el (verilog-set-compile-command) (verilog-modify-compile-command, verilog-error-regexp-add-xemacs) (verilog-set-define, verilog-auto-reeval-locals): * lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode): * lisp/progmodes/simula.el (simula-mode): * lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode): * lisp/progmodes/python.el (python-check, python-mode): * lisp/progmodes/prolog.el (prolog-mode-variables): * lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions): * lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame): * lisp/progmodes/delphi.el (delphi-mode): * lisp/progmodes/cc-styles.el (c-setup-paragraph-variables): * lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init) (c-font-lock-init): Move make-local-variable to their setq. * lisp/progmodes/xscheme.el (exit-scheme-interaction-mode) (xscheme-enter-interaction-mode, xscheme-enter-debugger-mode) (xscheme-debugger-mode-p, xscheme-send-string-1): * lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word) (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/ps-mode.el (ps-run-running): * lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint): * lisp/progmodes/js.el (js--get-all-known-symbols): * lisp/progmodes/inf-lisp.el (inferior-lisp-proc): * lisp/progmodes/idlwave.el (idlwave-beginning-of-statement) (idlwave-template, idlwave-update-buffer-routine-info) (idlwave-update-current-buffer-info) (idlwave-get-routine-info-from-buffers, idlwave-choose) (idlwave-scan-class-info, idlwave-fix-keywords) (idlwave-list-buffer-load-path-shadows): * lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add) (idlwave-toolbar-remove): * lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action) (idlwave-shell-file-name, idlwave-shell-electric-debug-all-off) (idlwave-shell-menu-def): * lisp/progmodes/idlw-complete-structtag.el (idlwave-prepare-structure-tag-completion): * lisp/progmodes/gud.el (gud-set-buffer): * lisp/progmodes/f90.el (f90-backslash-not-special): * lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 15:00:25 -05:00
(setq comint-input-filter (function lisp-input-filter)))
1991-05-13 21:21:58 +00:00
(defun lisp-get-old-input ()
"Return a string containing the sexp ending at point."
1991-05-13 21:21:58 +00:00
(save-excursion
(let ((end (point)))
(backward-sexp)
(buffer-substring (point) end))))
(defun lisp-input-filter (str)
lisp/*.el: Fix typos and improve some docstrings * lisp/auth-source.el (auth-source-backend-parse-parameters) (auth-source-search-collection) (auth-source-secrets-listify-pattern) (auth-source--decode-octal-string, auth-source-plstore-search): * lisp/registry.el (registry-lookup) (registry-lookup-breaks-before-lexbind) (registry-lookup-secondary, registry-lookup-secondary-value) (registry-search, registry-delete, registry-size, registry-full) (registry-insert, registry-reindex, registry-prune) (registry-collect-prune-candidates): * lisp/subr.el (nbutlast, process-live-p): * lisp/tab-bar.el (tab-bar-list): * lisp/cedet/ede/linux.el (ede-linux--get-archs) (ede-linux--include-path, ede-linux-load): * lisp/erc/erc-log.el (erc-log-all-but-server-buffers): * lisp/erc/erc-pcomplete.el (pcomplete-erc-commands) (pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks) (pcomplete-erc-all-nicks, pcomplete-erc-channels) (pcomplete-erc-command-name, pcomplete-erc-parse-arguments): * lisp/eshell/em-term.el (eshell-visual-command-p): * lisp/gnus/gnus-cache.el (gnus-cache-fully-p): * lisp/gnus/nnmail.el (nnmail-get-active) (nnmail-fancy-expiry-target): * lisp/mail/mail-utils.el (mail-string-delete): * lisp/mail/supercite.el (sc-hdr, sc-valid-index-p): * lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p): * lisp/net/nsm.el (nsm-save-fingerprint-maybe) (nsm-network-same-subnet, nsm-should-check): * lisp/net/rcirc.el (rcirc-looking-at-input): * lisp/net/tramp-cache.el (tramp-get-hash-table): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-smb.el (tramp-smb-get-share) (tramp-smb-get-localname, tramp-smb-read-file-entry) (tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services) (zeroconf-get-host, zeroconf-get-domain) (zeroconf-get-host-domain): * lisp/nxml/rng-xsd.el (rng-xsd-compile) (rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time): * lisp/obsolete/erc-hecomplete.el (erc-hecomplete) (erc-command-list, erc-complete-at-prompt): * lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl): * lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic) (org-babel--variable-assignments:bash_array) (org-babel--variable-assignments:bash_assoc) (org-babel--variable-assignments:bash): * lisp/org/org-clock.el (org-day-of-week): * lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p): * lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr) (gud-prev-expr, gud-next-expr): * lisp/textmodes/table.el (table--at-cell-p, table--probe-cell) (table--get-cell-justify-property) (table--get-cell-valign-property) (table--put-cell-justify-property) (table--put-cell-valign-property): Fix typos. * lisp/so-long.el (fboundp): Doc fix. (so-long-mode-line-info, so-long-mode) (so-long--check-header-modes): Fix typos. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-mouse-click-get-word): Fix typos. (viper-mouse-click-search-word): Doc fix. * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): Fix typos. (erc-decode-string-from-target, define-erc-response-handler): Refill docstring. * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo. (erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file): Doc fixes. * lisp/erc/erc-networks.el (erc-network-name): Fix typo. (erc-determine-network): Refill docstring. * lisp/net/dbus.el (dbus-list-hash-table) (dbus-string-to-byte-array, dbus-byte-array-to-string) (dbus-check-event): Fix typos. (dbus-introspect-get-property): Doc fix. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Rename ARGS to ARGUMENTS. Doc fix. (tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command) (tramp-adb-find-test-command): Fix typos. * lisp/net/tramp.el (tramp-set-completion-function) (tramp-get-completion-function) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-get-inode, tramp-get-device, tramp-mode-string-to-int) (tramp-call-process, tramp-call-process-region) (tramp-process-lines): Fix typos. (tramp-interrupt-process): Doc fix. * lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name) (org-babel-named-data-regexp-for-name): Doc fix. (org-babel-src-block-names, org-babel-result-names): Fix typos. * lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix. (lisp-fn-called-at-pt): Fix typo. * lisp/progmodes/xref.el (xref-backend-identifier-at-point): Doc fix. (xref-backend-identifier-completion-table): Fix typo.
2019-10-20 12:12:27 +02:00
"Return t if STR does not match `inferior-lisp-filter-regexp'."
1992-07-21 23:40:16 +00:00
(not (string-match inferior-lisp-filter-regexp str)))
1991-05-13 21:21:58 +00:00
1992-08-12 12:50:10 +00:00
;;;###autoload
1992-07-21 23:40:16 +00:00
(defun inferior-lisp (cmd)
"Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'.
If there is a process already running in `*inferior-lisp*', just switch
1992-07-21 23:40:16 +00:00
to that buffer.
1992-06-24 05:09:26 +00:00
With argument, allows you to edit the command line (default is value
of `inferior-lisp-program'). Runs the hooks from
`inferior-lisp-mode-hook' (after the `comint-mode-hook' is run).
1991-05-13 21:21:58 +00:00
\(Type \\[describe-mode] in the process buffer for a list of commands.)"
1992-06-24 05:09:26 +00:00
(interactive (list (if current-prefix-arg
(read-string "Run lisp: " inferior-lisp-program)
1992-07-21 23:40:16 +00:00
inferior-lisp-program)))
(if (not (comint-check-proc "*inferior-lisp*"))
(let ((cmdlist (split-string cmd)))
1992-07-21 23:40:16 +00:00
(set-buffer (apply (function make-comint)
"inferior-lisp" (car cmdlist) nil (cdr cmdlist)))
(inferior-lisp-mode)))
(setq inferior-lisp-buffer "*inferior-lisp*")
(pop-to-buffer-same-window "*inferior-lisp*"))
1992-07-21 23:40:16 +00:00
;;;###autoload
(defalias 'run-lisp 'inferior-lisp)
1991-05-13 21:21:58 +00:00
(defun lisp-eval-paragraph (&optional and-go)
"Send the current paragraph to the inferior Lisp process.
Prefix argument means switch to the Lisp buffer afterwards."
(interactive "P")
(save-excursion
(mark-paragraph)
(lisp-eval-region (point) (mark) and-go)))
1992-06-24 05:09:26 +00:00
(defun lisp-eval-region (start end &optional and-go)
"Send the current region to the inferior Lisp process.
Prefix argument means switch to the Lisp buffer afterwards."
1992-06-24 05:09:26 +00:00
(interactive "r\nP")
1992-07-21 23:40:16 +00:00
(comint-send-region (inferior-lisp-proc) start end)
(comint-send-string (inferior-lisp-proc) "\n")
1992-06-24 05:09:26 +00:00
(if and-go (switch-to-lisp t)))
1991-05-13 21:21:58 +00:00
(defun lisp-compile-string (string)
"Send STRING to the inferior Lisp process to be compiled and executed."
(comint-send-string
(inferior-lisp-proc)
(format "(funcall (compile nil (lambda () %s)))\n" string)))
(defun lisp-eval-string (string)
"Send STRING to the inferior Lisp process to be executed."
(comint-send-string (inferior-lisp-proc) (concat string "\n")))
(defun lisp-do-defun (do-string do-region)
1992-06-24 05:09:26 +00:00
"Send the current defun to the inferior Lisp process.
The actually processing is done by DO-STRING and DO-REGION
which determine whether the code is compiled before evaluation.
DEFVAR forms reset the variables to the init values."
1991-05-13 21:21:58 +00:00
(save-excursion
;; Find the end of the defun this way to avoid having the region
;; possibly end with a comment (it there'a a comment after the
;; final parenthesis).
(beginning-of-defun)
(forward-sexp)
(let ((end (point)) (case-fold-search t))
1992-06-24 05:09:26 +00:00
(beginning-of-defun)
(if (looking-at "(defvar")
(funcall do-string
;; replace `defvar' with `defparameter'
(concat "(defparameter "
(buffer-substring-no-properties (+ (point) 7) end)
"\n"))
(funcall do-region (point) end)))))
(defun lisp-eval-defun (&optional and-go)
"Send the current defun to the inferior Lisp process.
DEFVAR forms reset the variables to the init values.
Prefix argument means switch to the Lisp buffer afterwards."
(interactive "P")
(lisp-do-defun 'lisp-eval-string 'lisp-eval-region)
1992-06-24 05:09:26 +00:00
(if and-go (switch-to-lisp t)))
1991-05-13 21:21:58 +00:00
1992-06-24 05:09:26 +00:00
(defun lisp-eval-last-sexp (&optional and-go)
"Send the previous sexp to the inferior Lisp process.
Prefix argument means switch to the Lisp buffer afterwards."
1992-06-24 05:09:26 +00:00
(interactive "P")
(lisp-eval-region (save-excursion (backward-sexp) (point)) (point) and-go))
1991-05-13 21:21:58 +00:00
(defun lisp-eval-form-and-next ()
"Send the previous sexp to the inferior Lisp process and move to the next one."
(interactive "")
(while (not (zerop (car (syntax-ppss))))
(up-list))
(lisp-eval-last-sexp)
(forward-sexp))
1992-06-24 05:09:26 +00:00
(defun lisp-compile-region (start end &optional and-go)
"Compile the current region in the inferior Lisp process.
Prefix argument means switch to the Lisp buffer afterwards."
1992-06-24 05:09:26 +00:00
(interactive "r\nP")
(lisp-compile-string (buffer-substring-no-properties start end))
1992-06-24 05:09:26 +00:00
(if and-go (switch-to-lisp t)))
1992-07-21 23:40:16 +00:00
1992-06-24 05:09:26 +00:00
(defun lisp-compile-defun (&optional and-go)
"Compile the current defun in the inferior Lisp process.
DEFVAR forms reset the variables to the init values.
Prefix argument means switch to the Lisp buffer afterwards."
1992-06-24 05:09:26 +00:00
(interactive "P")
(lisp-do-defun 'lisp-compile-string 'lisp-compile-region)
1992-06-24 05:09:26 +00:00
(if and-go (switch-to-lisp t)))
1991-05-13 21:21:58 +00:00
(defun switch-to-lisp (eob-p)
"Switch to the inferior Lisp process buffer.
With argument, positions cursor at end of buffer."
(interactive "P")
(if (get-buffer-process inferior-lisp-buffer)
(let ((pop-up-frames
;; Be willing to use another frame
;; that already has the window in it.
(or pop-up-frames
(get-buffer-window inferior-lisp-buffer t))))
(pop-to-buffer inferior-lisp-buffer))
(run-lisp inferior-lisp-program))
(when eob-p
1991-05-13 21:21:58 +00:00
(push-mark)
(goto-char (point-max))))
1991-05-13 21:21:58 +00:00
1992-06-24 05:09:26 +00:00
;;; Now that lisp-compile/eval-defun/region takes an optional prefix arg,
;;; these commands are redundant. But they are kept around for the user
;;; to bind if he wishes, for backwards functionality, and because it's
;;; easier to type C-c e than C-u C-c C-e.
1991-05-13 21:21:58 +00:00
(defun lisp-eval-region-and-go (start end)
"Send the current region to the inferior Lisp, and switch to its buffer."
1991-05-13 21:21:58 +00:00
(interactive "r")
1992-06-24 05:09:26 +00:00
(lisp-eval-region start end t))
1991-05-13 21:21:58 +00:00
(defun lisp-eval-defun-and-go ()
"Send the current defun to the inferior Lisp, and switch to its buffer."
1991-05-13 21:21:58 +00:00
(interactive)
1992-06-24 05:09:26 +00:00
(lisp-eval-defun t))
1991-05-13 21:21:58 +00:00
(defun lisp-compile-region-and-go (start end)
"Compile the current region in the inferior Lisp, and switch to its buffer."
1991-05-13 21:21:58 +00:00
(interactive "r")
1992-06-24 05:09:26 +00:00
(lisp-compile-region start end t))
1991-05-13 21:21:58 +00:00
(defun lisp-compile-defun-and-go ()
"Compile the current defun in the inferior Lisp, and switch to its buffer."
1991-05-13 21:21:58 +00:00
(interactive)
1992-06-24 05:09:26 +00:00
(lisp-compile-defun t))
1991-05-13 21:21:58 +00:00
;;; A version of the form in H. Shevis' soar-mode.el package. Less robust.
1992-07-21 23:40:16 +00:00
;;; (defun lisp-compile-sexp (start end)
;;; "Compile the s-expression bounded by START and END in the inferior lisp.
;;; If the sexp isn't a DEFUN form, it is evaluated instead."
;;; (cond ((looking-at "(defun\\s +")
;;; (goto-char (match-end 0))
;;; (let ((name-start (point)))
;;; (forward-sexp 1)
;;; (process-send-string "inferior-lisp"
;;; (format "(compile '%s (lambda "
1992-07-21 23:40:16 +00:00
;;; (buffer-substring name-start
;;; (point)))))
;;; (let ((body-start (point)))
;;; (goto-char start) (forward-sexp 1) ; Can't use end-of-defun.
;;; (process-send-region "inferior-lisp"
;;; (buffer-substring body-start (point))))
;;; (process-send-string "inferior-lisp" ")\n"))
;;; (t (lisp-eval-region start end)))))
;;;
1992-07-21 23:40:16 +00:00
;;; (defun lisp-compile-region (start end)
;;; "Each s-expression in the current region is compiled (if a DEFUN)
;;; or evaluated (if not) in the inferior lisp."
;;; (interactive "r")
;;; (save-excursion
;;; (goto-char start) (end-of-defun) (beginning-of-defun) ; error check
;;; (if (< (point) start) (error "Region begins in middle of defun"))
1992-07-21 23:40:16 +00:00
;;; (goto-char start)
;;; (let ((s start))
;;; (end-of-defun)
;;; (while (<= (point) end) ; Zip through
;;; (lisp-compile-sexp s (point)) ; compiling up defun-sized chunks.
;;; (setq s (point))
;;; (end-of-defun))
;;; (if (< s end) (lisp-compile-sexp s end)))))
;;;
1991-05-13 21:21:58 +00:00
;;; End of HS-style code
(defvar lisp-prev-l/c-dir/file nil
"Record last directory and file used in loading or compiling.
This holds a cons cell of the form `(DIRECTORY . FILE)'
describing the last `lisp-load-file' or `lisp-compile-file' command.")
1991-05-13 21:21:58 +00:00
(defcustom lisp-source-modes '(lisp-mode)
"Used to determine if a buffer contains Lisp source code.
1991-05-13 21:21:58 +00:00
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."
:type '(repeat symbol))
1991-05-13 21:21:58 +00:00
(defun lisp-load-file (file-name)
"Load a Lisp file into the inferior Lisp process."
Replace "(default %s)" with 'format-prompt' * lisp/cmuscheme.el (scheme-load-file, scheme-compile-file): * lisp/comint.el (comint-get-source): * lisp/emulation/viper-cmd.el (viper-quote-region, viper-kill-buffer) (viper-query-replace, viper-read-string-with-history): * lisp/eshell/esh-mode.el (eshell-find-tag): * lisp/gnus/gnus-sum.el (gnus-articles-to-read) (gnus-summary-search-article-forward) (gnus-summary-search-article-backward): * lisp/international/mule-cmds.el (set-input-method, toggle-input-method) (describe-input-method, set-language-environment) (describe-language-environment): * lisp/mh-e/mh-gnus.el (mh-mml-minibuffer-read-disposition): * lisp/mh-e/mh-letter.el (mh-insert-letter): * lisp/mh-e/mh-mime.el (mh-display-with-external-viewer) (mh-mime-save-parts, mh-mh-forward-message) (mh-mml-query-cryptographic-method, mh-minibuffer-read-type): * lisp/mh-e/mh-seq.el (mh-read-seq, mh-read-range): * lisp/mh-e/mh-utils.el (mh-prompt-for-folder): * lisp/progmodes/etags.el (find-tag-tag): (find-tag-noselect, find-tag, find-tag-other-window) (find-tag-other-frame, find-tag-regexp): * lisp/progmodes/idlwave.el (idlwave-find-module): * lisp/progmodes/inf-lisp.el (lisp-load-file, lisp-compile-file): * lisp/progmodes/tcl.el (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/xref.el (xref--read-identifier): (xref-find-definitions, xref-find-definitions-other-window) (xref-find-definitions-other-frame, xref-find-references): * lisp/ses.el (ses-read-printer): (ses-read-cell-printer, ses-read-column-printer) (ses-read-default-printer, ses-define-local-printer): * lisp/subr.el (read-number): * lisp/term.el (term-get-source): * src/minibuf.c (read-buffer): Remove prompt suffix and use 'format-prompt'. * lisp/minibuffer.el (format-prompt): Ignore DEFAULT empty strings (bug#47286).
2021-03-24 10:31:31 +01:00
(interactive (comint-get-source "Load Lisp file" lisp-prev-l/c-dir/file
2001-12-20 18:59:32 +00:00
lisp-source-modes nil)) ; nil because LOAD
1992-07-21 23:40:16 +00:00
; doesn't need an exact name
1991-05-13 21:21:58 +00:00
(comint-check-source file-name) ; Check to see if buffer needs saved.
(setq lisp-prev-l/c-dir/file (cons (file-name-directory file-name)
(file-name-nondirectory file-name)))
1992-07-21 23:40:16 +00:00
(comint-send-string (inferior-lisp-proc)
1992-06-24 05:09:26 +00:00
(format inferior-lisp-load-command file-name))
(switch-to-lisp t))
1991-05-13 21:21:58 +00:00
(defun lisp-compile-file (file-name)
"Compile a Lisp file in the inferior Lisp process."
Replace "(default %s)" with 'format-prompt' * lisp/cmuscheme.el (scheme-load-file, scheme-compile-file): * lisp/comint.el (comint-get-source): * lisp/emulation/viper-cmd.el (viper-quote-region, viper-kill-buffer) (viper-query-replace, viper-read-string-with-history): * lisp/eshell/esh-mode.el (eshell-find-tag): * lisp/gnus/gnus-sum.el (gnus-articles-to-read) (gnus-summary-search-article-forward) (gnus-summary-search-article-backward): * lisp/international/mule-cmds.el (set-input-method, toggle-input-method) (describe-input-method, set-language-environment) (describe-language-environment): * lisp/mh-e/mh-gnus.el (mh-mml-minibuffer-read-disposition): * lisp/mh-e/mh-letter.el (mh-insert-letter): * lisp/mh-e/mh-mime.el (mh-display-with-external-viewer) (mh-mime-save-parts, mh-mh-forward-message) (mh-mml-query-cryptographic-method, mh-minibuffer-read-type): * lisp/mh-e/mh-seq.el (mh-read-seq, mh-read-range): * lisp/mh-e/mh-utils.el (mh-prompt-for-folder): * lisp/progmodes/etags.el (find-tag-tag): (find-tag-noselect, find-tag, find-tag-other-window) (find-tag-other-frame, find-tag-regexp): * lisp/progmodes/idlwave.el (idlwave-find-module): * lisp/progmodes/inf-lisp.el (lisp-load-file, lisp-compile-file): * lisp/progmodes/tcl.el (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/xref.el (xref--read-identifier): (xref-find-definitions, xref-find-definitions-other-window) (xref-find-definitions-other-frame, xref-find-references): * lisp/ses.el (ses-read-printer): (ses-read-cell-printer, ses-read-column-printer) (ses-read-default-printer, ses-define-local-printer): * lisp/subr.el (read-number): * lisp/term.el (term-get-source): * src/minibuf.c (read-buffer): Remove prompt suffix and use 'format-prompt'. * lisp/minibuffer.el (format-prompt): Ignore DEFAULT empty strings (bug#47286).
2021-03-24 10:31:31 +01:00
(interactive (comint-get-source "Compile Lisp file" lisp-prev-l/c-dir/file
2001-12-20 18:59:32 +00:00
lisp-source-modes nil)) ; nil = don't need
1992-07-21 23:40:16 +00:00
; suffix .lisp
1991-05-13 21:21:58 +00:00
(comint-check-source file-name) ; Check to see if buffer needs saved.
(setq lisp-prev-l/c-dir/file (cons (file-name-directory file-name)
(file-name-nondirectory file-name)))
1992-07-21 23:40:16 +00:00
(comint-send-string (inferior-lisp-proc) (concat "(compile-file \""
file-name
"\")\n"))
1992-06-24 05:09:26 +00:00
(switch-to-lisp t))
1991-05-13 21:21:58 +00:00
;;; Documentation functions: function doc, var doc, arglist, and
;;; describe symbol.
;;; ===========================================================================
;;; Command strings
;;; ===============
(defvar lisp-function-doc-command
"(let ((fn '%s))
(format t \"Documentation for ~a:~&~a\"
fn (documentation fn 'function))
(values))\n"
"Command to query inferior Lisp for a function's documentation.")
(defvar lisp-var-doc-command
"(let ((v '%s))
(format t \"Documentation for ~a:~&~a\"
v (documentation v 'variable))
(values))\n"
"Command to query inferior Lisp for a variable's documentation.")
(defvar lisp-arglist-command
"(let ((fn '%s))
(format t \"Arglist for ~a: ~a\" fn (arglist fn))
(values))\n"
"Command to query inferior Lisp for a function's arglist.")
(defvar lisp-describe-sym-command
"(describe '%s)\n"
"Command to query inferior Lisp for a variable's documentation.")
;;; Ancillary functions
;;; ===================
;;; Reads a string from the user.
(defun lisp-symprompt (prompt default)
Use `format-prompt' when prompting with default values * lisp/woman.el (woman-file-name): * lisp/wid-edit.el (widget-file-prompt-value) (widget-coding-system-prompt-value): * lisp/w32-fns.el (w32-set-system-coding-system): * lisp/vc/vc.el (vc-print-root-log): * lisp/vc/vc-annotate.el (vc-annotate): * lisp/vc/emerge.el (emerge-read-file-name): * lisp/vc/ediff.el (ediff-directories) (ediff-directory-revisions, ediff-directories3) (ediff-merge-directories, ) (ediff-merge-directories-with-ancestor) (ediff-merge-directory-revisions) (ediff-merge-directory-revisions-with-ancestor) (ediff-merge-revisions, ediff-merge-revisions-with-ancestor) (ediff-revision): * lisp/vc/ediff-util.el (ediff-toggle-regexp-match): * lisp/vc/ediff-mult.el (ediff-filegroup-action): * lisp/vc/add-log.el (prompt-for-change-log-name): * lisp/textmodes/table.el (table-insert-row-column) (table-span-cell, table-split-cell-horizontally) (table-split-cell, table-justify, table-generate-source) (table-insert-sequence, table-capture) (table--read-from-minibuffer, table--query-justification): * lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help): * lisp/textmodes/reftex-ref.el (reftex-goto-label): * lisp/textmodes/refer.el (refer-get-bib-files): * lisp/textmodes/css-mode.el (css-lookup-symbol): * lisp/term.el (serial-read-name, serial-read-speed): * lisp/speedbar.el (speedbar-change-initial-expansion-list): * lisp/simple.el (previous-matching-history-element) (set-variable): * lisp/ses.el (ses-read-cell, ses-set-column-width): * lisp/replace.el (query-replace-read-from) (occur-read-primary-args): * lisp/rect.el (string-rectangle, string-insert-rectangle): * lisp/progmodes/tcl.el (tcl-help-on-word): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/python.el (python-eldoc-at-point): * lisp/progmodes/octave.el (octave-completing-read) (octave-update-function-file-comment, octave-insert-defun): * lisp/progmodes/inf-lisp.el (lisp-symprompt): * lisp/progmodes/cperl-mode.el (cperl-info-on-command) (cperl-perldoc): * lisp/progmodes/compile.el (compilation-find-file): * lisp/net/rcirc.el (rcirc-prompt-for-encryption): * lisp/net/eww.el (eww): * lisp/net/browse-url.el (browse-url-with-browser-kind): * lisp/man.el (man): * lisp/mail/sendmail.el (sendmail-query-user-about-smtp): * lisp/mail/mailalias.el (build-mail-aliases): * lisp/mail/mailabbrev.el (merge-mail-abbrevs) (rebuild-mail-abbrevs): * lisp/locate.el (locate-prompt-for-search-string): * lisp/isearch.el (isearch-occur): * lisp/international/ogonek.el (ogonek-read-encoding) (ogonek-read-prefix): * lisp/international/mule.el (read-buffer-file-coding-system) (set-terminal-coding-system, set-keyboard-coding-system) (set-next-selection-coding-system, recode-region): * lisp/international/mule-cmds.el () (universal-coding-system-argument, search-unencodable-char) (select-safe-coding-system-interactively): * lisp/info.el (Info-search, Info-search-backward, Info-menu): * lisp/info-look.el (info-lookup-interactive-arguments): * lisp/imenu.el (imenu--completion-buffer): * lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode): * lisp/hi-lock.el (hi-lock-unface-buffer) (hi-lock-read-face-name): * lisp/help.el (view-emacs-news, where-is): * lisp/help-fns.el (describe-variable, describe-symbol) (describe-keymap): * lisp/gnus/mm-decode.el (mm-save-part): * lisp/gnus/gnus-sum.el (gnus-summary-browse-url): * lisp/gnus/gnus-group.el (gnus-group--read-bug-ids) (gnus-group-set-current-level): * lisp/frame.el (make-frame-on-monitor) (close-display-connection, select-frame-by-name): * lisp/format.el (format-encode-buffer, format-encode-region): * lisp/files.el (recode-file-name): * lisp/files-x.el (read-file-local-variable) (read-file-local-variable-value, ) (read-file-local-variable-mode): * lisp/ffap.el (ffap-menu-ask): * lisp/faces.el (face-read-string): * lisp/facemenu.el (facemenu-set-charset): * lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): * lisp/emulation/edt-mapper.el (edt-mapper): * lisp/emacs-lisp/trace.el (trace--read-args) (trace-function-foreground, trace-function-background): * lisp/emacs-lisp/smie.el (smie-config-set-indent): * lisp/emacs-lisp/re-builder.el (reb-change-syntax): * lisp/emacs-lisp/package.el (describe-package): * lisp/emacs-lisp/find-func.el (read-library-name) (find-function-read): * lisp/emacs-lisp/ert.el (ert-read-test-name) (ert-run-tests-interactively): * lisp/emacs-lisp/disass.el (disassemble): * lisp/emacs-lisp/debug.el (debug-on-entry) (debug-on-variable-change): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-read-regexp): * lisp/dired-x.el (dired--mark-suffix-interactive-spec): * lisp/dired-aux.el (dired-diff): * lisp/cus-edit.el (custom-variable-prompt, customize-mode) (customize-changed-options): * lisp/completion.el (interactive-completion-string-reader): * lisp/calendar/timeclock.el (timeclock-ask-for-project): * lisp/calc/calcalg3.el (calc-get-fit-variables): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-bin.el (calc-word-size): * lisp/bookmark.el (bookmark-set-internal): * lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for prompting (bug#12443).
2020-09-06 16:56:44 +02:00
(list (let ((ans (read-string (format-prompt prompt default))))
1991-05-13 21:21:58 +00:00
(if (zerop (length ans)) default ans))))
;;; Adapted from function-called-at-point in help.el.
(defun lisp-fn-called-at-pt ()
lisp/*.el: Fix typos and improve some docstrings * lisp/auth-source.el (auth-source-backend-parse-parameters) (auth-source-search-collection) (auth-source-secrets-listify-pattern) (auth-source--decode-octal-string, auth-source-plstore-search): * lisp/registry.el (registry-lookup) (registry-lookup-breaks-before-lexbind) (registry-lookup-secondary, registry-lookup-secondary-value) (registry-search, registry-delete, registry-size, registry-full) (registry-insert, registry-reindex, registry-prune) (registry-collect-prune-candidates): * lisp/subr.el (nbutlast, process-live-p): * lisp/tab-bar.el (tab-bar-list): * lisp/cedet/ede/linux.el (ede-linux--get-archs) (ede-linux--include-path, ede-linux-load): * lisp/erc/erc-log.el (erc-log-all-but-server-buffers): * lisp/erc/erc-pcomplete.el (pcomplete-erc-commands) (pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks) (pcomplete-erc-all-nicks, pcomplete-erc-channels) (pcomplete-erc-command-name, pcomplete-erc-parse-arguments): * lisp/eshell/em-term.el (eshell-visual-command-p): * lisp/gnus/gnus-cache.el (gnus-cache-fully-p): * lisp/gnus/nnmail.el (nnmail-get-active) (nnmail-fancy-expiry-target): * lisp/mail/mail-utils.el (mail-string-delete): * lisp/mail/supercite.el (sc-hdr, sc-valid-index-p): * lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p): * lisp/net/nsm.el (nsm-save-fingerprint-maybe) (nsm-network-same-subnet, nsm-should-check): * lisp/net/rcirc.el (rcirc-looking-at-input): * lisp/net/tramp-cache.el (tramp-get-hash-table): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-smb.el (tramp-smb-get-share) (tramp-smb-get-localname, tramp-smb-read-file-entry) (tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services) (zeroconf-get-host, zeroconf-get-domain) (zeroconf-get-host-domain): * lisp/nxml/rng-xsd.el (rng-xsd-compile) (rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time): * lisp/obsolete/erc-hecomplete.el (erc-hecomplete) (erc-command-list, erc-complete-at-prompt): * lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl): * lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic) (org-babel--variable-assignments:bash_array) (org-babel--variable-assignments:bash_assoc) (org-babel--variable-assignments:bash): * lisp/org/org-clock.el (org-day-of-week): * lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p): * lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr) (gud-prev-expr, gud-next-expr): * lisp/textmodes/table.el (table--at-cell-p, table--probe-cell) (table--get-cell-justify-property) (table--get-cell-valign-property) (table--put-cell-justify-property) (table--put-cell-valign-property): Fix typos. * lisp/so-long.el (fboundp): Doc fix. (so-long-mode-line-info, so-long-mode) (so-long--check-header-modes): Fix typos. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-mouse-click-get-word): Fix typos. (viper-mouse-click-search-word): Doc fix. * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): Fix typos. (erc-decode-string-from-target, define-erc-response-handler): Refill docstring. * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo. (erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file): Doc fixes. * lisp/erc/erc-networks.el (erc-network-name): Fix typo. (erc-determine-network): Refill docstring. * lisp/net/dbus.el (dbus-list-hash-table) (dbus-string-to-byte-array, dbus-byte-array-to-string) (dbus-check-event): Fix typos. (dbus-introspect-get-property): Doc fix. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Rename ARGS to ARGUMENTS. Doc fix. (tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command) (tramp-adb-find-test-command): Fix typos. * lisp/net/tramp.el (tramp-set-completion-function) (tramp-get-completion-function) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-get-inode, tramp-get-device, tramp-mode-string-to-int) (tramp-call-process, tramp-call-process-region) (tramp-process-lines): Fix typos. (tramp-interrupt-process): Doc fix. * lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name) (org-babel-named-data-regexp-for-name): Doc fix. (org-babel-src-block-names, org-babel-result-names): Fix typos. * lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix. (lisp-fn-called-at-pt): Fix typo. * lisp/progmodes/xref.el (xref-backend-identifier-at-point): Doc fix. (xref-backend-identifier-completion-table): Fix typo.
2019-10-20 12:12:27 +02:00
"Return the name of the function called in the current call.
The value is nil if it can't find one."
1991-05-13 21:21:58 +00:00
(condition-case nil
(save-excursion
(save-restriction
(narrow-to-region (max (point-min) (- (point) 1000)) (point-max))
(backward-up-list 1)
(forward-char 1)
(let ((obj (read (current-buffer))))
(and (symbolp obj) obj))))
(error nil)))
;;; Adapted from variable-at-point in help.el.
(defun lisp-var-at-pt ()
(condition-case ()
(save-excursion
(forward-sexp -1)
(skip-chars-forward "'")
(let ((obj (read (current-buffer))))
(and (symbolp obj) obj)))
(error nil)))
;;; Documentation functions: fn and var doc, arglist, and symbol describe.
;;; ======================================================================
(defun lisp-show-function-documentation (fn)
"Send a command to the inferior Lisp to give documentation for function FN.
See variable `lisp-function-doc-command'."
1991-05-13 21:21:58 +00:00
(interactive (lisp-symprompt "Function doc" (lisp-fn-called-at-pt)))
1992-07-21 23:40:16 +00:00
(comint-proc-query (inferior-lisp-proc)
(format lisp-function-doc-command fn)))
1991-05-13 21:21:58 +00:00
(defun lisp-show-variable-documentation (var)
"Send a command to the inferior Lisp to give documentation for variable VAR.
See variable `lisp-var-doc-command'."
1991-05-13 21:21:58 +00:00
(interactive (lisp-symprompt "Variable doc" (lisp-var-at-pt)))
1992-07-21 23:40:16 +00:00
(comint-proc-query (inferior-lisp-proc) (format lisp-var-doc-command var)))
1991-05-13 21:21:58 +00:00
(defun lisp-show-arglist (fn)
"Send a query to the inferior Lisp for the arglist for function FN.
See variable `lisp-arglist-command'."
1991-05-13 21:21:58 +00:00
(interactive (lisp-symprompt "Arglist" (lisp-fn-called-at-pt)))
1992-07-21 23:40:16 +00:00
(comint-proc-query (inferior-lisp-proc) (format lisp-arglist-command fn)))
1991-05-13 21:21:58 +00:00
(defun lisp-describe-sym (sym)
"Send a command to the inferior Lisp to describe symbol SYM.
See variable `lisp-describe-sym-command'."
1991-05-13 21:21:58 +00:00
(interactive (lisp-symprompt "Describe" (lisp-var-at-pt)))
1992-07-21 23:40:16 +00:00
(comint-proc-query (inferior-lisp-proc)
(format lisp-describe-sym-command sym)))
1991-05-13 21:21:58 +00:00
;; "Returns the current inferior Lisp process.
;; See variable `inferior-lisp-buffer'."
1992-07-21 23:40:16 +00:00
(defun inferior-lisp-proc ()
Derive from prog-mode, use derived-mode-p, and fix up various minor style issues in lisp/progmodes. * lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init) (vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable -> make-local-hook. * lisp/progmodes/sh-script.el (sh-require-final-newline): Remove. (sh-set-shell): Don't set require-final-newline since it's already done by prog-mode. * lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column since we never set it. * lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation): Use read-string and standard prompt. * lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration. * lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl. (meta-common-mode-syntax-table): Rename from meta-mode-syntax-table. (meta-common-mode-map): Rename from meta-mode-map. Remove C-m binding, which is a user preference, not mode specific. (meta-common-mode): New major mode; replace meta-common-initialization. * lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing around with font-lock. * lisp/progmodes/etags.el (select-tags-table-mode): Derive from special-mode. * lisp/progmodes/octave-mod.el (octave-mode): * lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode) (gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode) (gdb-frames-mode, gdb-locals-mode, gdb-registers-mode): Let define-derived-mode do its job. * lisp/progmodes/cpp.el (cpp-edit-mode-map): Move initialization into declaration. (cpp-edit-mode): Use define-derived-mode. (cpp-edit-load): Use derived-mode-p. * lisp/progmodes/mixal-mode.el (mixal-mode): * lisp/progmodes/f90.el (f90-mode): * lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting require-final-newline since prog-mode does it already. * lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string. * lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup. * lisp/progmodes/antlr-mode.el: Require cc-mode upfront. (antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in the declaration. (antlr-directory-dependencies, antlr-show-makefile-rules): Use derived-mode-p. (antlr-language-option): Don't assume point-min==1. (antlr-mode): Use define-derived-mode. * lisp/progmodes/ada-mode.el: Use derived-mode-p. (ada-mode): Use define-derived-mode. Use hack-local-variables-hook. * lisp/progmodes/vhdl-mode.el (vhdl-mode): * lisp/progmodes/verilog-mode.el (verilog-mode): * lisp/progmodes/vera-mode.el (vera-mode): * lisp/progmodes/sql.el (sql-mode): * lisp/progmodes/scheme.el (scheme-mode): * lisp/progmodes/perl-mode.el (perl-mode): * lisp/progmodes/octave-inf.el (inferior-octave-mode): * lisp/progmodes/autoconf.el (autoconf-mode): * lisp/progmodes/m4-mode.el (m4-mode): * lisp/progmodes/inf-lisp.el (inferior-lisp-mode): * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/icon.el (icon-mode): * lisp/progmodes/idlw-help.el (idlwave-help-mode): * lisp/progmodes/dcl-mode.el (dcl-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode) (ebrowse-member-mode, ebrowse-electric-position-mode): Use define-derived-mode. * lisp/progmodes/xscheme.el (xscheme-start) (local-set-scheme-interaction-buffer, scheme-interaction-mode): * lisp/progmodes/which-func.el (which-function): * lisp/progmodes/vhdl-mode.el (vhdl-set-style): * lisp/progmodes/verilog-mode.el (verilog-set-compile-command) (verilog-modify-compile-command, verilog-error-regexp-add-xemacs) (verilog-set-define, verilog-auto-reeval-locals): * lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode): * lisp/progmodes/simula.el (simula-mode): * lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode): * lisp/progmodes/python.el (python-check, python-mode): * lisp/progmodes/prolog.el (prolog-mode-variables): * lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions): * lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame): * lisp/progmodes/delphi.el (delphi-mode): * lisp/progmodes/cc-styles.el (c-setup-paragraph-variables): * lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init) (c-font-lock-init): Move make-local-variable to their setq. * lisp/progmodes/xscheme.el (exit-scheme-interaction-mode) (xscheme-enter-interaction-mode, xscheme-enter-debugger-mode) (xscheme-debugger-mode-p, xscheme-send-string-1): * lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word) (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/ps-mode.el (ps-run-running): * lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint): * lisp/progmodes/js.el (js--get-all-known-symbols): * lisp/progmodes/inf-lisp.el (inferior-lisp-proc): * lisp/progmodes/idlwave.el (idlwave-beginning-of-statement) (idlwave-template, idlwave-update-buffer-routine-info) (idlwave-update-current-buffer-info) (idlwave-get-routine-info-from-buffers, idlwave-choose) (idlwave-scan-class-info, idlwave-fix-keywords) (idlwave-list-buffer-load-path-shadows): * lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add) (idlwave-toolbar-remove): * lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action) (idlwave-shell-file-name, idlwave-shell-electric-debug-all-off) (idlwave-shell-menu-def): * lisp/progmodes/idlw-complete-structtag.el (idlwave-prepare-structure-tag-completion): * lisp/progmodes/gud.el (gud-set-buffer): * lisp/progmodes/f90.el (f90-backslash-not-special): * lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 15:00:25 -05:00
(let ((proc (get-buffer-process (if (derived-mode-p 'inferior-lisp-mode)
1991-05-13 21:21:58 +00:00
(current-buffer)
1992-07-21 23:40:16 +00:00
inferior-lisp-buffer))))
1991-05-13 21:21:58 +00:00
(or proc
(error "No Lisp subprocess; see variable `inferior-lisp-buffer'"))))
1991-05-13 21:21:58 +00:00
;; Obsolete.
(defvar inferior-lisp-load-hook nil
"This hook is run when the library `inf-lisp' is loaded.")
(make-obsolete-variable 'inferior-lisp-load-hook
"use `with-eval-after-load' instead." "28.1")
1992-07-21 23:40:16 +00:00
(run-hooks 'inferior-lisp-load-hook)
1991-05-13 21:21:58 +00:00
;;; CHANGE LOG
;;; ===========================================================================
1992-07-21 23:40:16 +00:00
;;; 7/21/92 Jim Blandy
;;; - Changed all uses of the cmulisp name or prefix to inferior-lisp;
;;; this is now the official inferior lisp package. Use the global
;;; ChangeLog from now on.
1991-05-13 21:21:58 +00:00
;;; 5/24/90 Olin
;;; - Split cmulisp and cmushell modes into separate files.
1991-05-13 21:21:58 +00:00
;;; Not only is this a good idea, it's apparently the way it'll be rel 19.
;;; - Upgraded process sends to use comint-send-string instead of
;;; process-send-string.
;;; - Explicit references to process "cmulisp" have been replaced with
;;; (cmulisp-proc). This allows better handling of multiple process bufs.
;;; - Added process query and var/function/symbol documentation
;;; commands. Based on code written by Douglas Roberts.
;;; - Added lisp-eval-last-sexp, bound to C-x C-e.
;;;
;;; 9/20/90 Olin
;;; Added a save-restriction to lisp-fn-called-at-pt. This bug and fix
;;; reported by Lennart Staflin.
;;;
;;; 3/12/90 Olin
;;; - lisp-load-file and lisp-compile-file no longer switch-to-lisp.
;;; Tale suggested this.
1992-06-24 05:09:26 +00:00
;;; - Reversed this decision 7/15/91. You need the visual feedback.
;;;
;;; 7/25/91 Olin
;;; Changed all keybindings of the form C-c <letter>. These are
;;; supposed to be reserved for the user to bind. This affected
;;; mainly the compile/eval-defun/region[-and-go] commands.
2015-06-15 21:24:24 -04:00
;;; This was painful, but necessary to adhere to the Emacs standard.
;;; For some backwards compatibility, see the
1992-06-24 05:09:26 +00:00
;;; cmulisp-install-letter-bindings
;;; function.
;;;
;;; 8/2/91 Olin
;;; - The lisp-compile/eval-defun/region commands now take a prefix arg,
;;; which means switch-to-lisp after sending the text to the Lisp process.
;;; This obsoletes all the -and-go commands. The -and-go commands are
;;; kept around for historical reasons, and because the user can bind
;;; them to key sequences shorter than C-u C-c C-<letter>.
;;; - If M-x cmulisp is invoked with a prefix arg, it allows you to
;;; edit the command line.
1992-03-16 20:39:07 +00:00
1992-07-21 23:40:16 +00:00
(provide 'inf-lisp)
1992-03-16 20:39:07 +00:00
1992-07-21 23:40:16 +00:00
;;; inf-lisp.el ends here