@@ -1004,31 +1004,41 @@ was never saved, then the first element of the list is @racket[#f].
1004
1004
1005
1005
(proc-doc/names
1006
1006
handler:edit-file
1007
- (->* ((or/c path? false/c ))
1008
- ((-> (is-a?/c frame:editor<%>)))
1007
+ (->* ((or/c path? symbol? #f ))
1008
+ ((-> (is-a?/c frame:editor<%>))
1009
+ #:start-pos (or/c exact-nonnegative-integer? #f )
1010
+ #:end-pos (or/c exact-nonnegative-integer? #f ))
1009
1011
(or/c false/c (is-a?/c frame:editor<%>)))
1010
1012
((filename)
1011
1013
((make-default
1012
- (λ () ((handler:current-create-new-window) filename)))))
1014
+ (λ () ((handler:current-create-new-window) (and (path? filename) filename))))
1015
+ (start-pos #f )
1016
+ (end-pos start-pos)))
1013
1017
@{This function invokes the appropriate format handler to open the file (see
1014
1018
@racket[handler:insert-format-handler]).
1015
1019
1016
1020
@itemize[
1017
- @item{If @racket[filename] is a string, this function checks the result
1018
- of @racket[group:get-the-frame-group] to see if the
1021
+ @item{If @racket[filename] is a string or a symbol , this function checks the result
1022
+ of @racket[group:get-the-frame-group]'s @method[group:% locate-file] method to see if the
1019
1023
@racket[filename] is already open by a frame in the group.
1020
1024
@itemize[
1021
1025
@item{If so, it returns the frame.}
1022
- @item{If not, this function calls
1026
+ @item{If not and if @racket[filename] is a string , this function calls
1023
1027
@racket[handler:find-format-handler] with
1024
1028
@racket[filename].
1025
1029
@itemize[
1026
1030
@item{If a handler is found, it is applied to
1027
1031
@racket[filename] and its result is the final
1028
1032
result.}
1029
- @item{If not, @racket[make-default] is used.}]}]}
1033
+ @item{If not, @racket[make-default] is used.}]}
1034
+ @item{If the file is not already open by a frame in the group
1035
+ and if @racket[filename] is a symbol,
1036
+ @racket[make-default] is used.}]}
1030
1037
@item{If @racket[filename] is @racket[#f ], @racket[make-default] is
1031
- used.}]})
1038
+ used.}]
1039
+
1040
+ @history[#:changed "1.75 " @list{generalized the @racket[filename] argument to allow
1041
+ symbols and added the @racket[start-pos] and @racket[end-pos] arguments.}]})
1032
1042
1033
1043
(parameter-doc
1034
1044
handler:current-create-new-window
0 commit comments