;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:52 2007 ;;; from file /home/cyd/emacs/lisp/ielm.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`ielm.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310%\207" [require comint pp custom-declare-group ielm nil "Interaction mode for Emacs Lisp." :group lisp] 6) #@39 *If non-nil, IELM will beep on error. (custom-declare-variable 'ielm-noisy 't '(#$ . -724) :type 'boolean :group 'ielm) #@1199 If non-nil, the IELM prompt is read only. The read only region includes the newline before the prompt. Setting this variable does not affect existing IELM runs. This works by setting the buffer-local value of `comint-prompt-read-only'. Setting that value directly affects new prompts in the current buffer. If this option is enabled, then the safe way to temporarily override the read-only-ness of ielm prompts is to call `comint-kill-whole-line' or `comint-kill-region' with no narrowing in effect. This way you will be certain that none of the remaining prompts will be accidentally messed up. You may wish to put something like the following in your `.emacs' file: (add-hook 'ielm-mode-hook '(lambda () (define-key ielm-map "\C-w" 'comint-kill-region) (define-key ielm-map [C-S-backspace] 'comint-kill-whole-line))) If you set `comint-prompt-read-only' to t, you might wish to use `comint-mode-hook' and `comint-mode-map' instead of `ielm-mode-hook' and `ielm-map'. That will affect all comint buffers, including ielm buffers. If you sometimes use ielm on text-only terminals or with `emacs -nw', you might wish to use another binding for `comint-kill-whole-line'. (custom-declare-variable 'ielm-prompt-read-only 't '(#$ . 852) :type 'boolean :group 'ielm :version "22.1") #@674 Prompt used in IELM. Setting this variable does not affect existing IELM runs. Interrupting the IELM process with \\[comint-interrupt-subjob], and then restarting it using \[ielm], makes the then current default value affect _new_ prompts. Unless the new prompt differs only in text properties from the old one, IELM will no longer recognize the old prompts. However, executing \[ielm] does not update the prompt of an *ielm* buffer with a running process. For IELM buffers that are not called `*ielm*', you can execute \[inferior-emacs-lisp-mode] in that IELM buffer to update the value, for new prompts. This works even if the buffer has a running process. (custom-declare-variable 'ielm-prompt '"ELISP> " '(#$ . 2165) :type 'string :group 'ielm) #@213 Stored value of `ielm-prompt' in the current IELM buffer. This is an internal variable used by IELM. Its purpose is to prevent a running IELM process from being messed up when the user customizes `ielm-prompt'. (defvar ielm-prompt-internal "ELISP> " (#$ . 2935)) #@231 *Controls whether \\[ielm-return] has intelligent behavior in IELM. If non-nil, \[ielm-return] evaluates input for complete sexps, or inserts a newline and indents for incomplete sexps. If nil, always inserts newlines. (custom-declare-variable 'ielm-dynamic-return 't '(#$ . -3206) :type 'boolean :group 'ielm) #@321 *Force multiline inputs to start from column zero? If non-nil, after entering the first line of an incomplete sexp, a newline will be inserted after the prompt, moving the input to the next line. This gives more frame width for large indented sexps, and allows functions such as `edebug-defun' to work with such inputs. (custom-declare-variable 'ielm-dynamic-multiline-inputs 't '(#$ . -3535) :type 'boolean :group 'ielm) #@69 *Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started. (custom-declare-variable 'ielm-mode-hook 'nil '(#$ . -3963) :options '(turn-on-eldoc-mode) :type 'hook :group 'ielm) #@38 Most recent value evaluated in IELM. (defvar * nil (#$ . 4154)) #@45 Second-most-recent value evaluated in IELM. (defvar ** nil (#$ . 4224)) #@44 Third-most-recent value evaluated in IELM. (defvar *** nil (#$ . 4302)) #@46 Match data saved at the end of last command. (defvar ielm-match-data nil (#$ . 4380)) #@322 During IELM evaluation, most recent value evaluated in IELM. Normally identical to `*'. However, if the working buffer is an IELM buffer, distinct from the process buffer, then `*' gives the value in the working buffer, `*1' the value in the process buffer. The intended value is only accessible during IELM evaluation. (defvar *1 nil (#$ . 4473)) #@331 During IELM evaluation, second-most-recent value evaluated in IELM. Normally identical to `**'. However, if the working buffer is an IELM buffer, distinct from the process buffer, then `**' gives the value in the working buffer, `*2' the value in the process buffer. The intended value is only accessible during IELM evaluation. (defvar *2 nil (#$ . 4829)) #@332 During IELM evaluation, third-most-recent value evaluated in IELM. Normally identical to `***'. However, if the working buffer is an IELM buffer, distinct from the process buffer, then `***' gives the value in the working buffer, `*3' the value in the process buffer. The intended value is only accessible during IELM evaluation. (defvar *3 nil (#$ . 5194)) #@78 Buffer in which IELM sexps will be evaluated. This variable is buffer-local. (defvar ielm-working-buffer nil (#$ . 5559)) #@42 Message to display when IELM is started. (defvar ielm-header "*** Welcome to IELM *** Type (describe-mode) for help.\n" (#$ . 5687)) (byte-code "\301B\304\301!\204\305\301\306\"\210 \204e\307\310\n\"\203%\311 \312 \"\210\202)\313 B\314 \315\316#\210\314 \317\320#\210\314 \321\322#\210\314 \323\324#\210\314 \325\326#\210\314 \327\330#\210\314 \331\332#\210\314 \333\334#\210\314 \335\336#\210\314 \337\340#\210\306\207" [current-load-list ielm-map emacs-version comint-mode-map default-boundp set-default nil string-match "Lucid" make-sparse-keymap set-keymap-parent keymap define-key " " comint-dynamic-complete " " ielm-return "\n" ielm-send-input "" eval-defun " " lisp-complete-symbol "" indent-sexp "" backward-delete-char-untabify "" ielm-change-working-buffer "" ielm-display-working-buffer "" ielm-print-working-buffer] 4) #@54 Additional expressions to highlight in ielm buffers. (defvar ielm-font-lock-keywords '(("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)" (1 font-lock-comment-face) (2 font-lock-constant-face))) (#$ . 6548)) #@48 Possibly indent the current line as Lisp code. (defalias 'ielm-tab #[nil "h\300=\204 hz\301=\205\302 \210\303\207" [10 32 ielm-indent-line t] 2 (#$ . 6754) nil]) #@40 Complete the Lisp symbol before point. (defalias 'ielm-complete-symbol #[nil "\303 \304\305!\211\205\303 !\306 \210\303 U?\206* \203'\n\303 !U?\202*\304\305!+\207" [btick cbuffer ctick buffer-modified-tick get-buffer "*Completions*" lisp-complete-symbol] 4 (#$ . 6925)]) #@61 Dynamically complete filename before point, if in a string. (defalias 'ielm-complete-filename #[nil "\301\302`\"8\205 \303 \207" [comint-last-input-start 3 parse-partial-sexp comint-dynamic-complete-filename] 4 (#$ . 7211)]) #@66 Indent the current line as Lisp code if it is not a prompt line. (defalias 'ielm-indent-line #[nil "\212\300 \210n)\205 \301 \207" [comint-bol lisp-indent-line] 1 (#$ . 7444)]) #@64 Print the current IELM working buffer's name in the echo area. (defalias 'ielm-print-working-buffer #[nil "\301\302\303!\"\207" [ielm-working-buffer message "The current working buffer is: %s" buffer-name] 4 (#$ . 7628) nil]) #@147 Display the current IELM working buffer. Don't forget that selecting that buffer will change its value of `point' to its value of `window-point'! (defalias 'ielm-display-working-buffer #[nil "\301!\210\302 \207" [ielm-working-buffer display-buffer ielm-print-working-buffer] 2 (#$ . 7862) nil]) #@209 Change the current IELM working buffer to BUF. This is the buffer in which all sexps entered at the IELM prompt are evaluated. You can achieve the same effect with a call to `set-buffer' at the IELM prompt. (defalias 'ielm-change-working-buffer #[(buf) "\302!\206 \303\304!\305 \207" [buf ielm-working-buffer get-buffer error "No such buffer" ielm-print-working-buffer] 2 (#$ . 8165) "bSet working buffer to: "]) #@223 Newline and indent, or evaluate the sexp before the prompt. Complete sexps are evaluated; for incomplete sexps inserts a newline and indents. If however `ielm-dynamic-return' is nil, this always simply inserts a newline. (defalias 'ielm-return #[nil "\203>\212\304\210\305\306 `\")\211@\307W\203!\310 8\204!\311 \202<\n\203:\212\312 \210\313 !)\203:\212\306 b\210\314\307!\210)\315 )\207\314 \207" [ielm-dynamic-return state ielm-dynamic-multiline-inputs comint-prompt-regexp nil parse-partial-sexp ielm-pm 1 3 ielm-send-input beginning-of-line looking-at newline newline-and-indent] 4 (#$ . 8589) nil]) (defalias 'ielm-input-sender #[(proc input) "\211\207" [input ielm-input] 2]) #@54 Evaluate the Emacs Lisp expression after the prompt. (defalias 'ielm-send-input #[nil "\301\302 \210\303!)\207" [ielm-input nil comint-send-input ielm-eval-input] 2 (#$ . 9289) nil]) #@45 Return non-nil if STRING is all whitespace. (defalias 'ielm-is-whitespace #[(string) "\301\230\206\n\302\303\"\207" [string "" string-match "\\`[ \n]+\\'"] 3 (#$ . 9480)]) #@72 Evaluate the Lisp expression IELM-STRING, and pretty-print the result. (defalias 'ielm-eval-input #[(ielm-string) "\306\211\211\211\307\310 #$\311%!\204\257\312\313\314\217\210\f\204n\315!\2040\316\317p\202n\311%#\306O!\203j&'(\306)*+,\320-!\210\212\321\322!.\323\216r.q\210\312\324\325\217\210,\326 -,\202n\327\330\n=\204{\331\332\n\"\210\n b\210\f\204\207\312\333\334\217\210\f\203\240/\203\223\335 \210 \336\f\337R\211 P\202\253'(&' & \340P 0P\341\342 \".\207" [ielm-working-buffer ielm-pmark ielm-wbuf ielm-output ielm-error-type ielm-result nil "" ielm-pm ielm-is-whitespace err (byte-code "\304\305 !\211@A)\304\207" [rout ielm-string ielm-form ielm-pos nil read-from-string] 3) ((error (byte-code "\303!\304\303\207" [err ielm-result ielm-error-type error-message-string "Read error"] 2))) buffer-name "Working buffer has been killed" "IELM Error" set-match-data generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) (byte-code "\306\216 \n\307p!\210 q\210\310\f! p \311\312!\211q\210,\307\207" [*1 *2 *3 *** ** * ((byte-code "\203\301!\210\301\207" [ielm-temp-buffer kill-buffer] 2)) kill-buffer eval generate-new-buffer " *ielm-temp*" ielm-wbuf ielm-form ielm-result ielm-temp-buffer] 4) ((error (byte-code "\303!\304\303\207" [err ielm-result ielm-error-type error-message-string "Eval error"] 2)) (quit (byte-code "\302\303\304\207" [ielm-result ielm-error-type "Quit during evaluation" "Eval error" nil] 1))) match-data "IELM error" "More than one sexp in input" message "current buffer is now: %s" (byte-code "\302 !P\302\207" [ielm-output ielm-result pp-to-string] 3) ((error (byte-code "\302\303\304\207" [ielm-error-type ielm-result "IELM Error" "Error during pretty-printing (bug in pp)" nil] 1)) (quit (byte-code "\302\303\304\207" [ielm-error-type ielm-result "IELM Error" "Quit during pretty-printing" nil] 1))) ding "*** " " *** " "\n" comint-output-filter ielm-process ielm-pos ielm-form ielm-string * ** *** ielm-temp-buffer *3 *2 *1 ielm-match-data #1# ielm-noisy ielm-prompt-internal] 8 (#$ . 9662)]) (defalias 'ielm-process #[nil "\300p!\207" [get-buffer-process] 2]) (defalias 'ielm-pm #[nil "\300\301p!!\207" [process-mark get-buffer-process] 3]) (defalias 'ielm-set-pm #[(pos) "\301\302p!!\303\223\207" [pos process-mark get-buffer-process nil] 3]) (put 'inferior-emacs-lisp-mode 'mode-class 'special) #@2043 Major mode for interactively evaluating Emacs Lisp expressions. Uses the interface provided by `comint-mode' (which see). * \\[ielm-send-input] evaluates the sexp following the prompt. There must be at most one top level sexp per prompt. * \[ielm-return] inserts a newline and indents, or evaluates a complete expression (but see variable `ielm-dynamic-return'). Inputs longer than one line are moved to the line following the prompt (but see variable `ielm-dynamic-multiline-inputs'). * \[comint-dynamic-complete] completes Lisp symbols (or filenames, within strings), or indents the line if there is nothing to complete. The current working buffer may be changed (with a call to `set-buffer', or with \[ielm-change-working-buffer]), and its value is preserved between successive evaluations. In this way, expressions may be evaluated in a different buffer than the *ielm* buffer. By default, its name is shown on the mode line; you can always display it with \[ielm-print-working-buffer], or the buffer itself with \[ielm-display-working-buffer]. During evaluations, the values of the variables `*', `**', and `***' are the results of the previous, second previous and third previous evaluations respectively. If the working buffer is another IELM buffer, then the values in the working buffer are used. The variables `*1', `*2' and `*3', yield the process buffer values. Expressions evaluated by IELM are not subject to `debug-on-quit' or `debug-on-error'. The behavior of IELM may be customized with the following variables: * To stop beeping on error, set `ielm-noisy' to nil. * If you don't like the prompt, you can change it by setting `ielm-prompt'. * If you do not like that the prompt is (by default) read-only, set `ielm-prompt-read-only' to nil. * Set `ielm-dynamic-return' to nil for bindings like `lisp-interaction-mode'. * Entry to this mode runs `comint-mode-hook' and `ielm-mode-hook' (in that order). Customized bindings may be defined in `ielm-map', which currently contains: \{ielm-map} (defalias 'inferior-emacs-lisp-mode #[nil "\306\300!\210\307\310 \210)\311\312 !P\306\303!\210\313\306\304!\210\n\314\3154\306\316!\210\306\317!\210 \306\320!\2105\321\3226\306\323!\210\324\3257\3268\3279\330:!\210\331;!\210\306\332!\210\306\333!\210p\334\306\335!\210\336\306\337!\210\315\306\340!\210\315 \306\341!\210\315!\306\342!\210\315\"\306\343!\210\344#\345p!\204\323\315\346\347\217\210\350\351 \315\"\210db\210\306\352!\210\307*\354ed\355#\210)\356\351 \"\210?\357 \315\223\210\360\361p!\356\"\210\362\363!\207" [delay-mode-hooks ielm-prompt comint-prompt-regexp paragraph-separate paragraph-start comint-input-sender make-local-variable t comint-mode "^" regexp-quote "\\'" ielm-input-sender nil comint-dynamic-complete-functions ielm-prompt-internal comint-prompt-read-only (ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol) ielm-get-old-input comint-completion-addsuffix ("/" . "") inferior-emacs-lisp-mode "IELM" (":%s on " (:eval (buffer-name ielm-working-buffer))) use-local-map set-syntax-table indent-line-function ielm-working-buffer ielm-indent-line fill-paragraph-function lisp-fill-paragraph * ** *** ielm-match-data font-lock-defaults (ielm-font-lock-keywords nil nil ((58 . "w") (45 . "w") (42 . "w"))) comint-check-proc (byte-code "\300\301p\302#\207" [start-process "ielm" "hexl"] 4) ((file-error (byte-code "\300\301p\302#\207" [start-process "ielm" "cat"] 4))) set-process-query-on-exit-flag ielm-process comint-inhibit-carriage-motion ielm-set-pm add-text-properties (rear-nonsticky t field output inhibit-line-move-field-capture t) comint-output-filter ielm-pm set-process-filter get-buffer-process run-mode-hooks ielm-mode-hook comint-process-echoes ielm-prompt-read-only comint-get-old-input major-mode mode-name mode-line-process ielm-map emacs-lisp-mode-syntax-table ielm-header comint-use-prompt-regexp inhibit-read-only comint-last-input-start] 4 (#$ . 12159) nil]) (defalias 'ielm-get-old-input #[nil "\212\301 \210\302!\204\303!\210\304 \210`\305\306!\210`{)\207" [comint-prompt-regexp beginning-of-line looking-at re-search-backward comint-skip-prompt forward-sexp 1] 3]) #@117 Interactively evaluate Emacs Lisp expressions. Switches to the buffer `*ielm*', or creates it if it does not exist. (defalias 'ielm #[nil "\301\302\303!\204r\304\303!q\210\305\306 !\204`\307 \210)\310\303!\210\205&\311!)\207" [old-point nil comint-check-proc "*ielm*" get-buffer-create zerop buffer-size inferior-emacs-lisp-mode pop-to-buffer push-mark] 2 (#$ . 16435) nil]) (provide 'ielm)