
4.8 Editor support: The Editor structure
Shell.Editor.Custom
val addConnectDialog: (string * string * string list)
-> unit
addConnectDialog (name, dialog-name, commands) -> ()
unit
"Emacs" for Emacs or "DDE" for DDE.
"Emacs""Emacs", this socket-based dialog provides a general way to talk to editors. However, only a few editors can accept commands in this way. If the ordinary Emacs server behavior does not quite meet your needs, you could change specify a different dialog string. To use this method you must still set up a copy of Emacs to be a server, using the procedure described in Chapter 1 of the MLWorks User's Guide.
"DDE"
let
val find_file = "(find-file \"%f\")"
val goto_line = "(goto-line %sl)"
val fwd_char = "(forward-char %sc)"
val highlight = "(mlworks-highlight %sl %sc %el %ec)"
val raise_win = "(raise-this-window)"
val full_dialog = [find_file, goto_line, fwd_char,
highlight, raise_win]
in
Shell.Editor.Custom.addConnectDialog("My Emacs",
"Emacs",
full_dialog)
end
The Windows editor PFE could be defined by:
let val DDE_service = "PFE32" val DDE_topic = "Editor" val file_open = "[FileOpen(\"%f\")]" val file_visit = "[FileVisit(\"%f\")]" val goto_line = "[EditGotoLine(%sl,0)]" val fwd_char = "[CaretRight(%sc,0)]" val highlight = "[EditGotoLine(%el,1)][CaretRight(%ec,1)]" val edit_dialog = [file_open, goto_line, fwd_char, highlight] val DDE_dialog = DDE_service :: DDE_topic :: edit_dialogConnect dialog strings can use the following codes:in Shell.Editor.Custom.addConnectDialog("PFE32", "DDE", DDE_dialog) end
%f
%l and %sl
%c and %sc
%el
%ec
%% for the literal %.

Generated with Harlequin WebMaker