`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
`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
(define-key ielm-map \"\\C-w\" 'comint-kill-region)
(define-key ielm-map [C-S-backspace]
'comint-kill-whole-line)))
(define-key ielm-map \"\\C-w\" 'comint-kill-region)
(define-key ielm-map [C-S-backspace]
'comint-kill-whole-line)))
;; Just sets the variable ielm-input, which is in the scope of
;; `ielm-send-input's call.
(setq ielm-input input))
;; Just sets the variable ielm-input, which is in the scope of
;; `ielm-send-input's call.
(setq ielm-input input))
-(defun ielm-eval-input (ielm-string)
- "Evaluate the Lisp expression IELM-STRING, and pretty-print the result."
+(defvar ielm-string)
+(defvar ielm-form)
+(defvar ielm-pos)
+(defvar ielm-result)
+(defvar ielm-error-type)
+(defvar ielm-output)
+(defvar ielm-wbuf)
+(defvar ielm-pmark)
+
+(defun ielm-eval-input (input-string)
+ "Evaluate the Lisp expression INPUT-STRING, and pretty-print the result."
;; This is the function that actually `sends' the input to the
;; `inferior Lisp process'. All comint-send-input does is works out
;; what that input is. What this function does is evaluates that
;; This is the function that actually `sends' the input to the
;; `inferior Lisp process'. All comint-send-input does is works out
;; what that input is. What this function does is evaluates that
;;
;; NOTE: all temporary variables in this function will be in scope
;; during the eval, and so need to have non-clashing names.
;;
;; NOTE: all temporary variables in this function will be in scope
;; during the eval, and so need to have non-clashing names.
ielm-pos ; End posn of parse in string
ielm-result ; Result, or error message
ielm-error-type ; string, nil if no error
ielm-pos ; End posn of parse in string
ielm-result ; Result, or error message
ielm-error-type ; string, nil if no error
;; Self-referential objects cause loops in the printer, so
;; trap quits here. May as well do errors, too
(setq ielm-output (concat ielm-output (pp-to-string ielm-result)))
;; Self-referential objects cause loops in the printer, so
;; trap quits here. May as well do errors, too
(setq ielm-output (concat ielm-output (pp-to-string ielm-result)))
(with-current-buffer (get-buffer-create "*ielm*")
(unless (zerop (buffer-size)) (setq old-point (point)))
(inferior-emacs-lisp-mode)))
(with-current-buffer (get-buffer-create "*ielm*")
(unless (zerop (buffer-size)) (setq old-point (point)))
(inferior-emacs-lisp-mode)))