When MLWorks identifies an error in an ML file, one of the options it makes available is to load the file into your chosen editor at the line containing the error. To specify the editor you want to use, select Usage > General Preferences > Editor ... from the menu bar. The resulting dialog gives you several ways of specifying an editor:
emacsclient
.) Errors discovered by MLWorks are highlighted in the Emacs buffer.
env/emacs
file, under the directory where MLWorks is installed, into the file .emacs
in your home directory. The MLWorks distribution also includes an sml-mode for Emacs. See the README
file in the lib/emacs/lisp/
directory for information.
M-x mlworks-server
in Emacs.
%l
, MLWorks will substitute an appropriate line number.
Note: Your choice of editor, like other settings and preferences selected from the Usage menu, can be saved by selecting Usage > Save Preferences. MLWorks writes the details of your preferences to a file called .mlworks_preferences
in your home directory. The preferences file will be read in on starting subsequent MLWorks images.
Suppose that, having set your editor to something acceptable, you invoke File > Read Into Listener to run a file which contains an error. MLWorks reports the error in the listener, and brings up the error browser.
MLWorks> use "error.sml"; val it : unit = () Use: error.sml error.sml:3,9 to 3,11: error: Unbound value boo
All errors in the first erroneous declaration in the file will be found, and they may be browsed in the usual way. The actions available are the same as when any error is encountered, with one exception: the Edit button on the error browser will start up your chosen editor, passing it the line number containing the error currently selected in the error browser.
Alternatively, you can position the cursor on the line in the listener where the location of the error is given, and select Edit > Edit Error. Again, MLWorks will start up your chosen editor at the line containing the error. This method allows you to edit a file containing an error even when you have switched off error browsers.
Editor settings and preferences can be controlled programmatically by the Shell.Editor
and Shell.Options.Preferences
structures. For full details, see the MLWorks Reference Manual.
Generated with Harlequin WebMaker