Changeset 719
- Timestamp:
- Mar 25, 2004, 1:03:48 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/hemlock/src/listener.lisp
r697 r719 25 25 26 26 27 (defun pa kage-name-change-hook (name kind where new-value)27 (defun package-name-change-hook (name kind where new-value) 28 28 (declare (ignore name new-value)) 29 29 (if (eq kind :buffer) … … 450 450 (t (region start end))))) 451 451 452 (defun eval-region (region 453 &key 454 (package (value current-package)) 455 (path (buffer-pathname (current-buffer)))) 456 (evaluate-input-selection 457 (ccl::make-input-selection 458 :package package 459 :source-file path 460 :string-stream (make-string-input-stream 461 (region-to-string region))))) 462 463 464 452 465 (defun editor-compile-region (region &optional quiet) 453 466 (unless quiet (message "Compiling region ...")) 454 (in-lisp 455 (with-input-from-region (stream region) 456 (with-pop-up-display (*error-output* :height 19) 457 ;; JDz: We don't record source locations and what not, but this 458 ;; is portable. CMUCL specific implementation removed because 459 ;; it does not work on HEMLOCK-REGION-STREAM (but it can be 460 ;; added back later if CMUCL starts using user-extensible 461 ;; streams internally.) 462 (funcall (compile nil `(lambda () 463 ,@(loop for form = (read stream nil stream) 464 until (eq form stream) 465 collect form)))))))) 467 (eval-region region)) 466 468 467 469 … … 472 474 (declare (ignore p)) 473 475 (if (region-active-p) 474 (editor-evaluate-region-command nil) 475 (with-input-from-region (stream (defun-region (current-point))) 476 (clear-echo-area) 477 (in-lisp 478 (message "Editor Evaluation returned ~S" 479 (eval (read stream))))))) 476 (editor-evaluate-region-command nil) 477 (eval-region (defun-region (current-point))))) 480 478 481 479 (defcommand "Editor Evaluate Region" (p) … … 483 481 "Evaluates lisp forms between the point and the mark in the editor Lisp." 484 482 (declare (ignore p)) 485 (with-input-from-region (stream (current-region)) 486 (clear-echo-area) 487 (write-string "Evaluating region in the editor ..." *echo-area-stream*) 488 (finish-output *echo-area-stream*) 489 (in-lisp 490 (do ((object (read stream nil lispbuf-eof) 491 (read stream nil lispbuf-eof))) 492 ((eq object lispbuf-eof)) 493 (eval object))) 494 (message "Evaluation complete."))) 483 (eval-region (current-region))) 495 484 496 485 (defcommand "Editor Re-evaluate Defvar" (p)
Note: See TracChangeset
for help on using the changeset viewer.