handler:edit-file in Framework Functions
(handler:edit-file-> (or/c false/c (is-a?/c frame:editor<%>))filenamemake-default)
filename: (or/c path? false/c)
make-default=(λ () ((handler:current-create-new-window) filename)): (-> (is-a?/cframe:editor<%>))This function creates a frame or re-uses an existing frame to edit a file.
If the preference
'framework:open-hereis set to#t, and (send (group:get-the-frame-group)get-open-here-frame) returns a frame, theopen-heremethod of that frame is used to load the file in the existing frame.Otherwise, it invokes the appropriate format handler to open the file (see
handler:insert-format-handler).If
filenameis a string, this function checks the result ofgroup:get-the-frame-groupto see if thefilenameis already open by a frame in the group.If so, it returns the frame.
If not, this function calls
handler:find-format-handlerwithfilename.If a handler is found, it is applied to
filenameand it's result is the final result.If not,
make-defaultis used.
If
filenameis#f,make-defaultis used.