adjust uses of after-load-file to use the success? flag

(cherry picked from commit fcc720f43e)
This commit is contained in:
Robby Findler 2011-10-08 10:42:32 -05:00 committed by Eli Barzilay
parent c993d856d5
commit fcd5fb9d74
2 changed files with 19 additions and 17 deletions

View File

@ -1519,7 +1519,7 @@
(inner (void) after-delete start end)) (inner (void) after-delete start end))
(define/augment (after-load-file success?) (define/augment (after-load-file success?)
(buffer-modified) (when success? (buffer-modified))
(inner (void) after-load-file success?)) (inner (void) after-load-file success?))
(super-new))) (super-new)))

View File

@ -295,10 +295,11 @@
(define/augment (after-load-file success?) (define/augment (after-load-file success?)
(inner (void) after-load-file success?) (inner (void) after-load-file success?)
(set! ranges (make-hash)) (when success?
(set! ranges-low 0) (set! ranges (make-hash))
(set! ranges-high 0) (set! ranges-low 0)
(set! ranges-list #f)) (set! ranges-high 0)
(set! ranges-list #f)))
(define/public (highlight-range start end color [caret-space? #f] [priority 'low] [style 'rectangle]) (define/public (highlight-range start end color [caret-space? #f] [priority 'low] [style 'rectangle])
(unless (let ([exact-pos-int? (unless (let ([exact-pos-int?
@ -1816,18 +1817,19 @@
(mixin ((class->interface text%)) (crlf-line-endings<%>) (mixin ((class->interface text%)) (crlf-line-endings<%>)
(inherit get-filename use-file-text-mode) (inherit get-filename use-file-text-mode)
(define/augment (after-load-file success?) (define/augment (after-load-file success?)
(cond (when success?
[(preferences:get 'framework:always-use-platform-specific-linefeed-convention) (cond
(use-file-text-mode #t)] [(preferences:get 'framework:always-use-platform-specific-linefeed-convention)
[else (use-file-text-mode #t)]
(define unix-endings? [else
(with-handlers ((exn:fail:filesystem? (λ (x) #t))) (define unix-endings?
(call-with-input-file (get-filename) (with-handlers ((exn:fail:filesystem? (λ (x) #t)))
(λ (port) (call-with-input-file (get-filename)
(regexp-match? unix-line-endings-regexp port))))) (λ (port)
(use-file-text-mode (regexp-match? unix-line-endings-regexp port)))))
(and (eq? (system-type) 'windows) (use-file-text-mode
(not unix-endings?)))]) (and (eq? (system-type) 'windows)
(not unix-endings?)))]))
(inner (void) after-load-file success?)) (inner (void) after-load-file success?))
(super-new) (super-new)