load-file in editor<%>
Loads a file into the editor and returns #t. If an error
occurs, an exception is raised.
The filename used to load the file can be retrieved with
get-filename. For a text% instance, the format can be
retrieved with
get-file-format. However, if an error occurs while loading the file, the filename
is set to #f.
See also
on-load-file,
after-load-file,
can-load-file?, and
set-load-overwrites-styles.
(-> booleansendan-editorload-filefilenameformatshow-errors?)
filename=#f: path or#f
format='guess: symbol in'(guess standard text text-force-cr same copy)
show-errors?=#t: booleanIf
filenameis#f, then the internally stored filename will be used; iffilenameis""or if the internal name is unset or temporary, then the user will be prompted for a name.The possible values for
formatare listed below. A single set offormatvalues are used for loading and saving files:'guess-- guess the format based on extension and/or contents; when saving a file, this is the same as'standard'standard-- read/write a standard file (binary format)'text-- read/write a text file (text%only)'text-force-cr-- read/write a text file (text%only); when writing, change automatic newlines (from word-wrapping) into real carriage returns'same-- read in whatever format was last loaded or saved'copy-- write using whatever format was last loaded or saved, but do not change the modification flag or rememberfilename(saving only)
In a
text%instance, the format returned fromget-file-formatis always one of'standard,'text, or'text-force-cr.The
show-errors?argument is no longer used.