			Edit
			A simple text editor for ROX
			by Thomas Leonard


BRIEF

Edit is a simple text editor written in python. You do not need to compile it before using it, but you will require ROX-Lib2:

	http://rox.sourceforge.net/rox_lib.html

To run, click on Edit's icon in a filer window. No installation is required, but you can copy it anywhere you want using the filer...

To load a file into Edit, drop the file onto the Edit icon in a ROX-Filer window or panel.

INSTRUCTIONS

To start Edit, either click on its icon in a filer window or drag a file onto it. A window appears with a small toolbar and a text area showing the file. The tools are:

Close
	Close the window
Up
	Open a ROX-Filer window showing the file
Save
	Open a ROX savebox - drag to a ROX-Filer window to save
Search
	Open the interactive search minibuffer at the bottom of the window
Search and Replace
	Open the search and replace dialog box (see below)
Undo
	Back one change
Redo
	Forward one change (undoes undo operations)
Diff
	Show changes since the file was saved (see below)
Help
	Show the help files

You can right-click on the window for a menu.

COPY AND PASTE

You can copy a piece of text to the `clipboard' (which is invisible) by selecting it and then pressing Ctrl-C. You can paste text from the clipboard by pressing Ctrl-V (you can also use the Edit menu). The clipboard is shared by all applications, so you can use this to transfer text between programs. However, if you quit the application which 'owns' the clipboard (the last program you did Ctrl-C in), then the clipboard is lost.

A faster alternative mechanism is the 'primary selection'. You can click the middle mouse button to insert the currently selected text (from any application). This mechanism is entirely separate from the clipboard, but is also widely supported.

Tip: to insert the pathname of a file (rather than its contents, which you would do with drag-and-drop), select the file in ROX-Filer and click the middle button at the point in the text where you want to insert it.

SEARCHING

To search, click on the Search toolbar icon, or choose Edit->Search... from the popup menu. As you type, the next match is highlighted. Press the Down arrow to move to the next match, or the Up arrow to search backwards for the previous match.

SEARCH AND REPLACE

Enter some text to search for in the 'Replace' box and enter the text to replace it with in the 'With:' box. For example, to update all your copyright notices:

	Replace: Copyright 2002
	With: Copyright 2003

Sometimes you need more flexibility. For example, you may wish to search for all four digit numbers, or for spaces at the beginning of a line. In that case, you'll need to turn on the 'Advanced' check box. When you do this, some characters take on special meanings. A quick-reference table will appear listing them, and some examples.

You can now do things like this:

	Replace: Copyright \d{4}
	With: Copyright 2003

`\d' means `any digit', and `{4}' means to match four of them. So, this will find 'Copyright 2002', 'Copyright 1997', etc, and change them all to Copyright 2003.

The 'With:' box also allows some special characters, allowing you to refer back to bracketed parts of the match. For example:

	Replace: ^(\d+) (\S+)$
	With: \2 \1

This looks for lines starting with one or more digits, then a space, and then one or more non-spaces at the end of the line. The part matched by the (\d+) becomes group 1, and the (\S+) bit is group 2, due to the brackets. The replacement text then switches them around, so:

	1234 Mary
	876 Bob
becomes
	Mary 1234
	Bob 876

(if you want to ignore spaces at the start of the line, use: ^\s*...)
Finally, if your needs are really complicated, you can turn on the 'Python expression' checkbox. In this case, instead of inserting the 'With:' text directly, it will be evaluated as a formula (a Python expression). For example:

	Replace: \b[A-Z][a-z]+\b
	With: old.upper()

This finds all complete words starting with an uppercase letter and followed by at least one lowercase letter, and converts them to uppercase (so "Where are Mary and Bob?" becomes "WHERE are MARY and BOB?").
Likewise, consider:

	Replace: \d+\+\d+
	With: eval(old)

This searches for two strings of digits separated by a "+" (the \ is needed so that + doesn't get it's special meaning of `one or more'), and evaluates the matched text as a Python expression itself. So:

	What is 5+2, 3+5 or 1+1?
becomes:
	What is 7, 8 or 2?

OPTIONS

From the popup menu, you can open the Options box. This lets to choose the font, colours and spacings to use, and control the auto-indent feature.

SHOW CHANGES

When editing a file, you can compare it to the saved version by clicking on the Show Changes toolbar button, or by choosing File->Show Changes from the menu.

The window that appears shows each part of the file that changed. Red lines were deleted and green lines were added (if a line was changed, there will be a red line for the old version followed by a green line for the new one). White lines are context (lines which didn't change, but help to show where the change was). Each section has a grey header showing the line numbers of the changes.

All the colours can be changed in the options box.

You can also compare the current file with an older backup (or any other file) by dragging the backup file to the 'Show Changes' toolbar button.

CONDITIONS

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Please report any bugs to the mailing list:

	http://rox.sourceforge.net/phpwiki/index.php/MailingLists
