opening a locked teaching language file now works properly

svn: r7772

original commit: ac98c07210b1bbe3e4ced080b155f05ceb2c995f
This commit is contained in:
Robby Findler 2007-11-19 22:52:19 +00:00
parent 3d5a3d7fd9
commit e57868835a

View File

@ -880,7 +880,8 @@ WARNING: printf is rebound in the body of the unit to always
(define file<%>
(interface (editor:file<%> basic<%>)
get-read-write?))
get-read-write?
while-unlocked))
(define file-mixin
(mixin (editor:file<%> basic<%>) (file<%>)
@ -896,6 +897,15 @@ WARNING: printf is rebound in the body of the unit to always
#t)])
(set! read-write? can-edit?)))
(define/public (while-unlocked t)
(let ([unlocked? 'unint])
(dynamic-wind
(λ ()
(set! unlocked? read-write?)
(set! read-write? #t))
(λ () (t))
(λ () (set! read-write? unlocked?)))))
(define/augment (can-insert? x y)
(and read-write? (inner #t can-insert? x y)))
(define/augment (can-delete? x y)