(r2b-additional-stop-words, capitalize-title-stop-words):
[bpt/emacs.git] / lisp / ielm.el
index 3b625f6..d3d7459 100644 (file)
@@ -87,7 +87,7 @@ This variable is buffer-local.")
 (defvar ielm-header 
   (concat
    "*** Welcome to IELM version "
-   (substring "$Revision: 1.2 $" 11 -2)
+   (substring "$Revision: 1.4 $" 11 -2)
    " ***  Type (describe-mode) for help.\n"
    "IELM has ABSOLUTELY NO WARRANTY; type (describe-no-warranty) for details.\n")
   "Message to display when IELM is started.")
@@ -116,6 +116,12 @@ This variable is buffer-local.")
   (define-key ielm-map "\C-c\C-f" 'ielm-display-working-buffer)
   (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer))
 
+(defvar ielm-font-lock-keywords
+  (list 
+   (cons (concat "^" (regexp-quote ielm-prompt)) 'font-lock-keyword-face)
+   '("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)" (1 font-lock-comment-face) (2 font-lock-reference-face)))
+  "Additional expressions to highlight in ielm buffers.")
+       
 ;;; Completion stuff
 
 (defun ielm-tab nil
@@ -417,6 +423,11 @@ Customised bindings may be defined in `ielm-map', which currently contains:
   (setq ::: nil)
   (make-local-variable ':::)
 
+  ;; font-lock support
+  (make-local-variable 'font-lock-defaults)
+  (setq font-lock-defaults 
+       '(ielm-font-lock-keywords nil nil ((?: . "w") (?- . "w") (?* . "w"))))
+  
   ;; A dummy process to keep comint happy. It will never get any input
   (if (comint-check-proc (current-buffer)) nil
     (start-process "ielm" (current-buffer) "cat")
@@ -441,15 +452,18 @@ Customised bindings may be defined in `ielm-map', which currently contains:
 
 ;;; User command
 
+;;;###autoload (add-hook 'same-window-buffer-names "*ielm*")
+
 ;;;###autoload
 (defun ielm nil
   "Interactively evaluate Emacs Lisp expressions.
-Switches to the buffer *ielm*, or creates it if it does not exist."
+Switches to the buffer `*ielm*', or creates it if it does not exist."
   (interactive)
-  (if (comint-check-proc "*ielm*") nil
-    (progn
+  (if (comint-check-proc "*ielm*")
+      nil
+    (save-excursion
       (set-buffer (get-buffer-create "*ielm*"))
       (inferior-emacs-lisp-mode)))
-  (switch-to-buffer "*ielm*"))
+  (pop-to-buffer "*ielm*"))
 
 ;;; ielm.el ends here