Changeset 14917 for release/1.7


Ignore:
Timestamp:
Jul 28, 2011, 5:03:56 PM (8 years ago)
Author:
rme
Message:

Merge updated fix for ticket:845

Location:
release/1.7/source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/1.7/source

  • release/1.7/source/cocoa-ide/app-delegate.lisp

    r14492 r14917  
    135135   (#/sharedDocumentController ns:ns-document-controller) #@"Listener" t))
    136136
     137(defun active-listener-windows ()
     138  (let* ((listener-windows ())
     139         (all-windows (#/orderedWindows *NSApp*)))
     140    (dotimes (i (#/count all-windows) (nreverse listener-windows))
     141      (let* ((w (#/objectAtIndex: all-windows i))
     142             (wc (#/windowController w)))
     143        (when (and (typep wc 'hemlock-listener-window-controller)
     144                   (#/isVisible w))
     145          (let* ((doc (#/document wc)))
     146            (unless (%null-ptr-p doc)
     147              (when (hemlock-document-process doc)
     148                (push w listener-windows)))))))))
     149       
     150               
    137151(objc:defmethod (#/showListener: :void) ((self lisp-application-delegate)
    138152                                        sender)
    139153  (declare (ignore sender))
    140   (let* ((all-windows (#/orderedWindows *NSApp*))
    141          (key-window (#/keyWindow *NSApp*))
    142          (listener-windows ())
     154  (let* ((key-window (#/keyWindow *NSApp*))
     155         (listener-windows (active-listener-windows))
    143156         (top-listener nil))
    144     (dotimes (i (#/count all-windows))
    145       (let* ((w (#/objectAtIndex: all-windows i))
    146              (wc (#/windowController w)))
    147         (when (eql (#/class wc) hemlock-listener-window-controller)
    148           (push w listener-windows))))
    149     (setq listener-windows (nreverse listener-windows))
    150157    (setq top-listener (car listener-windows))
    151158    (cond
  • release/1.7/source/cocoa-ide/cocoa-listener.lisp

    r14811 r14917  
    306306(objc:defmethod (#/windowShouldClose: #>BOOL) ((w hemlock-listener-frame)
    307307                                               sender)
     308  (declare (ignorable sender))
    308309  (let* ((doc (#/document (#/windowController w))))
    309310    (if (or (%null-ptr-p doc)
    310             (and (hemlock-document-process doc)
    311                  (perform-close-kills-process-p doc)))
     311            (null (hemlock-document-process doc))
     312            (perform-close-kills-process-p doc))
    312313      t
    313314      (progn
    314         ;(#/orderOut: w sender)
    315         (#/close w)
     315        (#/orderOut: w sender)
     316        ;(#/close w)
    316317        nil))))
    317318
     
    384385
    385386(objc:defmethod #/topListener ((self +hemlock-listener-document))
    386   (let* ((all-windows (#/orderedWindows *NSApp*)))
    387     (dotimes (i (#/count all-windows) +null-ptr+)
    388       (let* ((w (#/objectAtIndex: all-windows i)))
    389         (when (#/isVisible w)
    390           (let* ((wc (#/windowController w))
    391                  (doc (#/document wc)))
    392             (unless (%null-ptr-p doc)
    393               (when (#/isKindOfClass: doc self)
    394                 (return doc)))))))))
     387  (let* ((w (car (active-listener-windows))))
     388    (if w
     389      (#/document (#/windowController w))
     390      +null-ptr+)))
     391
     392(defun top-listener-document ()
     393  (let* ((doc (#/topListener hemlock-listener-document)))
     394    (unless (%null-ptr-p doc) doc)))
     395
    395396
    396397(defun symbol-value-in-top-listener-process (symbol)
  • release/1.7/source/cocoa-ide/hemlock/src/listener.lisp

    r14816 r14917  
    608608                    (defun-region (current-point)))))
    609609         (form (when *echo-expression-to-listener* (region-to-string region)))
    610          (buf (gui::hemlock-buffer (#/topListener gui::hemlock-listener-document))))
     610         (doc (gui::top-listener-document))
     611         (buf (when doc (gui::hemlock-buffer doc))))
    611612    (when buf
    612613      (let ((HI::*CURRENT-BUFFER* buf))
     
    620621  (let* ((region (copy-region (current-form-region)))
    621622         (form (when *echo-expression-to-listener* (region-to-string region)))
    622          (buf (gui::hemlock-buffer (#/topListener gui::hemlock-listener-document))))
     623         (doc (gui::top-listener-document))
     624         (buf (when doc (gui::hemlock-buffer doc))))
    623625    (when buf
    624626      (let ((HI::*CURRENT-BUFFER* buf))
Note: See TracChangeset for help on using the changeset viewer.