;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Patch file for System version 124.29
;;; Reason:
;;;  Peek File System now successfully notices when access type has changed, but didn't
;;;  notice when an access with no host-units aquired some host units.
;;; Written 6-Jun-88 17:37:05 by pld (Peter L. DeWolf) at site Gigamos Cambridge
;;; while running on Cthulhu from band 1
;;; with Experimental System 124.28, Experimental Local-File 74.1, Experimental File-Server 23.1, Experimental Unix-Interface 12.0, Experimental ZMail 72.1, Experimental Tape 23.6, Experimental Lambda-Diag 16.1, microcode 1756, SDU Boot Tape 3.14, SDU ROM 8, the old ones.



; From modified file DJ: L.WINDOW; PEEK.LISP#208 at 6-Jun-88 17:37:14
#8R TV#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "TV")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: WINDOW; PEEK  "


(defun file-host-item-function (host)
  (when host
    (list (list :pre-process-function 'peek-file-host-pre-process
		:host host
		:access nil
		:host-units nil)
	    '(nil)
	    '(nil))))

))

; From modified file DJ: L.WINDOW; PEEK.LISP#208 at 6-Jun-88 17:37:16
#8R TV#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "TV")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: WINDOW; PEEK  "


(defun peek-file-host-pre-process (item)
  (let* ((host (getf (tv:scroll-item-plist item) :host))
	 (access (getf (tv:scroll-item-plist item) :access))
	 (host-units (getf (tv:scroll-item-plist item) :host-units))
	 (new-access (send host :access))
	 (new-host-units (send-if-handles new-access :host-units)))
    (unless (and (eq access new-access) (equal host-units new-host-units))
      (setf (getf (tv:scroll-item-plist item) :access) new-access)
      (setf (getf (tv:scroll-item-plist item) :host-units) new-host-units)
      (setf (cdr (tv:scroll-item-component-items item))
	    (append (send host :peek-file-system-header)
		    (send host :peek-file-system))))))

))
