1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4 <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
6 <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2 (Linux)">
7 <META NAME="CREATED" CONTENT="20071206;23050600">
8 <META NAME="CHANGEDBY" CONTENT="Lee Page">
9 <META NAME="CHANGED" CONTENT="20071231;15203900">
10 <STYLE TYPE="text/css">
12 @page { size: 8.5in 11in; margin: 0.79in }
13 P { margin-bottom: 0.08in }
14 H1 { margin-bottom: 0.08in; color: #0000aa; font-family: "trebuchet ms", "arial" }
15 H2 { margin-bottom: 0.08in }
16 H2.western { font-family: "Nimbus Sans L", sans-serif; font-size: 14pt; font-style: italic }
17 H2.cjk { font-size: 14pt; font-style: italic }
18 H2.ctl { font-size: 14pt; font-style: italic }
22 <BODY LANG="en-US" DIR="LTR">
23 <H1>Minimum Profit Function Reference</H1>
24 <P> Lee Page <lrpage AT mindspring POINT com></P>
27 <TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>
33 <LI><P ALIGN=LEFT><A HREF="#Clipboard">Clipboard
34 (mp_clipboard.mpsl)</A></P>
35 <LI><P ALIGN=LEFT><A HREF="#Core">Core (mp_core.mpsl)</A></P>
36 <LI><P ALIGN=LEFT><A HREF="#Crypt">Crypt (mp_crypt.mpsl)</A></P>
37 <LI><P ALIGN=LEFT><A HREF="#Editor Action">Editor Actions
39 <LI><P ALIGN=LEFT><A HREF="#Editor">Editor (mp_edit.mpsl)</A></P>
40 <LI><P ALIGN=LEFT><A HREF="#File">File (mp_file.mpsl)</A></P>
41 <LI><P ALIGN=LEFT><A HREF="#Keys">Keys (mp_keyseq.mpsl)</A></P>
42 <LI><P ALIGN=LEFT><A HREF="#Macros">Macros (mp_macro.mpsl)</A></P>
43 <LI><P ALIGN=LEFT><A HREF="#Misc">Misc. (mp_misc.mpsl)</A></P>
48 <LI><P ALIGN=LEFT><A HREF="#Movement">Movement (mp_move.mpsl)</A></P>
49 <LI><P ALIGN=LEFT><A HREF="#Search">Search (mp_search.mpsl)</A></P>
50 <LI><P ALIGN=LEFT><A HREF="#Sessions">Sessions (mp_session.mpsl)</A></P>
51 <LI><P ALIGN=LEFT><A HREF="#Spell">Spell (mp_ispell.mpsl)</A></P>
52 <LI><P ALIGN=LEFT><A HREF="#Syntax Highlighting">Syntax
53 Highlighting (mp_syntax.mpsl)</A></P>
54 <LI><P ALIGN=LEFT><A HREF="#Tags">Tags (mp_tags.mpsl)</A></P>
55 <LI><P ALIGN=LEFT><A HREF="#Templates">Templates
56 (mp_templates.mpsl)</A></P>
57 <LI><P ALIGN=LEFT><A HREF="#TUI">TUI (mp_tui.mpsl)</A></P>
62 <H2 CLASS="western"><A NAME="Clipboard"></A>Clipboard
63 (mp_clipboard.mpsl)</H2>
64 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
69 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.unmark(doc)</FONT></PRE>
72 <P>Unmarks the block.</P>
77 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.mark(doc)</FONT></PRE>
80 <P>Marks the start or end of the block.</P>
85 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.get_active_area(doc)</FONT></PRE>
88 <P>Returns the active area: the selection, or the full document.</P>
93 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.copy(doc)</FONT></PRE>
96 <P>Copies the mark to the clipboard.</P>
101 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.delete_mark(doc)</FONT></PRE>
104 <P>Deletes current selection.</P>
109 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.cut(doc)</FONT></PRE>
112 <P>Cut (copy + delete) selected mark.</P>
117 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.paste(doc)</FONT></PRE>
120 <P>Pastes from the clipboard to the cursor position.</P>
124 <H2 CLASS="western"><A NAME="Core"></A>Core (mp_core.mpsl)</H2>
125 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
130 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.active()</FONT></PRE>
133 <P>Returns the active document.</P>
138 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.process_action(a)</FONT></PRE>
141 <P>Processes an action.</P>
146 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.process_event(k)</FONT></PRE>
149 <P>Processes a key event.</P>
154 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.build_status_line()</FONT></PRE>
157 <P>Returns the string to be drawn in the status line.</P>
162 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.backslash_codes(s, d)</FONT></PRE>
165 <P>Encodes (d == 0) or decodes (d == 1) backslash codes.</P>
170 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.long_op(func, a1, a2, a3)</FONT></PRE>
173 <P>Executes a potentially long function (sets as busy).</P>
178 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.get_history(key)</FONT></PRE>
181 <P>Returns a history for the specified key.</P>
186 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.menu_label(action)</FONT></PRE>
189 <P>Returns a label for the menu for an action.</P>
194 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.usage()</FONT></PRE>
197 <P>Set mp.exit_message with a usage message (--help).</P>
202 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.process_cmdline()</FONT></PRE>
205 <P>Process the command line arguments (ARGV).</P>
210 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.load_profile()</FONT></PRE>
213 <P>Loads <FONT FACE="Courier, monospace">~/.mp.mpsl</FONT>.</P>
218 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.normalize_version(vs)</FONT></PRE>
221 <P>Converts a version string to something usable with <FONT FACE="Courier, monospace">cmp()</FONT>.</P>
226 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.assert_version(found, minimal, package)</FONT></PRE>
229 <P>Asserts that 'found' version of 'package' is at least
230 'minimal', or generate a warning otherwise.</P>
235 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.test_versions()</FONT></PRE>
238 <P>Tests component versions.</P>
242 <H2 CLASS="western"><A NAME="Crypt"></A>Crypt (mp_crypt.mpsl)</H2>
243 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
248 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.arcfour_byte()</FONT></PRE>
251 <P>Gets next ARCFOUR byte next char is <FONT FACE="Courier, monospace">chr(ord(getchar(l))
252 ^ mp.arcfour_byte())</FONT>.</P>
257 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.arcfour_init(key)</FONT></PRE>
260 <P>Initializes an ARCFOUR cypher.</P>
265 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.crypt1_load(fd, password)</FONT></PRE>
268 <P>Loads a crypt1 encrypted file into lines.</P>
273 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.crypt1_save(fd, lines, password)</FONT></PRE>
276 <P>Saves the lines as a crypt1 encrypted file.</P>
281 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.crypt1_detect(fd)</FONT></PRE>
284 <P>Detects if fd is an mpcrypt1-type file.</P>
288 <H2 CLASS="western"><A NAME="Editor Action"></A>Editor Actions
290 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
295 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.menu()</FONT></PRE>
303 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.clip_to_sys()</FONT></PRE>
311 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.sys_to_clip()</FONT></PRE>
319 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.update_ui()</FONT></PRE>
327 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.timer(msecs,func)</FONT></PRE>
335 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.busy(onoff)</FONT></PRE>
343 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.update_ui()</FONT></PRE>
351 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.alert(msg)</FONT></PRE>
359 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.confirm(msg)</FONT></PRE>
367 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.openfile(prompt)</FONT></PRE>
375 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.savefile(prompt)</FONT></PRE>
383 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.form(widgets)</FONT></PRE>
391 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.timer(msecs,func)</FONT></PRE>
399 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.busy(onoff)</FONT></PRE>
406 <H2 CLASS="western"><A NAME="Editor"></A>Editor (mp_edit.mpsl)</H2>
407 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
412 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.break_line(doc, col)</FONT></PRE>
415 <P>Breaks current line in two (inserts a newline).</P>
420 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.join_line(doc)</FONT></PRE>
423 <P>Joins the current line with the next one.</P>
428 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.delete_line(doc)</FONT></PRE>
431 <P>Deletes the current line.</P>
436 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.delete_char(doc)</FONT></PRE>
439 <P>Deletes the current char.</P>
444 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.delete_range(doc, bx, by, ex, ey)</FONT></PRE>
447 <P>Deletes a range of characters from a document.</P>
452 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.insert_string(doc, str)</FONT></PRE>
455 <P>Inserts a string into the cursor position. Note: newlines are
456 not allowed. You must call <FONT FACE="Courier, monospace">mp.insert_newline()</FONT>
457 to manually insert a newline.</P>
462 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.insert(doc, a)</FONT></PRE>
465 <P>Inserts an array of text into a document.</P>
470 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.wrap_words(doc)</FONT></PRE>
473 <P>Do word wrapping.</P>
478 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.insert_space(doc)</FONT></PRE>
481 <P>Inserts a space, taking word wrapping into account.</P>
486 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.insert_tab(doc)</FONT></PRE>
489 <P>Inserts a tab.</P>
494 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.insert_newline(doc)</FONT></PRE>
497 <P>Inserts a newline.</P>
502 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.insert_keystroke(doc, key)</FONT></PRE>
505 <P>Inserts from a keystroke (with undo).</P>
510 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.store_undo(doc)</FONT></PRE>
513 <P>Stores the current txt in the undo queue.</P>
518 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.undo(doc)</FONT></PRE>
521 <P>Undoes the last operation.</P>
526 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.redo(doc)</FONT></PRE>
529 <P>Redoes the last operation undone.</P>
534 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.join_paragraph(doc)</FONT></PRE>
537 <P>Joins the current paragraph into just one line.</P>
542 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.word_wrap_paragraph(doc)</FONT></PRE>
545 <P>Word wraps current paragraph.</P>
549 <H2 CLASS="western"><A NAME="File"></A>File (mp_file.mpsl)</H2>
550 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
555 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.chomp(str)</FONT></PRE>
558 <P>Chomps the end of file (should this be: end of line?) chars
564 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.open_file_for_reading(filename)</FONT></PRE>
567 <P>The three-state file opening of text editors: open if possible,
568 fail on errors, create new if non-existent. Note: this is a
569 low-level interface. You probably want to use
570 <FONT FACE="Courier, monospace"><FONT SIZE=3>mp.open( filename )</FONT></FONT>.</P>
575 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.save(doc)</FONT></PRE>
583 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.new(filename, lines)</FONT></PRE>
586 <P>Creates a new document.</P>
591 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.next()</FONT></PRE>
594 <P>Rotates through the document list.</P>
599 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.prev()</FONT></PRE>
602 <P>Rotates through the document list, backwards.</P>
607 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.close()</FONT></PRE>
610 <P>Closes the active document.</P>
615 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.find_file_by_name(filename)</FONT></PRE>
618 <P>Finds an open file by its name, returns the index to the file
619 in the document array.</P>
624 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.open(filename)</FONT></PRE>
627 <P>Opens a new document (uses UI). This interface checks to make
628 sure the file isn't already open, as well as checking to see if
629 the file is encrypted. Will prompt for a password if it is
634 <H2 CLASS="western"><A NAME="Keys"></A>Keys (mp_keyseq.mpsl)</H2>
635 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
640 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.pending_key()</FONT></PRE>
649 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.process_keyseq(key)</FONT></PRE>
658 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.add_keyseq(seq, keycode)</FONT></PRE>
666 <H2 CLASS="western"><A NAME="Macros"></A>Macros (mp_macro.mpsl)</H2>
667 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
672 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.process_event_and_record(k)</FONT></PRE>
675 <P>Patched version of <FONT FACE="Courier, monospace">mp.process_event()</FONT>.</P>
680 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.record_macro</FONT></PRE>
683 <P>Start recording a macro.</P>
688 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.play_macro</FONT></PRE>
695 <H2 CLASS="western"><A NAME="Misc"></A>Misc. (mp_misc.mpsl)</H2>
696 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
701 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.dump(v)</FONT></PRE>
704 <P>Overrides the MPSL <FONT FACE="Courier, monospace">dump()</FONT>
705 function, dumping into the active text document.</P>
709 <H2 CLASS="western"><A NAME="Movement"></A>Movement (mp_move.mpsl)</H2>
710 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
715 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move(doc, func)</FONT></PRE>
718 <P>Wrapper for movement functions, with possible shift selection.</P>
723 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.split_by_words(s)</FONT></PRE>
726 <P>Splits a string by words.</P>
731 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.split_line_by_words(doc, r)</FONT></PRE>
734 <P>Splits current line by words and returns a three element array
735 containing the list of words, the list of offsets and the current
741 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.get_word(doc, r)</FONT></PRE>
744 <P>Returns the word under the cursor.</P>
749 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.get_range(doc, bx, by, ex, ey)</FONT></PRE>
752 <P>Gets a range or characters from a document.</P>
757 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.set_x(doc, x)</FONT></PRE>
760 <P>Sets the x position.</P>
765 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.set_y(doc, y)</FONT></PRE>
768 <P>Sets the y position.</P>
773 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_up(doc)</FONT></PRE>
776 <P>Moves one line up.</P>
781 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_down(doc)</FONT></PRE>
784 <P>Moves one line down.</P>
789 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_pgup(doc)</FONT></PRE>
792 <P>Moves one page up.</P>
797 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_pgdn(doc)</FONT></PRE>
800 <P>Moves one page down.</P>
805 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_left(doc)</FONT></PRE>
808 <P>Moves one char left.</P>
813 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_right(doc)</FONT></PRE>
816 <P>Moves one char right.</P>
821 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_bol(doc)</FONT></PRE>
824 <P>Moves to the beginning of the line.</P>
829 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_eol(doc)</FONT></PRE>
832 <P>Moves to the end of the line.</P>
837 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_bof(doc)</FONT></PRE>
840 <P>Moves to the beginning of the file.</P>
845 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_eof(doc)</FONT></PRE>
848 <P>Moves to the end of the file.</P>
853 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_word_left(doc)</FONT></PRE>
856 <P>Moves a word to the left.</P>
861 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_word_right(doc)</FONT></PRE>
864 <P>Moves a word to the right.</P>
869 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.move_to_coords_xy(doc, x, y)</FONT></PRE>
872 <P>Move the cursor to the character on the visual coords x and y.
873 See also: <FONT FACE="Courier, monospace">mp.set_x( doc, x ),
874 mp.set_y( doc, y )</FONT>.</P>
878 <H2 CLASS="western"><A NAME="Search"></A>Search (mp_search.mpsl)</H2>
879 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
884 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.prefix_regex(str)</FONT></PRE>
887 <P>Set str to be a valid regex.</P>
892 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.search_dir(doc, str, dir)</FONT></PRE>
895 <P>Search str and put the current position there, with direction.</P>
900 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.search(doc, str)</FONT></PRE>
903 <P>Search str and put the current position there, downwards.</P>
908 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.search_back(doc, str)</FONT></PRE>
911 <P>Search str and put the current position there, backwards.</P>
916 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.replace_1(doc, this, that)</FONT></PRE>
919 <P>Searches 'this' and replaces it with 'that', once.</P>
924 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.replace(doc, this, that)</FONT></PRE>
927 <P>Replaces 'this' with 'that', may be globally.</P>
932 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.seek_prev_or_next_char(doc, func)</FONT></PRE>
935 <P>Moves to next or previous occurrence of current char.</P>
940 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.grep(rx, spec)</FONT></PRE>
943 <P>Greps str in the files in spec. Returns NULL if no file matched
944 the <FONT FACE="Courier, monospace">glob()</FONT> (or <FONT FACE="Courier, monospace">glob()</FONT>
945 is unsupported), an empty list if the string was not found or an
946 array with the matches, that are three-element arrays with the
947 file name, the line number and the line that matched.</P>
951 <H2 CLASS="western"><A NAME="Sessions"></A>Sessions (mp_session.mpsl)</H2>
952 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
957 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.session_file()</FONT></PRE>
960 <P>Returns the appropriate session saving file.</P>
965 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.save_session()</FONT></PRE>
968 <P>Saves currently open files as a session. Returns: -1, nothing
969 to save; -2, error saving; or 0, session correctly saved.</P>
974 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.load_session()</FONT></PRE>
977 <P>Loads a session. Returns: -1, no session, -2, user cancellation
978 on closing currently open documents and 0, ok.</P>
982 <H2 CLASS="western"><A NAME="Spell"></A>Spell (mp_ispell.mpsl)</H2>
983 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
988 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.open_ispell_pipe</FONT></PRE>
991 <P>Opens the pipe to ispell.</P>
996 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.close_ispell_pipe</FONT></PRE>
999 <P>Closes the pipe to ispell.</P>
1004 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.ispell_word_color_func(w)</FONT></PRE>
1007 <P><FONT FACE="Courier, monospace">mp.word_color_func()</FONT> for
1013 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.ispell(b)</FONT></PRE>
1016 <P>Sets or unsets spell checking (-1, toggle).</P>
1020 <H2 CLASS="western"><A NAME="Syntax Highlighting"></A>Syntax
1021 Highlighting (mp_syntax.mpsl)</H2>
1022 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
1027 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.syn_token_list(l)</FONT></PRE>
1030 <P>Initializes the language syntax highlighting lists.</P>
1035 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.detect_syntax(doc)</FONT></PRE>
1038 <P>Tries to detect the syntax of a document.</P>
1043 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.help(doc, word)</FONT></PRE>
1051 <H2 CLASS="western"><A NAME="Tags"></A>Tags (mp_tags.mpsl)</H2>
1052 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
1057 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.load_tags(force)</FONT></PRE>
1060 <P>Load a 'tags' file.</P>
1065 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.open_tag(tag)</FONT></PRE>
1068 <P>Opens a tag (interactive).</P>
1073 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.complete(d, list, label)</FONT></PRE>
1076 <P>Completes the current word given a list (interactive).</P>
1080 <H2 CLASS="western"><A NAME="Templates"></A>Templates
1081 (mp_templates.mpsl)</H2>
1082 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
1087 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.read_templates_file()</FONT></PRE>
1090 <P>Reads the <FONT FACE="Courier, monospace">$HOME/.mp_templates</FONT>
1091 file into mp.templates.</P>
1095 <H2 CLASS="western"><A NAME="TUI"></A>TUI (mp_tui.mpsl)</H2>
1096 <TABLE WIDTH=665 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
1101 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.tui.prompt(prompt)</FONT></PRE>
1104 <P>Draw a prompt on screen.</P>
1109 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.tui.readline(prompt, history, default, flags)</FONT></PRE>
1112 <P>The readline function, with special functionality in 'flags'.
1113 Returns the string typed in.</P>
1118 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.tui.list(prompt, data, pos)</FONT></PRE>
1121 <P>Select from a list. Returns the index into data that was
1127 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.alert(msg)</FONT></PRE>
1136 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.confirm(msg, def)</FONT></PRE>
1145 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.openfile(prompt)</FONT></PRE>
1154 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.savefile(prompt)</FONT></PRE>
1163 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.form(widgets)</FONT></PRE>
1172 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.menu()</FONT></PRE>
1181 <PRE><FONT SIZE=2 STYLE="font-size: 9pt">mp.drv.busy(onoff)</FONT></PRE>