fixed save recent menu PR
original commit: 7552e963f1e33fcd33390aa26ece89bc998879cf
This commit is contained in:
parent
5750e2f03e
commit
9895e8ac6c
|
@ -92,17 +92,27 @@
|
|||
[super-after-load-file after-load-file])
|
||||
[define last-saved-file-time #f]
|
||||
|
||||
(override after-save-file after-load-file)
|
||||
[define after-save-file
|
||||
[define/override after-save-file
|
||||
(lambda (sucess?)
|
||||
(when sucess?
|
||||
|
||||
;; update recently opened file names
|
||||
(let* ([temp-b (box #f)]
|
||||
[filename (get-filename temp-b)])
|
||||
(unless (unbox temp-b)
|
||||
(when filename
|
||||
(handler:add-to-recent filename))))
|
||||
|
||||
;; update last-saved-file-time
|
||||
(when sucess?
|
||||
(let ([filename (get-filename)])
|
||||
(set! last-saved-file-time
|
||||
(and filename
|
||||
(file-exists? filename)
|
||||
(file-or-directory-modify-seconds filename)))))
|
||||
|
||||
(super-after-save-file sucess?))]
|
||||
[define after-load-file
|
||||
|
||||
[define/override after-load-file
|
||||
(lambda (sucess?)
|
||||
(when sucess?
|
||||
(let ([filename (get-filename)])
|
||||
|
@ -122,15 +132,6 @@
|
|||
(let ([ms (file-or-directory-modify-seconds fn)])
|
||||
(< last-saved-file-time ms))))))]
|
||||
|
||||
(rename [super-on-save-file on-save-file])
|
||||
(define/override (on-save-file filename format)
|
||||
(let* ([temp-b (box #f)]
|
||||
[filename (get-filename temp-b)])
|
||||
(unless (unbox temp-b)
|
||||
(when filename
|
||||
(handler:add-to-recent filename))))
|
||||
(super-on-save-file filename format))
|
||||
|
||||
[define has-focus #f]
|
||||
(rename [super-on-focus on-focus])
|
||||
(override on-focus)
|
||||
|
|
|
@ -683,8 +683,8 @@
|
|||
filter-msg ; file-filter-msg
|
||||
))))
|
||||
|
||||
; the std- and common- forms both have opt-lambda's, with the same
|
||||
; list of args. Should the opt-lambda's be placed in the dispatching function?
|
||||
; the std- and common- forms both have opt-lambda's, with the same
|
||||
; list of args. Should the opt-lambda's be placed in the dispatching function?
|
||||
|
||||
(define std-put-file
|
||||
(opt-lambda ([name #f]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
(module handler mzscheme
|
||||
(require (lib "unitsig.ss")
|
||||
(lib "class.ss")
|
||||
|
|
Loading…
Reference in New Issue
Block a user