Changeset 6665
- Timestamp:
- Jun 3, 2007, 2:58:06 AM (17 years ago)
- File:
-
- 1 edited
-
branches/ide-1.0/ccl/hemlock/src/listener.lisp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ide-1.0/ccl/hemlock/src/listener.lisp
r6572 r6665 73 73 :buffer buffer 74 74 :value (copy-mark point :right-inserting)) 75 (defhvar "Buffer Output Mark" 76 "Mark used for Listener Mode output." 77 :buffer buffer 78 :value (copy-mark point :left-inserting)) 75 79 (defhvar "Interactive History" 76 80 "A ring of the regions input to an interactive mode (Eval or Typescript)." … … 121 125 (output-end (region-end output-region))) 122 126 (hi::with-active-font-region (buffer output-region) 123 (insert-string output-end string) 127 (with-mark ((output-mark output-end :left-inserting)) 128 ;(setf (mark-charpos output-mark) 0) 129 (insert-string output-mark string)) 124 130 (move-mark (variable-value 'buffer-input-mark :buffer buffer) 125 131 output-end)))) … … 486 492 (path (buffer-pathname (current-buffer)))) 487 493 (evaluate-input-selection 488 (ccl::make-input-selection 489 :package package 490 :source-file path 491 :string-stream (make-string-input-stream 492 (region-to-string region))))) 494 (list package path (region-to-string region)))) 493 495 494 496 … … 540 542 (message "Evaluation returned ~S" (eval form)))))) 541 543 542 (defcommand "Editor Macroexpand Expression" (p) 544 (defun macroexpand-expression (expander) 545 (let* ((out (hi::top-listener-output-stream))) 546 (when out 547 (let* ((point (buffer-point (current-buffer))) 548 (region (if (region-active-p) 549 (current-region) 550 (with-mark ((start point)) 551 (pre-command-parse-check start) 552 (with-mark ((end start)) 553 (unless (form-offset end 1) (editor-error)) 554 (region start end))))) 555 (expr (with-input-from-region (s region) 556 (read s)))) 557 (let* ((*print-pretty* t)) 558 (format out "~&~s~&" (funcall expander expr))))))) 559 560 (defcommand "Editor Macroexpand-1 Expression" (p) 543 561 "Show the macroexpansion of the current expression in the null environment. 544 562 With an argument, use MACROEXPAND instead of MACROEXPAND-1." 545 563 "Show the macroexpansion of the current expression in the null environment. 546 564 With an argument, use MACROEXPAND instead of MACROEXPAND-1." 547 (let ((point (buffer-point (current-buffer)))) 548 (with-mark ((start point)) 549 (pre-command-parse-check start) 550 (with-mark ((end start)) 551 (unless (form-offset end 1) (editor-error)) 552 (in-lisp 553 (with-pop-up-display (rts) 554 (write-string (with-input-from-region (s (region start end)) 555 (prin1-to-string (funcall (if p 556 'macroexpand 557 'macroexpand-1) 558 (read s)))) 559 rts))))))) 565 (macroexpand-expression (if p 'macroexpand 'macroexpand-1))) 566 567 (defcommand "Editor Macroexpand Expression" (p) 568 "Show the macroexpansion of the current expression in the null environment. 569 With an argument, use MACROEXPAND-1 instead of MACROEXPAND." 570 "Show the macroexpansion of the current expression in the null environment. 571 With an argument, use MACROEXPAND-1 instead of MACROEXPAND." 572 (macroexpand-expression (if p 'macroexpand-1 'macroexpand))) 573 560 574 561 575 (defcommand "Editor Evaluate Expression" (p)
Note:
See TracChangeset
for help on using the changeset viewer.
