Minimum Profit Action Reference
===============================

Minimum Profit _actions_ are editor commands that can be directly
bound to the menu or a key.

about
-----

_About..._

Shows the "About Minimum Profit" information.

build
-----

_Build project..._ (`f2')

Invokes the building of a Make project. If the `Makefile' file exists in the
working directory, all targets are extracted from it and shown in a list dialog
for the user to select one. The selected one will be called as the only argument
for the `make' program and its output read. All output will be catched and shown
in a read-only document. Compiler errors and warnings will be highlighted and
can be navigated by using the `seek_next' and `seek_prev' actions (keys `f3' and
`ctrl-f3'). The `open_under_cursor' action can be used to edit each error or warning.

close
-----

_Close_ (`ctrl-w')

Closes the active document. If there are unsaved changes, a confirmation dialog
is shown.

close_all
---------

_Close all_

Closes all open documents.

complete
--------

_Complete..._ (`ctrl-u')

Takes the (probably partial) word under the cursor and searches for words in
the current document that start with it. If more than one is found, a list dialog
is shown to make a selection. The word will be replaced with the selected one.

complete_symbol
---------------

_Symbol completion..._

Uses a similar approach than the `complete' action, but using the current _tags_
file as the completion list. If no _tags_ file exist in the working directory,
the *ctags* program is invoked to build it.

For other uses of the _tags_ file, see `find_tag'.

config_repeated_words
---------------------

_Search repeated words..._

To be written.

copy_mark
---------

_Copy block_ (`ctrl-c')

Copies the currently selected block to the clipboard.

cut_mark
--------

_Cut block_ (`ctrl-x')

Copies the currently selected block to the clipboard and deletes the block.

delete
------

_Delete character_ (`delete')

Delete the character over the cursor.

delete_left
-----------

_Delete character to the left_ (`backspace')

Deletes the character to the left of the cursor.

delete_line
-----------

_Delete line_ (`ctrl-y')

Deletes the line under the cursor.

document_list
-------------

_Document list_

Shows a dialog with the list of currently open documents. The list cursor will
be over the active one and the documents with pending modifications will be
prefixed with an asterisk. Selecting a different one will make it become the
active.

encoding
--------

_Set charset encoding..._

Shows a dialog asking for a string describing the charset encoding that will
be used when saving or opening new documents. If an empty string is entered,
the current locale will be used. the following set of character encodings are
always available:

 * utf8.
   Aliases are utf-8, UTF8 and UTF-8.
 * iso8859-1.
   Aliases are iso-8859-1, ISO-8859-1, ISO8859-1, latin1, latin-1, LATIN1 and LATIN-1.
 * utf16 (with endianness detection on input and local endianness on output).
   Aliases are utf-16, UTF16, UTF-16, ucs-2, UCS2, UCS-2.
 * utf16be (big endian).
   Aliases are utf-16be, UTF16BE, UTF-16BE, ucs2be, UCS2BE, ucs-2be and UCS-2BE.
 * utf16le (little endian).
   Aliases are utf-16le, UTF16LE, UTF-16LE, ucs2le, UCS2LE, ucs-2le and UCS-2LE.
 * utf32 (with endianness detection on input and local endianness on output).
   Aliases are utf-32, UTF32, UTF-32, ucs-4, ucs4, UCS-4 and UCS4.
 * utf32be (big endian).
   Aliases are utf-32be, UTF32BE, UTF-32BE, ucs4be, UCS4BE, ucs-4be and UCS-4BE.
 * utf32le (little endian).
   Aliases are utf-42le, UTF42LE, UTF-42LE, ucs4le, UCS4LE, ucs-4le and UCS-4LE.

If the 'iconv' library is available, there can be many more encodings.

eval
----

_Execute MPSL code..._ (`escape')

Shows a dialog asking for a string of MPSL code that will be executed.

eval_doc
--------

_Execute document as MPSL_

Executes the active document as MPSL code.

exec_command
------------

_Run system command..._

Shows a dialog asking for a system command to execute. If the command is
preceded by the pipe symbol (|), the active document will be fed as the
standard input of the command; otherwise, the standard output of the command
will be inserted in the cursor position.

exit
----

_Exit_ (`ctrl-q')

Closes all documents and exists Minimum Profit.

find_tag
--------

_Search tag..._ (`ctrl-t')

Shows a dialog asking for a tag to search. The _tags_ file will be read from
the working directory and the tag searched there; all symbols starting with it
will be shown in a list dialog. When selecting a tag from that list, the file
containing it will be open and the cursor moved to where the tag is.
This is a useful way of finding where a function or variable is defined.

If no _tags_ file exist in the working directory, the *ctags* program is
invoked to build it.

For other uses of the _tags_ file, see `complete_symbol'.

goto
----

_Go to line..._ (`ctrl-g')

Shows a dialog asking for a line number. If accepted, the current document
cursor will move to that line (if existent).

grep
----

_Grep (find inside) files..._

Shows a dialog asking for a string to be searched, and an optional spec of
files to search the string in. If no spec is given, all files in the working
directory are scanned. Matches are shown in a read-only document, and each
match can be directly open by using the 'open_under_cursor' action.

This is a useful way to find where a function or variable is used.

help
----

_Help on word over cursor_ (`f1')

Picks the word under the cursor and asks the underlying system for help
about that term.

ignore_last_misspell
--------------------

_Ignore last misspelled word_

Ignores the last misspelled word found by `seek_misspelled' by adding it
to a whitelist so it won't be found again.

insert_line
-----------

_Insert line_ (`enter')

Inserts a new line. If the cursor is in the middle of a line,
it's split in two.

insert_space
------------

_Insert space_ (`space')

Inserts a space, triggering word wrapping, if active.

insert_tab
----------

_Insert tab_ (`tab')

Inserts a tabulator, triggering word wrapping, if active.

insert_template
---------------

_Insert template..._

Shows a list dialog with the names of the templates for the user to
select one, that will be inserted in the cursor position.

join_paragraph
--------------

_Join a paragraph in one line_

Joins the text from the cursor position to the next empty line as one
paragraph.

line_options
------------

_Line options..._

Shows a dialog asking for line configuration options, like word wrapping,
end of line string, etc.

load_session
------------

_Load session_

Loads a session, previously saved by `save_session'.

mark
----

_Mark beginning/end of block_ (`f9')

Marks the beginning or the end of the block.

mark_vertical
-------------

_Mark vertical block_ (`ctrl-b')

Marks the beginning or the end of a vertical (also known as
rectangular) block.

menu
----

_Menu_ (`ctrl-a')

Calls the menu.

mouse_drag_mark
---------------

_Mark using mouse dragging_ (`mouse-drag')

This action is called by the underlying driver when the mouse is used to drag
over text. It must not be called nor bound to a key.

move_bof
--------

_Beginning of document_ (`ctrl-home')

Moves the cursor to the beginning of the document (first line, first column).

move_bol
--------

_Beginning of line_ (`home')

Moves the cursor to the beginning of the current line (first column).

move_down
---------

_Line down_ (`cursor-down')

Moves the cursor to the next line.

move_eof
--------

_End of document_ (`ctrl-end')

Moves the cursor to the last line of the document.

move_eol
--------

_End of line_ (`end')

Moves the cursor to the end of the current line.

move_left
---------

_Character left_ (`cursor-left')

Moves the cursor one character to the left. If it's in the beginning of
a line, moves to the last character of the previous line.

move_mouse_wheel_down
---------------------

_Mouse wheel down_ (`mouse-wheel-down')

Moves the cursor four lines down.

move_mouse_wheel_up
-------------------

_Mouse wheel up_ (`mouse-wheel-up')

Moves the cursor four lines up.

move_pgdn
---------

_Page down_ (`page-down')

Moves the cursor a page down.

move_pgup
---------

_Page up_ (`page-up')

Moves the cursor a page up.

move_right
----------

_Character right_ (`cursor-right')

Moves the cursor one character to the right. If it's over the end of
the line, moves to the first character of the next line.

move_to_mouse_position
----------------------

_Move cursor to mouse click_ (`mouse_left_button', `mouse_right_button', `mouse-middle-button')

Moves the cursor to where the mouse is. This action is called by the
underlying system and must not be directly called nor bound to a key.

move_up
-------

_Line up_ (`cursor-up')

Moves the cursor to the previous line.

move_word_left
--------------

_Word left_ (`ctrl-cursor-left')

Moves the cursor to the beginning of the previous word.

move_word_right
---------------

_Word right_ (`ctrl-cursor-right')

Moves the cursor to the beginning of the next word.

new
---

_New_

Creates a new unnamed document.

next
----

_Next_ (`ctrl-n')

Select the next document as the active one. The list of documents
is circular; if the active one is the last, the first one is selected.

open
----

_Open..._ (`ctrl-o')

Shows a dialog to open a file. Its behaviour and look are system-dependent.

If the document to be opened is password-protected, a dialog asking for the
password will also appear.

open_config_file
----------------

_Edit configuration file_

Opens the user configuration file for editing. It doesn't have to exist.

open_templates_file
-------------------

_Edit templates file_

Opens the templates file for edition. Templates defined here can be later
inserted by calling `insert_template'. See the `mp_templates.sample' file
included in the documentation for an example of the accepted format.

open_under_cursor
-----------------

_Open file under cursor_ (`ctrl-enter')

Picks the word in the current document under the cursor, accepts it as
a document name and tries to open it. If it's in the format string:number,
is accepted as a file name and a line number.

paste_mark
----------

_Paste block_ (`ctrl-v')

Pastes the text in the clipboard into the cursor position.

play_macro
----------

_Play macro_ (`f7')

Replays all keystrokes recorded during the previous _learning mode_,
activated by a call to `record_macro'.

prev
----

_Previous_

Select the previous document as the active one. The list of documents
is circular; if the active one is the first, the last one is selected.

record_macro
------------

_Record macro_ (`f10')

Toggles _learning mode_. When active, all keystrokes are recorded to
further execute them by a call to `play_macro'.

redo
----

_Redo_

Redoes the previously undone operation, if any.

replace
-------

_Replace..._ (`ctrl-r')

Shows the search and replace dialog box.

revert
------

_Revert_

Reverts the active document to the state on disk.

save
----

_Save..._ (`ctrl-s')

Saves the active document. If it's unnamed, `save_as' is called instead.

save_as
-------

_Save as..._

Shows a dialog asking for a file name to save the current document as.
Its behaviour and look are system-dependent.

save_session
------------

_Save session_

Saves all documents and its positions as a session to be later loaded
by `load_session'.

section_list
------------

_Section list..._ (`ctrl-d')

Shows a list with the sections found in the current document. Selecting
one of them moves the cursor there.

seek
----

_Search text..._ (`ctrl-f')

Shows the search text dialog.

seek_misspelled
---------------

_Search misspelled word_ (`f5')

Searches for the next misspelled word in the current document. If one
is found, the cursor is moved there. If it's a false positive, the
`ignore_last_misspell' action can be called to add the recently found
word to a whitelist so it won't be found again.

seek_next
---------

_Search next_ (`f3')

Searches the next occurrence of the string entered by the `seek' action.

seek_next_char
--------------

_Move to next instance of current char_ (`ctrl-page-down')

Searches for the next occurrence of the char under the cursor. This is
useful, for instance, to jump to the next paren or brace.

seek_prev
---------

_Search previous_ (`ctrl-f3')

Same as `seek_next', but searching backwards.

seek_prev_char
--------------

_Move to previous instance of current char_ (`ctrl-page-up')

Searches for the previous occurrence of the char under the cursor. This is
useful, for instance, to jump to the previous paren or brace.

seek_repeated_word
------------------

_Search repeated word_ (`f6')

Searches for repeated words. Controlled by the configuration directives
`mp.config.rw_num_chars' and `mp.config.rw_max_dist'. A searching is done
from the cursor position trying to find two words nearer from each
other up to a maximum of the specified distance and that start or
end with the same letters. If a pair is found, the words are
highlighted as spelling errors and the cursor moved over the first
one. Otherwise, a message marking the end is shown and nothing is done.

set_password
------------

_Password protect..._

Shows a dialog asking (twice) for a password to protect the active document with
when it's saved. From that moment on, each time the document is tried to open
the password will be asked for.

Minimum Profit encrypts documents using a variant of the ARCFOUR algorithm.

sync
----

_Save modified texts_

Saves all texts with pending modifications.

tab_options
-----------

_Tab options..._

Shows a dialog asking for tabulator configuration options, like tab size,
convert to spaces, etc.

toggle_spellcheck
-----------------

_Toggle spellchecking_

toggles spellchecking. When active, misspelled words will be shown underlined.

undo
----

_Undo_ (`ctrl-z')

Undoes the last operation.

unmark
------

_Unmark block_ (`f8')

Unmarks the selected block.

word_count
----------

_Count words_

Counts the number of words and lines in the active document.

word_wrap_paragraph
-------------------

_Word-wrap a paragraph_ (`f4')

Rebuilds the text from the cursor position to the following empty
line using the wordwrapping setup. Wordwrapping must be set (see
`line_options').

zoom_in
-------

_Bigger font_ (`f12')

Selects a bigger font (only for GUIs).

zoom_out
--------

_Smaller font_ (`f11')

Selects a smaller font (only for GUIs).


----
Angel Ortega <angel@triptico.com>
