comparison lisp/ielm.el @ 10981:54697b892d3a

(ielm): Use pop-to-buffer. (same-window-buffer-names): Add *ielm*.
author Richard M. Stallman <rms@gnu.org>
date Sun, 12 Mar 1995 18:34:57 +0000
parents 50676390b162
children 6141f81a80e5
comparison
equal deleted inserted replaced
10980:aa3f323f1dea 10981:54697b892d3a
85 This variable is buffer-local.") 85 This variable is buffer-local.")
86 86
87 (defvar ielm-header 87 (defvar ielm-header
88 (concat 88 (concat
89 "*** Welcome to IELM version " 89 "*** Welcome to IELM version "
90 (substring "$Revision: 1.2 $" 11 -2) 90 (substring "$Revision: 1.3 $" 11 -2)
91 " *** Type (describe-mode) for help.\n" 91 " *** Type (describe-mode) for help.\n"
92 "IELM has ABSOLUTELY NO WARRANTY; type (describe-no-warranty) for details.\n") 92 "IELM has ABSOLUTELY NO WARRANTY; type (describe-no-warranty) for details.\n")
93 "Message to display when IELM is started.") 93 "Message to display when IELM is started.")
94 94
95 (defvar ielm-map nil) 95 (defvar ielm-map nil)
439 (comint-skip-prompt) 439 (comint-skip-prompt)
440 (buffer-substring (point) (progn (forward-sexp 1) (point))))) 440 (buffer-substring (point) (progn (forward-sexp 1) (point)))))
441 441
442 ;;; User command 442 ;;; User command
443 443
444 ;;;###autoload (add-hook 'same-window-buffer-names "*ielm*")
445
444 ;;;###autoload 446 ;;;###autoload
445 (defun ielm nil 447 (defun ielm nil
446 "Interactively evaluate Emacs Lisp expressions. 448 "Interactively evaluate Emacs Lisp expressions.
447 Switches to the buffer *ielm*, or creates it if it does not exist." 449 Switches to the buffer `*ielm*', or creates it if it does not exist."
448 (interactive) 450 (interactive)
449 (if (comint-check-proc "*ielm*") nil 451 (if (comint-check-proc "*ielm*")
450 (progn 452 nil
453 (save-excursion
451 (set-buffer (get-buffer-create "*ielm*")) 454 (set-buffer (get-buffer-create "*ielm*"))
452 (inferior-emacs-lisp-mode))) 455 (inferior-emacs-lisp-mode)))
453 (switch-to-buffer "*ielm*")) 456 (pop-to-buffer "*ielm*"))
454 457
455 ;;; ielm.el ends here 458 ;;; ielm.el ends here