]> code.delx.au - gnu-emacs/blobdiff - lisp/ielm.el
*** empty log message ***
[gnu-emacs] / lisp / ielm.el
index 87ca67f6c4d51a678d2a698b6a57f6d2253b3132..b03820616ab56db79d390ced45ec487ab0a40039 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ielm.el --- interaction mode for Emacs Lisp
 
-;; Copyright (C) 1994, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2002, 2003 Free Software Foundation, Inc.
 
 ;; Author: David Smith <maa036@lancaster.ac.uk>
 ;; Maintainer: FSF
@@ -114,7 +114,7 @@ such as `edebug-defun' to work with such inputs."
   "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 working buffer, `*1' the value in the process buffer.
 The intended value is only accessible during IELM evaluation.")
 
 (defvar *2 nil
@@ -419,8 +419,8 @@ simply inserts a newline."
   "Major mode for interactively evaluating Emacs Lisp expressions.
 Uses the interface provided by `comint-mode' (which see).
 
-* \\<ielm-map>\\[ielm-send-input] evaluates the sexp following the prompt. There must be at most
-  one top-level sexp per prompt.
+* \\<ielm-map>\\[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').
@@ -462,6 +462,7 @@ Customised bindings may be defined in `ielm-map', which currently contains:
   (setq paragraph-start comint-prompt-regexp)
   (setq comint-input-sender 'ielm-input-sender)
   (setq comint-process-echoes nil)
+  (make-local-variable 'comint-dynamic-complete-functions)
   (setq comint-dynamic-complete-functions
        '(ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol))
   (setq comint-get-old-input 'ielm-get-old-input)
@@ -499,10 +500,12 @@ Customised bindings may be defined in `ielm-map', which currently contains:
   (unless (comint-check-proc (current-buffer))
     ;; Was cat, but on non-Unix platforms that might not exist, so
     ;; use hexl instead, which is part of the Emacs distribution.
-    (start-process "ielm" (current-buffer) "hexl")
+    (condition-case nil
+       (start-process "ielm" (current-buffer) "hexl")
+      (file-error (start-process "ielm" (current-buffer) "cat")))
     (process-kill-without-query (ielm-process))
     (goto-char (point-max))
-    
+
     ;; Lisp output can include raw characters that confuse comint's
     ;; carriage control code.
     (set (make-local-variable 'comint-inhibit-carriage-motion) t)
@@ -510,6 +513,10 @@ Customised bindings may be defined in `ielm-map', which currently contains:
     ;; Add a silly header
     (insert ielm-header)
     (ielm-set-pm (point-max))
+    (unless comint-use-prompt-regexp-instead-of-fields
+      (add-text-properties
+       (point-min) (point-max)
+       '(rear-nonsticky t field output inhibit-line-move-field-capture t)))
     (comint-output-filter (ielm-process) ielm-prompt)
     (set-marker comint-last-input-start (ielm-pm))
     (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter))
@@ -543,4 +550,5 @@ Switches to the buffer `*ielm*', or creates it if it does not exist."
 
 (provide 'ielm)
 
+;;; arch-tag: ef60e4c0-9c4f-4bdb-8402-271313329790
 ;;; ielm.el ends here