opening a locked teaching language file now works properly
svn: r7772
This commit is contained in:
parent
0f700b8531
commit
ac98c07210
|
@ -25,10 +25,9 @@
|
|||
(when (equal? lang-spec spec-in-file)
|
||||
(set! found-language? lang)
|
||||
(set! settings (send lang metadata->settings str))
|
||||
(let ([locked? (send text is-locked?)])
|
||||
(when locked? (send text lock #f))
|
||||
(send text delete 0 (send text paragraph-start-position lines))
|
||||
(when locked? (send text lock #t))))))))))
|
||||
(send text while-unlocked
|
||||
(λ ()
|
||||
(send text delete 0 (send text paragraph-start-position lines)))))))))))
|
||||
all-languages)
|
||||
|
||||
;; check to see if it looks like the module language.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user