Changeset 7929
- Timestamp:
- Dec 21, 2007, 11:12:48 AM (17 years ago)
- Location:
- branches/event-ide/ccl/cocoa-ide
- Files:
-
- 8 edited
-
cocoa-editor.lisp (modified) (11 diffs)
-
cocoa-listener.lisp (modified) (26 diffs)
-
cocoa-window.lisp (modified) (1 diff)
-
hemlock/src/lispmode.lisp (modified) (1 diff)
-
hemlock/src/listener.lisp (modified) (4 diffs)
-
hemlock/src/modeline.lisp (modified) (1 diff)
-
hemlock/src/package.lisp (modified) (1 diff)
-
hemlock/src/views.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/event-ide/ccl/cocoa-ide/cocoa-editor.lisp
r7919 r7929 766 766 (slot-value hemlock-string 'cache) nil 767 767 (hi::buffer-document buffer) nil) 768 (let* ((p (hi::buffer-process buffer)))769 (when p770 (setf (hi::buffer-process buffer) nil)771 (process-kill p)))772 768 (when (eq buffer hi::*current-buffer*) 773 769 (setf hi::*current-buffer* nil)) … … 1069 1065 (objc:defmethod (#/evalSelection: :void) ((self hemlock-text-view) sender) 1070 1066 (declare (ignore sender)) 1071 (let* ((dc (#/sharedDocumentController ns:ns-document-controller)) 1072 (doc (#/documentForWindow: dc (#/window self))) 1073 (buffer (hemlock-document-buffer doc)) 1067 (let* ((buffer (hemlock-buffer self)) 1074 1068 (package-name (hi::variable-value 'hemlock::current-package :buffer buffer)) 1075 1069 (pathname (hi::buffer-pathname buffer)) … … 1084 1078 (objc:defmethod (#/loadBuffer: :void) ((self hemlock-text-view) sender) 1085 1079 (declare (ignore sender)) 1086 (let* ((dc (#/sharedDocumentController ns:ns-document-controller)) 1087 (doc (#/documentForWindow: dc (#/window self))) 1088 (buffer (hemlock-document-buffer doc)) 1080 (let* ((buffer (hemlock-buffer self)) 1089 1081 (package-name (hi::variable-value 'hemlock::current-package :buffer buffer)) 1090 1082 (pathname (hi::buffer-pathname buffer))) … … 1093 1085 (objc:defmethod (#/compileBuffer: :void) ((self hemlock-text-view) sender) 1094 1086 (declare (ignore sender)) 1095 (let* ((dc (#/sharedDocumentController ns:ns-document-controller)) 1096 (doc (#/documentForWindow: dc (#/window self))) 1097 (buffer (hemlock-document-buffer doc)) 1087 (let* ((buffer (hemlock-buffer self)) 1098 1088 (package-name (hi::variable-value 'hemlock::current-package :buffer buffer)) 1099 1089 (pathname (hi::buffer-pathname buffer))) … … 1102 1092 (objc:defmethod (#/compileAndLoadBuffer: :void) ((self hemlock-text-view) sender) 1103 1093 (declare (ignore sender)) 1104 (let* ((dc (#/sharedDocumentController ns:ns-document-controller)) 1105 (doc (#/documentForWindow: dc (#/window self))) 1106 (buffer (hemlock-document-buffer doc)) 1094 (let* ((buffer (hemlock-buffer self)) 1107 1095 (package-name (hi::variable-value 'hemlock::current-package :buffer buffer)) 1108 1096 (pathname (hi::buffer-pathname buffer))) … … 2261 2249 :encoding encoding 2262 2250 :error +null-ptr+)) 2263 (buffer (hemlock- document-buffer self))2251 (buffer (hemlock-buffer self)) 2264 2252 (old-length (hemlock-buffer-length buffer)) 2265 2253 (hi::*current-buffer* buffer) … … 2321 2309 (#/path url) 2322 2310 (#/absoluteString url)))) 2323 (buffer (or (hemlock- document-buffer self)2311 (buffer (or (hemlock-buffer self) 2324 2312 (make-buffer-for-document self pathname))) 2325 2313 (selected-encoding (slot-value (#/sharedDocumentController (find-class 'hemlock-document-controller)) 'last-encoding)) … … 2401 2389 2402 2390 2403 (defmethod hemlock-document-buffer (document)2404 (hemlock-buffer document))2405 2406 2391 (defmethod hemlock-view ((frame hemlock-frame)) 2407 2392 (let ((pane (slot-value frame 'pane))) … … 2430 2415 (with-slots (encoding) self 2431 2416 (setq encoding (nsinteger-to-nsstring-encoding (#/selectedTag popup))) 2432 (hi::note-modeline-change (hemlock- document-buffer self))))2417 (hi::note-modeline-change (hemlock-buffer self)))) 2433 2418 2434 2419 (objc:defmethod (#/prepareSavePanel: :<BOOL>) ((self hemlock-editor-document) … … 2454 2439 (with-slots (encoding textstorage) self 2455 2440 (let* ((string (#/string textstorage)) 2456 (buffer (hemlock- document-buffer self)))2441 (buffer (hemlock-buffer self))) 2457 2442 (case (when buffer (hi::buffer-line-termination buffer)) 2458 2443 (:crlf (unless (typep string 'ns:ns-mutable-string) … … 2479 2464 url) 2480 2465 (call-next-method url) 2481 (let* ((buffer (hemlock- document-buffer self)))2466 (let* ((buffer (hemlock-buffer self))) 2482 2467 (when buffer 2483 2468 (let* ((new-pathname (lisp-string-from-nsstring (#/path url)))) -
branches/event-ide/ccl/cocoa-ide/cocoa-listener.lisp
r7911 r7929 49 49 pty) 50 50 51 (defparameter $listener-flush-limit 100) 52 53 (defclass cocoa-listener-output-stream (fundamental-character-output-stream) 54 ((lock :initform (make-lock)) 55 (hemlock-view :initarg :hemlock-view) 56 (data :initform (make-array (1+ $listener-flush-limit) 57 :adjustable t :fill-pointer 0 58 :element-type 'character)))) 59 60 (defmethod stream-element-type ((stream cocoa-listener-output-stream)) 61 (with-slots (data) stream 62 (array-element-type data))) 63 64 (defmethod ccl:stream-write-char ((stream cocoa-listener-output-stream) char) 65 (with-slots (data lock) stream 66 (when (with-lock-grabbed (lock) 67 (>= (vector-push-extend char data) $listener-flush-limit)) 68 (stream-force-output stream)))) 69 70 ;; This isn't really thread safe, but it's not too bad... I'll take a chance - trying 71 ;; to get it to execute in the gui thread is too deadlock-prone. 72 (defmethod hemlock-listener-output-mark-column ((view hi::hemlock-view)) 73 (let* ((output-region (hi::variable-value 'hemlock::current-output-font-region 74 :buffer (hi::hemlock-view-buffer view)))) 75 (hi::mark-charpos (hi::region-end output-region)))) 76 77 ;; TODO: doesn't do the right thing for embedded tabs (in buffer or data) 78 (defmethod ccl:stream-line-column ((stream cocoa-listener-output-stream)) 79 (with-slots (hemlock-view data lock) stream 80 (with-lock-grabbed (lock) 81 (let* ((n (length data)) 82 (pos (position #\Newline data :from-end t))) 83 (if (null pos) 84 (+ (hemlock-listener-output-mark-column hemlock-view) n) 85 (- n pos 1)))))) 86 87 (defmethod ccl:stream-fresh-line ((stream cocoa-listener-output-stream)) 88 (with-slots (hemlock-view data lock) stream 89 (when (with-lock-grabbed (lock) 90 (let ((n (length data))) 91 (unless (if (= n 0) 92 (= (hemlock-listener-output-mark-column hemlock-view) 0) 93 (eq (aref data (1- n)) #\Newline)) 94 (>= (vector-push-extend #\Newline data) $listener-flush-limit)))) 95 (stream-force-output stream)))) 96 97 (defmethod ccl::stream-finish-output ((stream cocoa-listener-output-stream)) 98 (stream-force-output stream)) 99 100 (defmethod ccl:stream-force-output ((stream cocoa-listener-output-stream)) 101 (if (typep *current-process* 'appkit-process) 102 (with-slots (hemlock-view data lock) stream 103 (with-lock-grabbed (lock) 104 (when (> (fill-pointer data) 0) 105 (append-output hemlock-view data) 106 (setf (fill-pointer data) 0)))) 107 (with-slots (data) stream 108 (when (> (fill-pointer data) 0) 109 (queue-for-gui #'(lambda () (stream-force-output stream))))))) 110 111 (defmethod ccl:stream-clear-output ((stream cocoa-listener-output-stream)) 112 (with-slots (data lock) stream 113 (with-lock-grabbed (lock) 114 (setf (fill-pointer data) 0)))) 115 116 (defmethod ccl:stream-line-length ((stream cocoa-listener-output-stream)) 117 ;; TODO: ** compute length from window size ** 118 80) 119 51 120 52 121 (defloadvar *cocoa-listener-count* 0) … … 58 127 (backtrace-contexts :initform nil 59 128 :accessor cocoa-listener-process-backtrace-contexts) 60 (window :reader cocoa-listener-process-window) 61 (buffer :initform nil :reader cocoa-listener-process-buffer))) 129 (window :reader cocoa-listener-process-window))) 62 130 63 131 64 (defun new-cocoa-listener-process (procname input-fd output-fd peer-fd window buffer)132 (defun new-cocoa-listener-process (procname input-fd peer-fd window) 65 133 (let* ((input-stream (ccl::make-selection-input-stream 66 134 input-fd … … 70 138 #$_PC_MAX_INPUT) 71 139 :encoding :utf-8)) 72 (output-stream (ccl::make-fd-stream output-fd :direction :output73 :sharing :lock74 :elements-per-buffer75 (#_fpathconf76 output-fd77 #$_PC_MAX_INPUT)78 :encoding :utf-8))79 140 (peer-stream (ccl::make-fd-stream peer-fd :direction :output 80 141 :sharing :lock … … 84 145 #$_PC_MAX_INPUT) 85 146 :encoding :utf-8)) 147 (output-stream (make-instance 'cocoa-listener-output-stream 148 :hemlock-view (hemlock-view window))) 149 86 150 (proc 87 151 (ccl::make-mcl-listener-process … … 89 153 input-stream 90 154 output-stream 91 #'(lambda ()` 92 (let* ((buf (find *current-process* hi:*buffer-list* 93 :key #'hi::buffer-process)) 94 (doc (if buf (hi::buffer-document buf)))) 95 (when doc 96 (setf (hi::buffer-process buf) nil) 97 (#/performSelectorOnMainThread:withObject:waitUntilDone: 98 doc 99 (@selector #/close) 100 +null-ptr+ 101 nil)))) 155 ;; cleanup function 156 #'(lambda () 157 (mapcar #'(lambda (buf) 158 (when (eq (buffer-process buf) *current-process*) 159 (let ((doc (hi::buffer-document buf))) 160 (when doc 161 (setf (hemlock-document-process doc) nil) ;; so #/close doesn't kill it. 162 (#/performSelectorOnMainThread:withObject:waitUntilDone: 163 doc 164 (@selector #/close) 165 +null-ptr+ 166 nil))))) 167 hi:*buffer-list*)) 102 168 :initial-function 103 169 #'(lambda () 104 170 (setq ccl::*listener-autorelease-pool* (create-autorelease-pool)) 105 171 (ccl::listener-function)) 172 :echoing nil 106 173 :class 'cocoa-listener-process))) 107 174 (setf (slot-value proc 'input-stream) input-stream) … … 109 176 (setf (slot-value proc 'input-peer-stream) peer-stream) 110 177 (setf (slot-value proc 'window) window) 111 (setf (slot-value proc 'buffer) buffer)112 178 proc)) 113 179 114 180 115 181 (defclass hemlock-listener-frame (hemlock-frame) … … 180 246 (#_free xlate) 181 247 (setq xlate new translatebuf new bufsize need))) 182 #+debug (#_NSLog #@"got %d bytes of data" :int data-length)248 #+debug :GZ (#_NSLog #@"got %d bytes of data" :int data-length) 183 249 (with-macptrs ((target (%inc-ptr xlate n))) 184 250 (#/getBytes:range: data target (ns:make-ns-range 0 data-length))) … … 217 283 (not (%null-ptr-p (#/fileURL doc)))) 218 284 (call-next-method name) 219 (let* ((buffer (hemlock- document-buffer doc))285 (let* ((buffer (hemlock-buffer doc)) 220 286 (bufname (if buffer (hi::buffer-name buffer)))) 221 287 (if bufname … … 228 294 229 295 (defclass hemlock-listener-document (hemlock-editor-document) 230 ()296 ((process :reader %hemlock-document-process :writer (setf hemlock-document-process))) 231 297 (:metaclass ns:+ns-object)) 232 298 (declaim (special hemlock-listener-document)) 299 300 (defgeneric hemlock-document-process (doc) 301 (:method ((unknown t)) nil) 302 (:method ((doc hemlock-listener-document)) (%hemlock-document-process doc))) 303 304 ;; Nowadays this is nil except for listeners. 305 (defun buffer-process (buffer) 306 (hemlock-document-process (hi::buffer-document buffer))) 233 307 234 308 (defmethod update-buffer-package ((doc hemlock-listener-document) buffer) … … 244 318 *listener-background-color*) 245 319 246 247 (defun hemlock::listener-document-send-string (document string) 248 (let* ((buffer (hemlock-document-buffer document)) 249 (process (if buffer (hi::buffer-process buffer)))) 250 (if process 251 (hi::send-string-to-listener-process process string)))) 252 320 (defun hemlock-ext:send-string-to-listener (buffer string) 321 (let* ((proc (buffer-process buffer))) 322 (when proc 323 (send-string-to-listener-process proc string)))) 324 325 ;; For use with the :process-info listener modeline field 326 (defmethod hemlock-ext:buffer-process-description (buffer) 327 (let ((proc (buffer-process buffer))) 328 (when proc 329 (format nil "~a(~d) [~a]" 330 (ccl:process-name proc) 331 (ccl::process-serial-number proc) 332 ;; TODO: this doesn't really work as a modeline item, because the modeline 333 ;; doesn't get notified when it changes. 334 (ccl:process-whostate proc))))) 253 335 254 336 (objc:defmethod #/topListener ((self +hemlock-listener-document)) … … 260 342 261 343 (defun symbol-value-in-top-listener-process (symbol) 262 (let* ((listenerdoc (#/topListener hemlock-listener-document)) 263 (buffer (unless (%null-ptr-p listenerdoc) 264 (hemlock-document-buffer listenerdoc))) 265 (process (if buffer (hi::buffer-process buffer)))) 344 (let* ((process (hemlock-document-process (#/topListener hemlock-listener-document)))) 266 345 (if process 267 346 (ignore-errors (symbol-value-in-process symbol process)) … … 269 348 270 349 (defun hemlock-ext:top-listener-output-stream () 271 (let* ((doc (#/topListener hemlock-listener-document))) 272 (unless (%null-ptr-p doc) 273 (let* ((buffer (hemlock-document-buffer doc)) 274 (process (if buffer (hi::buffer-process buffer)))) 275 (when (typep process 'cocoa-listener-process) 276 (cocoa-listener-process-output-stream process)))))) 350 (let* ((process (hemlock-document-process (#/topListener hemlock-listener-document)))) 351 (when process 352 (setq process (require-type process 'cocoa-listener-process)) 353 (cocoa-listener-process-output-stream process)))) 277 354 278 355 … … 290 367 (format nil 291 368 "Listener-~d" *cocoa-listener-count*))) 292 (buffer (hemlock- document-buffer doc)))369 (buffer (hemlock-buffer doc))) 293 370 (setf (hi::buffer-pathname buffer) nil 294 371 (hi::buffer-minor-mode buffer "Listener") t … … 308 385 (setq *next-listener-x-pos* nil 309 386 *next-listener-y-pos* nil)) 387 (let* ((p (shiftf (hemlock-document-process self) nil))) 388 (when p 389 (process-kill p))) 310 390 (call-next-method)) 311 391 … … 329 409 'hemlock-listener-window-controller 330 410 :with-window window)) 331 (listener-name (hi::buffer-name (hemlock- document-buffer self))))411 (listener-name (hi::buffer-name (hemlock-buffer self)))) 332 412 (with-slots (styles) textstorage 333 413 ;; We probably should be more disciplined about … … 354 434 (setf *next-listener-x-pos* (ns:ns-point-x new-point) 355 435 *next-listener-y-pos* (ns:ns-point-y new-point)))) 356 (setf (h i::buffer-process (hemlock-document-buffer self))436 (setf (hemlock-document-process self) 357 437 (let* ((tty (slot-value controller 'clientfd)) 358 438 (peer-tty (#/fileDescriptor (slot-value controller 'filehandle)))) 359 (new-cocoa-listener-process listener-name tty tty peer-tty window (hemlock-document-buffer self))))439 (new-cocoa-listener-process listener-name tty peer-tty window))) 360 440 controller)) 361 441 … … 368 448 (let* ((range-start (ns:ns-range-location range)) 369 449 (range-end (+ range-start (ns:ns-range-length range))) 370 (buffer (hemlock- document-buffer self))450 (buffer (hemlock-buffer self)) 371 451 (protected-region (hi::buffer-protected-region buffer))) 372 452 (if protected-region … … 383 463 (objc:defmethod (#/interrupt: :void) ((self hemlock-listener-document) sender) 384 464 (declare (ignore sender)) 385 (let* ((buffer (hemlock-document-buffer self)) 386 (process (if buffer (hi::buffer-process buffer)))) 387 (when (typep process 'cocoa-listener-process) 465 (let* ((process (hemlock-document-process self))) 466 (when process 388 467 (ccl::force-break-in-listener process)))) 389 468 … … 392 471 (objc:defmethod (#/exitBreak: :void) ((self hemlock-listener-document) sender) 393 472 (declare (ignore sender)) 394 (let* ((buffer (hemlock-document-buffer self)) 395 (process (if buffer (hi::buffer-process buffer)))) 396 (log-debug "~&exitBreak buffer ~s process ~s" buffer process) 397 (when (typep process 'cocoa-listener-process) 473 (let* ((process (hemlock-document-process self))) 474 (log-debug "~&exitBreak process ~s" process) 475 (when process 398 476 (process-interrupt process #'abort-break)))) 399 477 … … 402 480 403 481 (objc:defmethod (#/backtrace: :void) ((self hemlock-listener-document) sender) 404 (let* ((buffer (hemlock-document-buffer self)) 405 (process (if buffer (hi::buffer-process buffer)))) 406 (when (typep process 'cocoa-listener-process) 482 (let* ((process (hemlock-document-process self))) 483 (when process 407 484 (let* ((context (listener-backtrace-context process))) 408 485 (when context … … 435 512 436 513 (objc:defmethod (#/restarts: :void) ((self hemlock-listener-document) sender) 437 (let* ((buffer (hemlock-document-buffer self)) 438 (process (if buffer (hi::buffer-process buffer)))) 439 (when (typep process 'cocoa-listener-process) 514 (let* ((process (hemlock-document-process self))) 515 (when process 440 516 (let* ((context (listener-backtrace-context process))) 441 517 (when context … … 444 520 (objc:defmethod (#/continue: :void) ((self hemlock-listener-document) sender) 445 521 (declare (ignore sender)) 446 (let* ((buffer (hemlock-document-buffer self)) 447 (process (if buffer (hi::buffer-process buffer)))) 448 (when (typep process 'cocoa-listener-process) 522 (let* ((process (hemlock-document-process self))) 523 (when process 449 524 (let* ((context (listener-backtrace-context process))) 450 525 (when context … … 464 539 ;; So far, all actions demand that there be an underlying process, so 465 540 ;; check for that first. 466 (let* ((buffer (hemlock-document-buffer doc)) 467 (process (if buffer (hi::buffer-process buffer)))) 468 (if (typep process 'cocoa-listener-process) 541 (let* ((process (hemlock-document-process doc))) 542 (if process 469 543 (let* ((action (#/action item))) 470 #+GZ (log-debug "Validate menu item buffer: ~s process: ~s action: ~s context ~s" buffer process471 (cond ((eql action (@selector #/revertDocumentToSaved:))472 "revertDocumentToSaved:")473 ((eql action (@selector #/saveDocument:))474 "saveDocument:")475 ((eql action (@selector #/saveDocumentAs:))476 "saveDocumentAs:")477 ((eql action (@selector #/interrupt:))478 "interrupt")479 ((eql action (@selector #/continue:))480 "continue")481 ((eql action (@selector #/backtrace:))482 "backtrace")483 ((eql action (@selector #/exitBreak:))484 "exitBreak:")485 ((eql action (@selector #/restarts:))486 "restarts:")487 (t action))488 (cocoa-listener-process-backtrace-contexts process))489 544 (cond 490 545 ((or (eql action (@selector #/revertDocumentToSaved:)) … … 524 579 525 580 (defmethod ui-object-note-package ((app ns:ns-application) package) 526 (with-autorelease-pool 527 (process-interrupt *cocoa-event-process* 528 #'(lambda (proc name) 529 (dolist (buf hi::*buffer-list*) 530 (when (eq proc (hi::buffer-process buf)) 531 (setf (hi::variable-value 'hemlock::current-package :buffer buf) name)))) 532 *current-process* 533 (shortest-package-name package)))) 581 (let ((proc *current-process*) 582 (name (shortest-package-name package))) 583 (execute-in-gui #'(lambda () 584 (dolist (buf hi::*buffer-list*) 585 (when (eq proc (buffer-process buf)) 586 (setf (hi::variable-value 'hemlock::current-package :buffer buf) name))))))) 534 587 535 588 ;;; This is basically used to provide INPUT to the listener process, by 536 589 ;;; writing to an fd which is conntected to that process's standard 537 590 ;;; input. 538 (defmethod hi::send-string-to-listener-process ((process cocoa-listener-process)539 string &key path package)591 (defmethod send-string-to-listener-process ((process cocoa-listener-process) 592 string &key path package) 540 593 (let* ((stream (cocoa-listener-process-input-peer-stream process))) 541 594 (labels ((out-raw-char (ch) … … 570 623 (declare (ignore selection)) 571 624 (#/performSelectorOnMainThread:withObject:waitUntilDone: 572 (#/delegate *NSApp*) (@selector #/ensureListener:) +null-ptr+ #$YES) 573 (let* ((top-listener-document (#/topListener hemlock-listener-document))) 574 (if top-listener-document 575 (let* ((buffer (hemlock-document-buffer top-listener-document))) 576 (if buffer 577 (let* ((proc (hi::buffer-process buffer))) 578 (if (typep proc 'cocoa-listener-process) 579 proc))))))) 625 (#/delegate *NSApp*) 626 (@selector #/ensureListener:) 627 +null-ptr+ 628 #$YES) 629 (hemlock-document-process (#/topListener hemlock-listener-document))) 580 630 581 631 (defmethod ui-object-eval-selection ((app ns:ns-application) … … 583 633 (let* ((target-listener (ui-object-choose-listener-for-selection 584 634 app selection))) 585 ( if (typep target-listener 'cocoa-listener-process)586 (destructuring-bind (package path string) selection587 ( hi::send-string-to-listener-process target-listener string :package package :path path)))))635 (when target-listener 636 (destructuring-bind (package path string) selection 637 (send-string-to-listener-process target-listener string :package package :path path))))) 588 638 589 639 (defmethod ui-object-load-buffer ((app ns:ns-application) selection) 590 640 (let* ((target-listener (ui-object-choose-listener-for-selection app nil))) 591 ( if (typep target-listener 'cocoa-listener-process)592 (destructuring-bind (package path) selection593 (let ((string (format nil "(load ~S)" path)))594 (hi::send-string-to-listener-process target-listener string :package package :path path))))))641 (when target-listener 642 (destructuring-bind (package path) selection 643 (let ((string (format nil "(load ~S)" path))) 644 (send-string-to-listener-process target-listener string :package package :path path)))))) 595 645 596 646 (defmethod ui-object-compile-buffer ((app ns:ns-application) selection) 597 647 (let* ((target-listener (ui-object-choose-listener-for-selection app nil))) 598 ( if (typep target-listener 'cocoa-listener-process)599 (destructuring-bind (package path) selection600 (let ((string (format nil "(compile-file ~S)" path)))601 (hi::send-string-to-listener-process target-listener string :package package :path path))))))648 (when target-listener 649 (destructuring-bind (package path) selection 650 (let ((string (format nil "(compile-file ~S)" path))) 651 (send-string-to-listener-process target-listener string :package package :path path)))))) 602 652 603 653 (defmethod ui-object-compile-and-load-buffer ((app ns:ns-application) selection) 604 654 (let* ((target-listener (ui-object-choose-listener-for-selection app nil))) 605 ( if (typep target-listener 'cocoa-listener-process)606 (destructuring-bind (package path) selection607 (let ((string (format nil "(progn (compile-file ~S)(load ~S))"608 path609 (make-pathname :directory (pathname-directory path)610 :name (pathname-name path)611 :type (pathname-type path)))))612 (hi::send-string-to-listener-process target-listener string :package package :path path))))))655 (when target-listener 656 (destructuring-bind (package path) selection 657 (let ((string (format nil "(progn (compile-file ~S)(load ~S))" 658 path 659 (make-pathname :directory (pathname-directory path) 660 :name (pathname-name path) 661 :type (pathname-type path))))) 662 (send-string-to-listener-process target-listener string :package package :path path)))))) 613 663 614 664 615 665 -
branches/event-ide/ccl/cocoa-ide/cocoa-window.lisp
r7911 r7929 157 157 (flet ((cocoa-startup () 158 158 ;; Start up a thread to run periodic tasks. 159 (process-run-function "housekeeping" 160 #'(lambda () 161 (loop 162 (ccl::%nanosleep ccl::*periodic-task-seconds* 163 ccl::*periodic-task-nanoseconds*) 164 (ccl::housekeeping)))) 165 159 (process-run-function "housekeeping" #'ccl::housekeeping-loop) 166 160 (with-autorelease-pool 167 161 (enable-foreground) -
branches/event-ide/ccl/cocoa-ide/hemlock/src/lispmode.lisp
r7913 r7929 331 331 (unless (lisp-info-ending-quoted line-info) 332 332 (loop 333 (find-lisp-char mark) 333 (unless (find-lisp-char mark) 334 (error "Expected at least a newline!")) 335 334 336 (ecase (character-attribute :lisp-syntax (next-character mark)) 335 337 -
branches/event-ide/ccl/cocoa-ide/hemlock/src/listener.lisp
r7913 r7929 198 198 (move-mark (value buffer-input-mark) (current-point)) 199 199 (append-font-regions (current-buffer)) 200 (hi::send-string-to-listener-process (hi::buffer-process (current-buffer)) 201 string)))))) 200 (hemlock-ext:send-string-to-listener (current-buffer) string)))))) 202 201 203 202 (defparameter *pop-string* ":POP … … 212 211 (if (and (null (next-character point)) 213 212 (null (next-character input-mark))) 214 (listener-document-send-string (hi::buffer-document (current-buffer)) *pop-string*) 215 (delete-next-character-command p))))) 216 217 218 219 220 213 (hemlock-ext:send-string-to-listener (current-buffer) *pop-string*) 214 (delete-next-character-command p))))) 221 215 222 216 … … 518 512 (expr (with-input-from-region (s region) 519 513 (read s)))) 520 (let* ((*print-pretty* t)) 521 (format t "~&~s~&" (funcall expander expr))))) 514 (let* ((*print-pretty* t) 515 (expansion (funcall expander expr))) 516 (format t "~&~s~&" expansion)))) 522 517 523 518 (defcommand "Editor Macroexpand-1 Expression" (p) … … 548 543 (defcommand "Editor Evaluate Buffer" (p) 549 544 "Evaluates the text in the current buffer in the editor Lisp." 550 "Evaluates the text in the current buffer redirecting *Standard-Output* to551 the echo area. This occurs in the editor Lisp. The prefix argument is552 ignored."553 545 (declare (ignore p)) 554 546 (message "Evaluating buffer in the editor ...") 555 547 (with-input-from-region (stream (buffer-region (current-buffer))) 556 (let ((*standard-output* *echo-area-stream*)) 557 (in-lisp 558 (do ((object (read stream nil lispbuf-eof) 559 (read stream nil lispbuf-eof))) 560 ((eq object lispbuf-eof)) 561 (eval object)))) 548 (in-lisp 549 (do ((object (read stream nil lispbuf-eof) 550 (read stream nil lispbuf-eof))) 551 ((eq object lispbuf-eof)) 552 (eval object))) 562 553 (message "Evaluation complete."))) 563 554 -
branches/event-ide/ccl/cocoa-ide/hemlock/src/modeline.lisp
r7844 r7929 204 204 :function #'(lambda (buffer window) 205 205 (declare (ignore window)) 206 (let* ((proc (buffer-process buffer))) 207 (when proc 208 (format nil "~a(~d) [~a]" 209 (ccl::process-name proc) 210 (ccl::process-serial-number proc) 211 (ccl::process-whostate proc)))))) 206 (hemlock-ext:buffer-process-description buffer))) 212 207 213 208 (defparameter *default-modeline-fields* -
branches/event-ide/ccl/cocoa-ide/hemlock/src/package.lisp
r7919 r7929 368 368 #:edit-single-definition 369 369 #:change-active-pane 370 #:send-string-to-listener 371 #:buffer-process-description 370 372 )) 371 373 -
branches/event-ide/ccl/cocoa-ide/hemlock/src/views.lisp
r7919 r7929 178 178 179 179 (defmethod execute-hemlock-key ((view hemlock-view) key) 180 #+gz (log-debug "~&execute-hemlock-key ~s" key) 180 181 (if (or (symbolp key) (functionp key)) 181 182 (funcall key) … … 183 184 (multiple-value-bind (main-binding transparent-bindings) 184 185 (get-command-binding-for-key view key) 186 #+gz (log-debug "~& binding ~s ~s" main-binding transparent-bindings) 185 187 (when main-binding 186 188 (let* ((*last-last-command-type* (shiftf (hemlock-last-command-type view) nil))
Note:
See TracChangeset
for help on using the changeset viewer.
