The sourcefile argument must be the filename of the source file to be edited or listed. If the source file does not exist then the contents of the MPATROL_SOURCEPATH environment variable will be used to help locate the source file, even if the filename contained an absolute or relative path component. This environment variable should consist of a colon-separated list of directory names which may contain absolute paths or be relative to the current directory; the first directory in the list will be searched first. If the MPATROL_SOURCEPATH environment variable is not set then only the current directory will be searched.
If the linenumber argument is omitted then it is assumed to be 1. The text editor will attempt to jump to the specified line after opening the source file. The text editor that mpedit uses is controlled by setting the EDITOR environment variable. This can be set to the full pathname of the text editor to use or it can be set to the command that would normally be used to invoke the text editor, but it cannot also contain command line options.
The currently supported editors are vi, vim, elvis, emacs, xemacs, pico and nano, and if the EDITOR environment variable is not set then the default will be vi. Selecting an unsupported text editor will result in an error. However, you can edit the mpedit file to add support for your own favourite text editor as long as it supports a way to immediately jump to a specific line number when it is first started up. Note that the text editor must also open a new window to edit the source file so that it does not obscure any mpatrol diagnostic messages, and if it does not support this then a new terminal window must be opened for it to use.
If the --listing option is given on the command line then the mpedit command will display a context listing of the source file at the specified line number to the standard error output stream instead of invoking the text editor. The listing will be annotated with line numbers and will also show the contents of the five lines before and after the specified line if possible.
The mpatrol manual and reference card.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.