#@+leo-ver=5-thin
#@+node:ekr.20100805165051.7177: * @file release_notes.txt
#@@language plain
#@@tabwidth -4
#@+all
#@+node:edream.110203163054.117: ** Previous versions...
#@+node:ekr.20050210102358: *3* 4.0... New read logic eliminates read errors, eliminated child indices
#@+node:edream.110203163054.66: *4* 4.0.1 through 4.0.4
Leo 4.0.4                         October 29, 2003

- Fixed a problem with the titles in Font and Color panels.
- Worked around a Unicode assert failure in the colorizer.
- Fixed crasher in OnEndEditHeadline.
- Fixed import problems in leoPlugins.leo.
- @first and @last sentinels no longer contain corresponding text.
  This fixes a problem that affected PHP comment delimiters.

Leo 4.0.3                         October 25, 2003

- Fixes several problems with the auto_save and plugin menu plugins.
- Fixes a problem with the Go To Line Number command.

Note: This version does _not_ support Unicode file names or directory names.

Leo 4.0.2                         October 23, 2003

- Fixes a crasher in reportBadChars when a .leo file contains a character that
  can not be represented in the encoding specified in the first line of the
  .leo file.
- Leo now sends full tracebacks to the log window when Leo takes an unexpected
 exception.

Leo 4.0.1                         October 22, 2003

- Fixes several crashers, one of which may prevent Leo from starting.
- Fixes indentation for section references that are preceded by something
  other than whitespace.
- Removes debugging traces when reading and writing unknown attributes.
- Removes some improperly cloned nodes from LeoDocs.leo.
- Adds the checkTopologyOfAllClones script.
- Fixes some problems with plugins.
#@+node:edream.110203163054.67: *4* 4.0 final
Leo 4.0 final                     October 17, 2003

More than a year in the making, Leo 4.0 is finally here.

Highlights of 4.0 final:
-----------------------

** Improved and simplified format of external files.
	- Eliminated child indices, extraneous blank lines and @body sentinels.
	- Eliminated @node sentinels that indicate outline structure.
	- New @nl and @nonl sentinels indicate where newlines are and aren't.
	- These changes will largely eliminate unwanted cvs conflicts.

** Greatly improved error handling.
	- Reading external files _never_ alter outline structure or links.
	- Read errors leave the outline completely unchanged.
	- Broken clone links are gone forever.
	- As a result, 4.0 is much safer than all previous versions.

** Full compatibility will previous versions of Leo.
	- Leo 4.0 reads all external files properly, regardless of version.
	- Leo writes new-format external files by default, and this default may be changed.
	- New commands in the read/write menu allow you to explicitly specify the format of external files.

* New commands:
	- Write 3.x external file and Write 4.x external file.
	- Import External File.
	- Clear Recent Files.

* Dozens of other improvements, including:
	- Better Unicode support.
	- New configuration settings.
	- Several new plugins.

See the notes for the various beta releases for full details.
#@+node:edream.110203163054.68: *5* 4.0 beta 4
Leo 4.0 beta 4                      October 13, 2003

This is the third public release of Leo 4.0. There are no known serious bugs in
this version of Leo.  This will be the last beta release before 4.0 final.

Changes made in 4.0 beta 4
--------------------------

- Changed all instances of string.letters to string.ascii_letters.
  string.letters can cause crashes in some locales (Unicode environments).
- Fixed several bugs that caused clone marks not to be set properly.
#@+node:edream.110203163054.69: *5* 4.0 beta 3
Leo 4.0 beta 3                      October 9, 2003

This is the third public release of Leo 4.0. There are no known serious bugs in
this version of Leo.

Highlights of 4.0 beta 3
------------------------

- Fixed problems with setting Leo's window icons.
- Plugins may now save their own information in <v> and <t> elements in .leo files.
- The usual assortment of bug fixes and minor improvements.

See the children of this node for full details.
#@+node:edream.110203163054.70: *6* Fixed bugs
#@+node:edream.110203163054.71: *7* Fixed bug that caused some clones not to be marked as clones
This was a long-standing bug.  It's effect was cosmetic, and it was important to fix.
#@+node:edream.110203163054.72: *7* Corrected problems with setting icons on Linux
#@+node:edream.110203163054.73: *7* Fixed crasher in sentinelName
This could happen when the external file was corrupted.
#@+node:edream.110203163054.74: *7* Reenabled orphans & ignored test in new write logic
#@+node:edream.110203163054.75: *6* New features
#@+node:edream.110203163054.76: *7* Added support for unknown tnode and vnode attributes
Leo can now read and write "foreign" attributes in <v> and <t> elements in .leo
files:

- When reading a .leo file, Leo will create t.unknownAttributes or
v.unknownAttributes ivars for any tnode and vnode object whose corresponding <v>
or <t> element in the .leo file contains a foreign attribute.

- The unknownAttributes ivars are a dictionary whose keys are the attribute
names and whose values are strings.

- When writing a file, Leo will write "foreign" attributes if a vnode or tnode
contains an unknownAttributes ivar.

- The only "native" attributes that Leo expects to find are the "tx" attribute
in <t> elements and the "a", "t", "vtag" and "tnodeList" attributes of <v>
elements. Everything else is a foreign attribute.

- Leo performs the usual xml escapes on these strings when reading or writing
the unknownAttributes ivars.

Plugins may cause Leo to write such foreign attributes simply by attaching
unknownAttributes ivars to a vnode or tnode. For example:

	v.unknownAttributes = {"vnodeIcon" : pathToIcon}

It would be best not to delete other foreign attributes, so the following would
be preferred:

	if hasattr(v,"unknownAttributes"):
		v.unknownAttributes["vnodeIcon"] = pathToIcon
	else:
		v.unknownAttributes = {"vnodeIcon" : pathToIcon}

Another way:

	try:
		v.unknownAttributes["vnodeIcon"] = pathToIcon
	except AttributeError:
		v.unknownAttributes = {"vnodeIcon" : pathToIcon}
#@+node:edream.110203163054.77: *7* Added build number to signon
#@+node:edream.110203163054.78: *7* Added better error message in setDefaultIcon
Leo now warns if it can't find either the Icons directory or the LeoApp16.ico icon in that directory.
#@+node:edream.110203163054.79: *5* 4.0 beta 2
Leo 4.0 beta 2                      October 3, 2003

This is the second public release of Leo 4.0. There are no known serious bugs
in this version of Leo. Version 4.0 is the culmination of over a year of
collaborative design work and several months of actual implementation.

Highlights of 4.0 beta 2
------------------------
* Fixed several bugs:
  - Fixed several problems with reading and writing 4.0 external files.
  - Fixed several Unicode-related bugs.
  - Fixed a crasher in the Go To Line Number command.
  - Fixed a problem with Importing Python files.
* Important improvements:
  - Added allow_clone_drags setting.  N.B. Allows Leo to be used with Aqua.
  - When running Python 2.3 Leo can now create window icons without third-party packages.
- The usual minor improvements and bug fixes.

See the children of this node for full details.

Highlights of 4.0 beta 1
------------------------
* Improved and simplified format of external files.
* Greatly improved error handling.
* Full compatibility will previous versions of Leo.
#@+node:edream.110203163054.80: *6* To-do for 4.0 final
- Fix undo/redo bug for all commands that change body text in multiple nodes without changing outline structure.
	- This is a long-standing bug that came to light when trying to make Read @file Nodes undoable.

- Make Read @file Nodes command undoable.

- Fix small bugs in the Go To Line Number command.
#@+node:edream.110203163054.81: *6* Fixed Bugs
#@+node:edream.110203163054.82: *7* Added crucial defensive checks in v.headString() and v.bodySting()
The new code prints a warning if Leo's key internal strings are not Unicode.
#@+node:edream.110203163054.83: *7* Ensured newlines before all sentinels in @rawfile
#@+node:edream.110203163054.84: *7* Fixed bugs involving find params
There were bugs involving saving the "Pattern Match" and "Subroutine Only" find settings.
#@+node:edream.110203163054.85: *7* Fixed Python Import bug
@nocolor

Class level-code after the method definitions was dropped.
#@+node:edream.110203163054.86: *7* Fixed several more unicode bugs
The new code ensures that Leo creates and uses only Unicode strings internally.
#@+node:edream.110203163054.87: *7* Fixed crasher in Go To Outline command.
Fixed Go To Outline command so it doesn't crash on 4.0 files.  More work is needed.
#@+node:edream.110203163054.88: *7* Fixed @rawfile write problem
Under certain conditions the no sentinels at all were written when writing @rawfile trees.
#@+node:edream.110203163054.89: *6* Improved commands
#@+node:edream.110203163054.90: *7* Finished Import External File command and made it undoable
#@+node:edream.110203163054.91: *7* Moved Clear Recent Files menu item into Recent Files menu
This is much more natural and less cluttered.
#@+node:edream.110203163054.92: *7* Added better log message for Convert All Tabs/Blanks commands
#@+node:edream.110203163054.93: *7* Marked changed nodes & make the @file node and the outline dirty.
#@+node:edream.110203163054.94: *7* Rewrote icon code so it doesn't use PIL or tkIcon in Python 2.3
Leo will create the Leo icon in Leo windows automatically when using Python 2.3.
The Python Imaging Library and the tkIcon package are only used when using
previous versions of Python.
#@+node:edream.110203163054.95: *7* Created leoGui base class for tkinterGui class
This is the foundation for "foreign" guis.
#@+node:edream.110203163054.96: *6* New and improved settings
#@+node:edream.110203163054.97: *7* Added support for two new settings affecting drags
allow_clone_drags

This is a workaround so that Leo may be used on Aqua. When this setting is zero
Leo always moves nodes when dragging. The default is to enable clone-drags.

enable_drag_messages

Allows the user to suppress the message telling whether dragging nodes will move
them or clone them. The default is to enable those messages.
#@+node:edream.110203163054.98: *7* changed default for config.write_old_format_derived_files
After the 4.0 beta 1 release I changed the default so that _new_ format derived
files are written if leoConfig.txt does not exist.
#@+node:edream.110203163054.99: *5* 4.0 beta 1
leo.py 4.0 beta 1                      September 26, 2003

This is the first public release of Leo 4.0.  Version 4.0 is the culmination of over a year of collaborative design work and several months of actual implementation.

Please use caution when using this beta version of Leo.  It appears very solid and it has been tested by only a few people.

Highlights of 4.0:

** Improved and simplified format of external files.
	- Eliminated child indices, extraneous blank lines and @body sentinels.
	- Eliminated @node sentinels that indicate outline structure.
	- New @nl and @nonl sentinels indicate where newlines are and aren't.
	- These changes will largely eliminate unwanted cvs conflicts.

** Greatly improved error handling.
	- Reading external files _never_ alter outline structure or links.
	- Read errors leave the outline completely unchanged.
	- Broken clone links are gone forever.
	- As a result, using 4.0 is much safer than all previous versions.

** Full compatibility will previous versions of Leo.
	- Leo reads all external files properly, regardless of version.
	- Leo writes new-format external files by default, and this default may be changed.
	- New commands in the read/write menu allow you to explicitly specify the format of external files.

* New commands:
	- Write 3.x external file.
	- Write 4.x external file.
	- Import external file.
	- Clear Recent Files.

- Several new plugins.
- Several minor bug fixes.

See the children of this node for full details.
#@+node:edream.110203163054.100: *6* 4.0 Theory of operation
The Synchronization Principle simplifies everything and at long last puts Leo on
a firm theoretical foundation. This principle states that the "smallest unit of
meaning" of any Leo outline is the entire outline itself. In particular,
individual external files have meaning only in the context of a particular
outline.

The Synchronization Principle has the following happy consequences:

1. We may assume that all external files are in synch with the outline that wrote
them. This assumption allows Leo to use "hidden machinery" in the outline to
associate nodes in the external file with nodes in the outline. This "hidden"
machinery consists of a list of tnodes associated with @file vnodes in the
outline. When writing a external file Leo creates a list of tnodes in the order
they were written to the external file. When reading the external file, Leo uses
this list to associate nodes in the external file with nodes in the outline.

2. external files must get their structure from the .leo file that wrote them. As
we have seen, this is done using the hidden machinery in the .leo file.
Consequently, there is no further need to represent outline structure in derived
files. There is no need any longer either for child indices or for sentinels to
represent outline structure. As a result, we can eliminate @+body and @-body
nodes entirely because all @+node sentinels are followed by body text.

3. All .leo files must contain full outline structure. Even "thin" outline will
contain the full representation of the outline as vnodes.

4. Reading _never_ alters outline structure in the outline. No vnodes are ever
created or destroyed and reading never alters clone links. This is true whether
or not read errors occur. The read code sets a temporary attribute of tnodes
while reading. These attributes are copied to the permanent t.bodyString
attribute only if no read errors were encountered.

4. Error recovery is now trivial: Read errors indicate that the .leo files and
one or more external files are out-of-synch. No error recovery is attempted: the
@file tree in which the error occurred reverts back to its original state.

5. The new Import External File command is the _only_ way to recover data from
mismatched external file.
#@+node:edream.110203163054.101: *6* New commands & options
#@+node:edream.110203163054.102: *7* New write_old_format_derived_files option
The write_old_format_derived_files option in leoConfig.leo and leoConfig.txt
determines which format of external file Leo's Write and Save commands write by
default. If this option is 0 (recommended) Leo writes 4.x format external files.
Otherwise Leo writes 3.x external files.

Note that you can use the Write 3.x/4.x external files commands in the
File:Read/Write menu to write external files in an explicitly specified format.
#@+node:edream.110203163054.103: *7* New Clear Recent Files command
This command deletes all entries in the Recent Files submenu except the most
recent file. The files themselves are not affected, just the menu entries.
#@+node:edream.110203163054.104: *7* New Import External File command
The Import External File command imports all the nodes in a external file into the
outline. Unlike the read commands, no outline structure is preserved. This
command can import either 3.x or 4.x external files.

This command is necessary in version 4.0 because there is no other way to read
external files that are out-of-synch with a .leo file.
#@+node:edream.110203163054.105: *7* New Write 3.x/4.x External Files & autosave
The Write 4.x External Files command and Write 3.x External Files command work
just like the Write @file Nodes command, except that they write the indicated
format off external file. In contrast, the Write @file Nodes command writes 3.x
format external files if and only if the write_old_format_derived_files = 1 in
leoConfig.txt.

All three of these commands automatically save the outline (the .leo file) if
any external file was actually written. This is necessary so that information in
the .leo file always remains in synch with all external files.
#@+node:edream.110203163054.106: *6* New plugins
Paul Paterson contributed the following new plugins:

mod_autosave.py

Autosaves the Leo document every so often.

mod_timestamp.py

Timestamps all save operations to show when they occur.

word_export.py

Exports an outline to a word document. Clicking "plugins ... word export ...
export" exports the selected outline to Word. Word should be running with an
open (empty) document before executing this command.
#@+node:edream.110203163054.107: *6* New read logic and greatly inproved error recovery
#@+node:edream.110203163054.108: *7* Added test for unvisited nodes in read logic
Leo's read code now warns if any non-empty node is unvisited. This check, and
the check that headlines match pretty much guarantees that out-of-synch outlines
will generate errors. Thus, there is no need a gnx timestamp in @+leo sentinels!
#@+node:edream.110203163054.109: *7* Error recovery is _much_ better than before
Version 4.0 is a major advance in Leo's error handling. Using 4.0 is much safer
than all previous versions. This new error handling applies to all derived
files, both 3.x and 4.x format.

Leo's read code never alters the structure of an outline, regardless of whether
read errors are encountered. This means that clone links, marks, and all other
information in the outline except body text remains completely unchanged during
reads. Broken clone links (the dreaded read errors) are gone forever. Also, the
new read code makes no changes to any body text until it is known that no read
errors have occurred. This ensures that absolutely no changes at all are made to
the outline if there are read errors.

Leo's read code now writes a message to the log pane whenever it sees that the
body text in the external file does not match the body text in the outline. These
messages do not indicate errors, only that the body text has been changed
outside of Leo, say in an external editor or by cvs.
#@+node:edream.110203163054.110: *6* Improvements & bug fixes
#@+node:edream.110203163054.111: *7* Added horizontal scrollbar in body pane when @nowrap in effect
#@+node:edream.110203163054.112: *7* Added support for Python 2.3
Added encoding comments to leoGlobals.py and French plugins

This removes a warning new in Python 2.3.
#@+node:edream.110203163054.113: *7* Leo recycles window objects only if more than one window open
There is no need to recycle Python objects when the last outline window is being closed.
#@+node:edream.110203163054.114: *7* Removed "not undoable" message from Read @file Nodes command
This is too annoying during testing.  The Read @file Nodes command will in fact be made undoable for the 4.0 final release.
#@+node:edream.110203163054.115: *7* Removed Open Python Window command
This has been changed in Python 2.3 and it probably wasn't ever a good idea...
#@+node:edream.110203163054.116: *7* Simplified read and write code
The read code has much simplified using look-behind rather than look-ahead.  Both the read and write code write the file line-by-line without recursion.
#@+node:ekr.20050210102150.1: *3* 4.1... gnx's
#@+node:ekr.20040216151748: *4* 4.1 final
Leo 4.1 Final              February 20, 2004

Leo 4.1 Final is the culmination of four months of work. No significant bugs
have been reported since 4.1 rc4. Several people have contributed nifty plugins
recently. See leoPlugins.leo for full details.

The highlights of Leo 4.1:

- Leo runs in batch mode when invoked with --script aScriptFile.py
- Leo supports Unicode characters (e.g. Chinese) in path and file names.
- @directives and section references are now valid when executing scripts.
- @ignored and orphan nodes now valid in @file-nosent trees.
- Script-based find/change commands.
- Check Outline command.
- Hoist & DeHoist commands.
- A new gui-agnostic architecture: useful for batch mode and unit tests.
- Several new configuration settings.
- Many new unit tests.
- Excellent new plugins.
- A host of bug fixes.
#@+node:ekr.20040217085036: *5* Added several new plugins
See leoPlugins.leo for full details.
#@+node:ekr.20040216152948: *5* Added Toggle Angle Brackets command
#@+node:ekr.20040216153725: *5* Changed Undo/Redo messages
Changed Undo/Redo messages:

- Insert Outline to Insert Node.
- Delete Outline to Delete Node.
- Clone to Clone Node.

This is a real code change: it affects the undo/redo logic.
#@+node:ekr.20040217075627: *5* Fixed clone bug when pasting nodes
Clone bits could be improperly set in some cases.  This bug would not have caused serious long-term problems.

Steps to reproduce:

1. Create a parent node (named 'cloned').
2. Create two children nodes (one named 'dummy' and another named 'bottom') under the parent node 'cloned'.
3. Move the 'bottom' node below the 'dummy' node.
4. Clone node 'cloned'.
5. Copy node 'dummy'.
6. Paste node 'dummy' in between 'dummy' and 'bottom'.
7. After pasting you'll see that 'bottom' is now marked as a cloned node.
#@+node:ekr.20040217085036.1: *5* Investigated encoding problem: it's a Python 2.3 bug
Here is the bug report I submitted to Python:

The documentation for encoding lines at

C:\Python23\Doc\Python-Docs-2.3.1\whatsnew\section-encodings.html

states:

"Encodings are declared by including a specially formatted comment in the
first or second line of the source file."

In fact, contrary to the implication, the Python 2.3 parser does not look
for lines of the form:

# -*- coding: <encoding> -*-

For example, Python improperly scans the following line for an encoding

#@verbatim
#@+leo-ver=4-encoding=iso-8859-1.

and reports that iso-8859-1. (note trailing dot) is an invalid encoding!

The workaround for my app is to precede this line with the following line:

# -*- coding: iso-8859-1 -*-

This makes Python 2.3 happy.

To make myself perfectly clear: Python has absolutely no right to complain
about comment lines that do not have the form:

# -*- coding: <encoding> -*-
#@+node:ekr.20040131040356: *4* 4.1 rc4
Leo 4.1 Release Candidate 4              February 3, 2004

This release fixes numerous bugs reported since 4.1 rc3 and makes several other
minor improvements, including several nifty new plugins.

The highlights of Leo 4.1:

- Leo runs in batch mode when invoked with --script aScriptFile.py
- Leo supports Unicode characters (e.g. Chinese) in path and file names.
- @directives and section references are now valid when executing scripts.
- @ignored and orphan nodes now valid in @file-nosent trees.
- Script-based find/change commands.
- Check Outline command.
- Hoist & DeHoist commands.
- A new gui-agnostic architecture: useful for batch mode and unit tests.
- Several new configuration settings.
- Many new unit tests.
- Excellent new plugins.
- A host of bug fixes.
#@+node:ekr.20040201114855: *5* New plugins in 4.1 rc4
#@+node:ekr.20040201114855.42: *6* mod_http.py plugin: Bernhard Mulder
A minimal http plugin for LEO, based on AsyncHttpServer.py.

Use this plugin is as follows:

1. Start Leo with the plugin enabled. You will see a purple message that says
something like: "http serving enabled on port 8080, version 0.9"

2. Start a web browser, and enter the following url: http://localhost:8080/
You will see a a "top" level page containing one link for every open .leo file.
Start clicking :-)

You can use the browser's refresh button to update the top-level view in the
browser after you have opened or closed files.
#@+node:ekr.20040201114855.91: *6* newButtons.py plugin: Paul Paterson
Automatically add nodes for common tasks. This can be used to generate boiler
plate code to quickly build an outline.
#@+node:ekr.20040201114855.29: *6* nodenavigator.py plugin: Paul Paterson
Adds a node navigator to the toolbar. The navigator allows quick access to
marked nodes. You can either go to the marked node or hoist the marked node.
#@+node:ekr.20040201114855.36: *6* rowcol.py: EKR
Adds row/column indicators to the toolbar at the top of Leo Windows.
#@+node:ekr.20040201114855.3: *6* rst2.py plugin: Steve Zatz
This plugin uses Leo and docutils to mix program code and reST documentation.

The Python docutils package must be installed.http://docutils.sourceforge.net

If SilverCity is installed (http://silvercity.sourceforge.net) the plugin
produces HTML output that is syntax colored.

The basic approach is that any Leo node that contains program code that needs
documentation (in an ideal world it would be every node) has an associated child
node whose headline is simply '@rst', that contains reST-style documentation.
While this means that a typical program may have dozens (if not hundreds) of
these @rst nodes, it produces documentation that I think is as close as I have
ever seen to useful, easy-to-read documentation that is easy to create at the
same time as an application is being coded.

There are several interrelated aspects to this work:

- The reST plugin (renamed rst2) was hacked to manage Leo outlines that were a
combination of normal code nodes and reSt nodes.

- The plugin now recognizes a @rst directive (that has no associated file name)
in the headline of a node.

- When it encounters such a @rst Headline node, it writes the contents of the
body of the @rst node's *parent* (which generally contains program code) to the
reST output file (HTML) and then adds the reST content that is contained in the
body of the @rst documentation node to the output HTML file,

- These @rst nodes are used in @file-nosent trees and the @rst nodes have an 
@ignore directive (plus @nocolor directive and @wrap directives) so that 
when the @file is updated the application code does not contain the reST-style
documentation contained in the body of the @rst nodes. (This was the reason I
had asked you in the Leo Forum to allow @file-nosent trees to work appropriately
with @ignore nodes - Thank you for doing this right away.) There is no reason
that the reST content couldn't be written to the 
@file as documentation other than I personally believe in a volume of 
documentation (including musings, failed ideas, questions, etc.) that is 
probably best kept separate from the actual *.py files.

- When you double-click on a plain rst node (no associated filename) Leo opens
both the @rst documentation node and the parent node containing code in an
external editor *simultaneously*. I happen to use Textpad and so the code is
opened with python syntax coloring in one Textpad window and right next to it is
the reST documentation. This makes it much much easier to code and do
documentation at the same time. (Note that the plugin assumes that the python
extension is '.tp' since that is what I use with TextPad.)

So why is this a big deal?

For the first time in my experience the documentation process:

1) is completely in sync with the process of code development.

2) allows the programmer to write as much documentation as he/she wants without
the programming code becoming unreadable because of what would be considered
excessive or intrusive documentation. (This applies whether documentation is
intended for external consumption or just so a solo programmer can remember what
he/she was thinking...)

My conclusion is that Leo + reST/docutils provides the perfect platform for
optimal documentation.

Frankly, I think this is all a minor miracle but maybe I've lost perspective.

Steve Zatz
#@+node:ekr.20040201114855.13: *6* searchbox.py plugin: Paul Paterson
Adds a quick search to the toolbar in Leo.

A search box which behaves like a web site search is added, along with a "GO"
button to do quick searches right from the main Leo window. All the current
search options are retained except that "search body text" is explicitly set -
mainly because this is by far the most common use case.

Pressing <CR> while editing the text automatically does a search. Repeated
searches can be done by clicking the "GO" button.

The combo box also stores a list of previous searches, which can be selected to
quickly repeat a search. When activating a previous search the original search
mode is used.

Still to do:

- incremental search
- reverse search
- persist recent searches across Leo sessions
- use INI file to set options for list size, etc.
#@+node:ekr.20040201120903: *6* status_line.py plugin: EKR
Adds a status line to the bottom of Leo windows.
#@+node:ekr.20040131041015: *5* New features in 4.1 rc4
#@+node:ekr.20040131040544.10: *6* Leo no longer automatically draws the status area
This allows plugins to draw the status area in the icon area.
#@+node:ekr.20040131040544.21: *6* Esc and enter key now work in the find panel
- ESC closes the Find panel.

- Hitting the Return key is now equivalent to hitting the Find button.
#@+node:ekr.20040131040544.55: *6* Improved message for orphan nodes
Leo now reports the parent of the orphan node.
#@+node:ekr.20040131040544.178: *6* Eliminated marking nodes dirty unnecessarily
Leo sets only ancestor @file nodes dirty (not nodes themselves) when altering
outline structure, i.e., when moving, inserting, deleting, cloning and sorting
nodes.
#@+node:ekr.20040131040544.222: *6* Execute Script command now ends all nodes with a newline
That is, when preprocessing the script (expanding section references, etc.) Leo
now ensures that child nodes effectively end in a newline. This prevents
unintended concatenation of lines.
#@+node:ekr.20040131040544.2: *6* Added message when plugins are disabled
#@+node:ekr.20040201061329: *6* Created status_line.py plugin
This creates a status area at the bottom of the Leo Window. Plugins may write to
this area using the status area convenience routines in leoTkinterFrame.py.
#@+node:ekr.20040201114855.105: *6* Simplified operation of script-find/change & improved documentation
#@+node:edream.110603190322.6: *7*  Script Find and Script Change
@nocolor

New in 4.1: Leo now supports scripts in Leo's Find/Change dialog.

Leo's find panel now contains the Script Search radio button and the Script
Change checkbox. When the Script Search radio button is selected Leo treats the
contents of the Search Text as a script to execute whenever any kind of Find
command is executed. Similarly, when the Script Change checkbox is selected Leo
treats the context of the Change Text as a script to execute whenever any kind
of Change command is executed. See below for just how this works.

Script-based find-change is extremely powerful. In effect, Leo's Find/Change
panel becomes a new platform for running scripts interactively. Leo now has all
the find/change capability of pattern matching languages like Snobol and Icon,
just by using the capabilities of the plain Python language. Moreover, Leo can
deliver these capabilities interactively or not depending which buttons you push
in Leo's Find/Change panel.

Script-based find/change frees the user from having to control script-based
searches interactively. Rather than forcing find/change scripts to implement
their own interactive controls, it is much easier to use what Leo already has.
#@+node:edream.111803060152.1: *8* How it works
Leo dedicates a Python dictionary called app.searchDict for communication
between Leo and the search and change scripts. The search and change scripts may
also use app.searchDict for communication between themselves. Leo sets
app.searchDict["type"] to "find", "change", "findAll" or "changeAll" to indicate
the kind of command being executed. Scripts may use all other entries in
app.searchDict as they please.

Leo executes the find script once when you press the Find button (or the Change
then Find button) in Leo's Find/Change dialog. Typically, the find script would
traversing the tree and highlight the found text or otherwise indicate to the
user that the find operation has succeeded. However, the script can do anything
it pleases.

Leo executes the the find script repeatedly when you press the Find All button.
Leo keeps executing the find script until app.searchDict["continue"] evaluates
to false. Initially there is no entry for app.searchDict["continue"], so the
find script must set app.searchDict["continue"] = true if it wants Leo to keep
executing it.

Leo executes the change script once when you press the Change button. Typically,
the change script would change the selected text. Usually the change script will
compute the new value of body text and call c.setBodyString(p,newText) to
make that change permanent. 

The change script also may handle undo, typically by calling
c.frame.onBodyChanged(v,"Change",oldText=oldText). Leo does not handle undo
automatically. Indeed, Leo makes no assumptions whatever about what the change
script really does.

Leo executes the the change script repeatedly when you press the Change All
button. Just as with the Find All command, Leo keeps executing the change script
until app.searchDict["continue"] evaluates to false.

Most find and change scripts will ignore settings in the Find Panel like "whole
word", "pattern match", and "reverse". However, these settings are available to
the scripts via ivars such as c.whole_word_flag, etc. if desired.
#@+node:ekr.20040201113232: *8* Using the initScriptFind script
@nocolor

The Scripts node in LeoPy.leo contains a script called initScriptFind.  This script makes it easy to set up script based searches as follows:

1. Put the following code in the root of a tree that will contain your script search:

@color
# Initialize Leo's find panel using the named children of this node.
from leoGlobals import *
initScriptFind("Find script","Change script") # Second argument is optional.
# Start searching at the top.
top().selectVnode(c.rootVnode())
@nocolor

2. Put the search script in a child node called "Find script" (no quotes).

3. (Optional) Put the change script in a child node called "Change script"

4.  Execute the code above.  Leo does the following:

- Puts the body of the "Find script" into the find text of Leo's Find/Change dialog.
- Puts the body of the "Change script" into the change text of Leo's Find/Change dialog.
- Selects the Script Find radio button.
- Selects the Script Change checkbox if the change script exists.
- Selects the root of the entire outline.

Presto!  Leo is ready for a script search.
#@+node:edream.111803060152.2: *8* Ideas for using scripts
@nocolor

Some ideas for using scripts:

Either the find and change scripts may use Python's re module.  For
example, the find script could set app.searchDict["m"] to the match object
returned by re's match method.  The change script would then compute the
result, change the text and set the undo info as usual.

There is no reason to confine find/change scripts to operate on data only
within a Leo outline. These scripts could as easily traverse your file system
as the Leo outline. But notice: scripts could pull data from the file system
into the outline so that you can see the effects of changes as the scripts
operate. Again, this can all happen interactively if you like.
#@+node:ekr.20040201114855.106: *6* Added done message to Mark Changed commands
#@+node:ekr.20040131040356.1: *5* Bugs fixed in 4.1 rc4
#@+node:ekr.20040131044727: *6* Fixed several bugs when writing external files
1. Fixed a bug that caused improper indentation of sections.

The bug happened in some cases when a section reference occurred following non-whitespace.

2. Leo ensures that leading whitespace is not added when writing empty lines.

This might fix the "Zope Sprint" bug: "blank" lines in the expansion of @others got leading whitespace.
#@+node:ekr.20040131040754: *6* Fixed several crashers
Fixed crashers in:

- Insert Headline Time/Date commands.
- Change headline command.
- Write Dirty/Missing @file Nodes commands.
- Batch mode.
#@+node:ekr.20040131040544.5: *6* Fixed "bad leo file" when reading some 3.x .leo files
#@+node:ekr.20040131040544.18: *6* Fixed huge performance bug in cut/copy node commands
The old code was concatenating strings; the new code uses list.append.
#@+node:ekr.20040131040544.32: *6* Leo now properly re-enables drawing after exceptions
#@+node:ekr.20040201114855.107: *6* Fixed major bug in tkFind.init
This bug happened when executing the initScriptFind script.  This bug could cause Leo not to be able to save files.
#@+node:ekr.20040131040544.73: *6* Fixed bug in Move Up command
This bug happened when a move up command would cause a node to become the
sibling of (a clone of) itself. In such cases, Leo simply selects the other
cloned copy of the moved node.
#@+node:ekr.20040131040544.81: *6* Fixed bug in Import External File
The bug was causing Leo not to remember the comment delimiters in the @+leo
sentinel. As a result, Leo was recognizing no sentinels and the command
complained about missing @-leo sentinels.
#@+node:ekr.20040131040544.146: *6* Fixed bugs related to saving read-only files
- Leo now does a better job of checking and reporting read-only violations.

- Leo now clears the file-dirty mark only if the file was successfully saved.

#@+node:ekr.20040131040544.169: *6* Fixed bug in Import Python Window command when using Python 2.2
#@+node:ekr.20040131040544.228: *6* Fixed bugs in Convert All BlanksTabs commands
- These commands did not properly count the number of changed nodes.
- These commands now mark only changed nodes as dirty.
#@+node:ekr.20040131040544.258: *6* Fixed crashes in open_shell.py plugin
#@+node:ekr.20040131044136: *6* Fixed several bugs involving cut & paste
- Fixed a bug that caused cut and paste operations in headlines to revert when those commands were chosen from the Edit menu.

- Extended control-v bug fix to "darwin","freebsd4","freebsd5"

- Cut and paste are now always enabled when not editing the body pane.  This isn't perfect, and is an improvement.
#@+node:ekr.20040131040544.227: *6* Fixed whitespace problem in leoTkinterGui.py
A contained a space before a tab in the leading whitespace of the line.
#@+node:ekr.20040131100557: *6* Fixed glitches when inserting node in hoisted outline
Previously, if you hoist a node with no children and then insert a node (CTRL-I)
then the child is created as a sibling of the hoisted node and consequently is
not displayed.

Leo now creates the new node as the first child of the hoisted node. 

Also, Leo disables the Clone command when the presently selected node is the root of a hoist.
#@+node:ekr.20040203084228: *6* Fixed bugs in search command
The Change All command was looping when the find pattern was '\n'.
#@+node:ekr.20040131040356.2: *5* Bug fixed in previous 4.1 releases
See previous release notes for more details:

4.1 rc3:

- Corrected counts when replacing tabs/blanks.
- Don't write tnodeList when executing scripts.
- Fixed long-standing clone-drag bug.
- Fixed inconsistency between how 4.x and 3.x handle @others.
  The code now works as it did in all 3.x versions, namely
  @others does not terminate doc parts.
- Leo now properly sets clone marks when when cutting and pasting nodes.
- Only double-quotes delimit strings in html files.
  This bug prevented Leo from untangling some valid html/xml files.
- Leo now puts class docstrings in class nodes when importing .py files.
- Fixed several reorg bugs.

4.1 rc2, rc1, betas, alphas:

- Fixed several minor problems with the Extract Section and Import commands.
- Fixed problem that prevent the Find panel from working on the Mac.
- Improved @url handling so that @url file:\\path\x.leo works properly.
- Improved support for @lineending platform.
- Leo honors outline/body pane ratio when opening .leo files.
- Leo now ensures that newly-opened windows fit entirely on the screen.
- Fixed a crasher when Undoing a Change All command when searching headlines.
- Fixed other bugs resulting from the 4.1 reorg:
- Fixed problem loading plugins on Linux.
- Fixed crashers in the Extract Section and Extract commands.
- Fixed a crasher when writing a file containing an undefined section.
- Removed duplicate bindings in popup menus.
- Made sure to show Leo's windows in wx gui plugin.
- More than one section reference may now appear on the same line.
- Use "utf-8" encoding for filenames under MacOS (Darwin)
- Allow command or cmnd prefix for menu shortcuts under Darwin.
- Fixed a LaTeX coloring bug
#@+node:ekr.20040131040356.3: *5* New code-level features
- The 4.1 code base has been reorganized to support gui plugins.
- Created a flexible framework for creating & running regression tests.
- app.forceShutdown now works when called from plugins.
- Created app.unitTestDict for communication between tests and between tests and code.

- An example wx_gui plugin is partly functional.

	Warning: Use the __wx_gui.py plugin with extreme caution until further notice:
	bugs in this plugin could cause body text to be cleared improperly when changing nodes.
#@+node:ekr.20040131040356.4: *5* New configuration settings
- use_gnx specifies whether .leo files use integers as indices:

	use_gnx = 0 makes .leo files compatible with previous versions of Leo.
	use_gnx = 1 makes .leo files cvs-friendly

- config_encoding specifies the encoding of leoConfig.txt.
#@+node:ekr.20040131040356.5: *5* New features
- Import External File command now uses a file dialog.

	This is much more natural than using @file nodes.
#@+node:edream.121403160546: *4* 4.1 rc3
Leo 4.1 Release Candidate 3              December 19, 2003

This release fixes a serious bug in the logic that reads old-style external files.

There are no known bugs in this version of Leo.

The highlights of this release:

- Leo runs in batch mode when invoked with --script aScriptFile.py
- Leo supports Unicode characters (e.g. Chinese) in path and file names.
- @directives and section references are now valid when executing scripts.
- @ignored and orphan nodes now valid in @file-nosent trees.
- Script-based find/change commands.
- Check Outline command.
- Hoist & DeHoist commands.
- A new gui-agnostic architecture: useful for batch mode and unit tests.
- Several new configuration settings.
- Many new unit tests.
- A host of bug fixes.
#@+node:edream.121403165221: *5* Bugs fixed in this release
- Corrected counts when replacing tabs/blanks.
- Don't write tnodeList when executing scripts.
- Fixed long-standing clone-drag bug.
- Fixed inconsistency between how 4.x and 3.x handle @others.
  The code now works as it did in all 3.x versions, namely
  @others does not terminate doc parts.
- Leo now properly sets clone marks when when cutting and pasting nodes.
- Only double-quotes delimit strings in html files.
  This bug prevented Leo from untangling some valid html/xml files.
- Leo now puts class docstrings in class nodes when importing .py files.
- Fixed several reorg bugs.
#@+node:edream.121403161017: *5* Bug fixed in previous 4.1 releases
See previous release notes for more details:

- Fixed several minor problems with the Extract Section and Import commands.
- Fixed problem that prevent the Find panel from working on the Mac.
- Improved @url handling so that @url file:\\path\x.leo works properly.
- Improved support for @lineending platform.
- Leo honors outline/body pane ratio when opening .leo files.
- Leo now ensures that newly-opened windows fit entirely on the screen.
- Fixed a crasher when Undoing a Change All command when searching headlines.
- Fixed other bugs resulting from the 4.1 reorg:
- Fixed problem loading plugins on Linux.
- Fixed crashers in the Extract Section and Extract commands.
- Fixed a crasher when writing a file containing an undefined section.
- Removed duplicate bindings in popup menus.
- Made sure to show Leo's windows in wx gui plugin.
- More than one section reference may now appear on the same line.
- Use "utf-8" encoding for filenames under MacOS (Darwin)
- Allow command or cmnd prefix for menu shortcuts under Darwin.
- Fixed a LaTeX coloring bug
#@+node:edream.121403161017.1: *5* New code-level features
- The 4.1 code base has been reorganized to support gui plugins.
- Created a flexible framework for creating & running regression tests.
- app.forceShutdown now works when called from plugins.
- Created app.unitTestDict for communication between tests and between tests and code.

- An example wx_gui plugin is partly functional.

	Warning: Use the __wx_gui.py plugin with extreme caution until further notice:
	bugs in this plugin could cause body text to be cleared improperly when changing nodes.
#@+node:edream.121403161017.2: *5* New configuration settings
- use_gnx specifies whether .leo files use integers as indices:

	use_gnx = 0 makes .leo files compatible with previous versions of Leo.
	use_gnx = 1 makes .leo files cvs-friendly

- config_encoding specifies the encoding of leoConfig.txt.
#@+node:edream.121403161340: *5* New features
- Import External File command now uses a file dialog.

	This is much more natural than using @file nodes.
#@+node:edream.110603185805: *4* 4.1 beta 5
Leo 4.1 beta 5                   December 5, 2003

This is the fifth release of the reorganized 4.1 code base.

For the first time in months there are no serious bugs outstanding.

Warning: By default Leo 4.1 creates .leo files that can not be read by older versions of Leo.

Warning: Use the __wx_gui.py plugin with extreme caution until further notice:
bugs in this plugin could cause body text to be cleared improperly when changing nodes.

Beta 5:
  * Leo runs in batch mode when invoked with --script aScriptFile.py
    - Created "null gui" classes that do not use any gui code.
  * Leo supports Unicode characters (e.g. Chinese) in path and file names.
  * Fixed several long-standing bugs:
    - Fixed several minor problems with the Extract Section and Import commands.
    - Fixed problem that prevent the Find panel from working on the Mac.
    - Improved @url handling so that @url file:\\path\x.leo works properly.
    - Improved support for @lineending platform.
    - Leo honors outline/body pane ratio when opening .leo files.
    - Leo now ensures that newly-opened windows fit entirely on the screen.
    - Fixed a crasher when Undoing a Change All command when searching headlines.
  - Fixed other bugs resulting from the 4.1 reorg:
    - Fixed problem loading plugins on Linux.
    - Fixed crashers in the Extract Section and Extract commands.
    - Fixed a crasher when writing a file containing an undefined section.
    - Removed duplicate bindings in popup menus.
    - Made sure to show Leo's windows in wx gui plugin.

Beta 4:
  - Fixed several "reorg" bugs, some of which affected plugins.
  - Allow @directives and section references when executing scripts!
  - More than one section reference may now appear on the same line.
  - Use "utf-8" encoding for filenames under MacOS (Darwin)
  - Allow command or cmnd prefix for menu shortcuts under Darwin.

Beta 3:
  - Completed the reorg, making many changes to the code base.
  - Fixed a LaTeX coloring bug

Beta 2:
  - Fixed a startup problem on Linux: the "mbcs" text encoding is not valid on Linux.

Beta 1:
  * Script-based find/change commands.
  - Hoist & DeHoist commands for viewing parts of an outline.
  - Check Outline command finds user clone mistakes.
  * New configuration settings:
    - use_gnx specifies whether .leo files use integers as indices:
      use_gnx = 0 makes .leo files compatible with previous versions of Leo.
      use_gnx = 1 makes .leo files cvs-friendly
    - config_encoding specifies the encoding of leoConfig.txt.
  * Several significant code-level changes:
    - The 4.1 code base has been reorganized to support gui plugins.
    - An example wx_gui plugin is partly functional.
    - Created a flexible framework for creating & running regression tests.
    - app.forceShutdown now works when called from plugins.
#@+node:edream.120403174147: *5* Changes made in 4.1 beta 5
#@+node:edream.120403180443: *6* New and improved features
#@+node:edream.120403174147.105: *7* Honor outline/body pane ratio when opening files
This bug has been around for a long time.
#@+node:edream.120403174147.112: *7* Leo now adjusts newly opened windows so they fit on the screen
Leo makes sure that opened files or newly-created outlines fit entirely on the screen.  The Cascade commands leaves the sizes of windows unchanged: it merely ensures that the top left corner of a window is visible on the screen.
#@+node:edream.120403174147.119: *7* Tested support for Unicode file & directory names
#@+node:edream.120403174147.128: *7* Added code so @url nodes may open .leo files
@

A problem: the new window gets put behind the old.  This is probably because Tk
thinks that the mouse-down event should select then new window... 
#@+node:edream.120403174147.56: *7* Fixed problems with @lineending platform
#@+node:edream.120403174241: *6* Bugs fixed
#@+node:edream.120403174147.30: *7* Fixed crasher in Apply Settings command
Another 4.1 reorg bug.
#@+node:edream.120403174147.102: *7* Fixed crasher in Toggle Angle Brackets command
Another 4.1 reorg bug.
#@+node:edream.120403174147.109: *7* Fixed crasher when setting Icon in Linux)
The new code attempts to use bitmap files only on Windows.
#@+node:edream.120403174147.33: *7* Fixed Find panel bug on the Mac
This was due to a missing activate event.
#@+node:edream.120403174147.36: *7* Fixed Import backslash-newline bug
Continuation lines caused the import command to terminate functions, methods and classes prematurely.
#@+node:edream.120403174147.61: *7* Fixed Linux import problem
This was causing Leo not to load plugins properly on Linux.  The problem was that the imp module does not handle Unicode file names properly.
#@+node:edream.120403174147.63: *7* Fixed Recent files crasher
This was a reorg bug.
#@+node:edream.120403174147.65: *7* Fixed Replace Blanks command
Another bug caused by the 4.1 reorg.
#@+node:edream.110603190322.8: *7* Fixed Serious Undo Change All bugs
Undoing Change All cleared the body pane or the headline pane.

The fix was simple: call setUndoParams instead of setUndoTypingParams in batchChange.
#@+node:edream.120403174147.94: *7* Fixed several long-standing bugs related to Extract commands
- Leo now properly enables and disables the Extract Section menu item.
- Leo no longer removes leading forward slashes in section names in headlines.
- Corrected the documentation for the Extract Section command.
#@+node:edream.120403180443.1: *5* Changes made in earlier 4.1 betas
#@+node:edream.110603190234.1: *6* Code-level features
#@+node:edream.110603190125.3: *7* Regression tests started
The file test.leo in the test directory contains real regression tests for
syntax coloring.  Regression testing scripts create regression tests dynamically
from data in Leo's outline.  Very cool, very easy, very general.  In particular,
regression tests may use temporary nodes in test.leo rather than creating
separate Tk windows for testing. 
#@+node:edream.110603190125.4: *7* Code reorganized to support other guis
The 4.1 code base has been reorganized to support gui's other than tkinter.
Leo's src directory contains several new source files.

This reorg affects almost all plugins. Considerably more work and testing will
be done before 4.1 final.

The __wx_gui.py plugin is uses the newly reorganized code.  It is functional
except for gui-dependent commands like Toggle-Split Direction.  WARNING: treat
the this plugin with extreme caution until further notice.  The possibility
exists that bugs in the code could cause body text to be cleared improperly when
changing nodes. 
#@+node:edream.110303182253.39: *7* Made app.forceShutdown work in "idle" hook
#@+node:edream.110603190404: *6* Fixed bugs
#@+node:edream.110603190322.13: *7* Fixed bug involving 0x1a characters in body text.
The fix was to open files with 'rb' instead of 'r'.  This probably should be done in more places.
#@+node:edream.110603190322.11: *7* Fixed first node-only find bug
The node-only option wasn't working due to a bug in createFrame.

There still may be a problem with the interaction between Node-only,Change All and Undo.
#@+node:edream.110603190322.3: *7* Fixed bug in idle_body_key
This involved fixing a bug in idle_body_key so that the oldText param is honored if present.
#@+node:edream.111803060643: *7* Fixed LaTeX syntax coloring bug
#@+node:edream.110603192009: *6* Improved format of .leo files
#@+node:edream.110603190322.9: *7* Leo now ignores unknown prefs and find prefs
#@+node:edream.110603190322.10: *7* Leo now writes node_only find prefs
#@+node:edream.110603190125.1: *7* .leo files are now cvs-friendly
Leo 4.1 uses immutable gnx's (id:timestamp:n) by default to associate tnodes with vnodes in .leo files.  This makes Leo as cvs friendly as possible.  From now on .leo files will be checked in to cvs with the -ko (text/keywords off) option.
#@+node:edream.110603192009.1: *6* New & improved commands
#@+node:edream.112303173638: *7* Running Leo in batch mode
@color
@  New in version 4.1: On startup, Leo looks for two arguments of the form --script scriptFile.  If found, Leo enters batch mode.

In batch mode Leo does not show any windows.  Leo assumes the scriptFile contains a Python script and executes the contents of that file using Leo's Execute Script command.  By default, Leo sends all output to Leo's log pane to the console window.  Scripts in the scriptFile may disable or enable this output by calling app.log.disable() or app.log.enable()

Scripts in the scriptFile may execute any of Leo's commands except the Edit Body and Edit Headline commands.  Those commands require interaction with the user.

For example, the following batch script reads a Leo file and prints all the headlines in that file.
@c

import leoGlobals as g

path = r"c:\prog\leoCVS\leo\test\test.leo"

g.app.log.disable() # disable reading messages while opening the file
flag,newFrame = g.openWithFileName(path,None)
g.app.log.enable() # re-enable the log.

for p in newFrame.c.all_positions():
	g.es(g.toEncodedString(p.headString(),"utf-8"))
#@+node:edream.110203163054.833: *7* Executing Python scripts in body text
The Execute Script command executes body text as a Python script. Leo execute
the selected text, or the entire body text if no text is selected.

Scripts are executed in a "pristine" environment, that is, with __builtins__ as
both the local and global environments.

New in version 4.1: Body text may now contain @directives and section
references. This is a major step forward: you can now use all of Leo's features
to organize scripts that you execute interactively.

Section definitions must appear in the node containing the script or in
descendant nodes. Leo "preprocesses" all scripts by simulating the writing of a
external file to a string.

The Execute Script command sets app.scriptDict["script1"] to the value of the
script before preprocessing, and sets app.scriptDict["script2"] to the value of
the script after preprocessing. Scripts may examine and change app.scriptDict as
they please.
#@+node:edream.110603190322.14: *7* Added Check Outline command
This command checks for unused tnodeLists and checks the topology of all clones.
#@+node:edream.110603190322.15: *7* Added Hoist/De-Hoist commands
The Hoist command redraws the screen so presently selected tree becomes the only visible part of the outline.  Leo prevents the you from moving nodes outside the hoisted outline.  The De-hoist command restores the outline.  Hoist commands may be nested.
#@+node:edream.111803060152: *7* Added script-based find/change commands
#@+node:edream.110603190322.6: *8*  Script Find and Script Change
@nocolor

New in 4.1: Leo now supports scripts in Leo's Find/Change dialog.

Leo's find panel now contains the Script Search radio button and the Script
Change checkbox. When the Script Search radio button is selected Leo treats the
contents of the Search Text as a script to execute whenever any kind of Find
command is executed. Similarly, when the Script Change checkbox is selected Leo
treats the context of the Change Text as a script to execute whenever any kind
of Change command is executed. See below for just how this works.

Script-based find-change is extremely powerful. In effect, Leo's Find/Change
panel becomes a new platform for running scripts interactively. Leo now has all
the find/change capability of pattern matching languages like Snobol and Icon,
just by using the capabilities of the plain Python language. Moreover, Leo can
deliver these capabilities interactively or not depending which buttons you push
in Leo's Find/Change panel.

Script-based find/change frees the user from having to control script-based
searches interactively. Rather than forcing find/change scripts to implement
their own interactive controls, it is much easier to use what Leo already has.
#@+node:edream.111803060152.1: *9* How it works
Leo dedicates a Python dictionary called app.searchDict for communication
between Leo and the search and change scripts. The search and change scripts may
also use app.searchDict for communication between themselves. Leo sets
app.searchDict["type"] to "find", "change", "findAll" or "changeAll" to indicate
the kind of command being executed. Scripts may use all other entries in
app.searchDict as they please.

Leo executes the find script once when you press the Find button (or the Change
then Find button) in Leo's Find/Change dialog. Typically, the find script would
traversing the tree and highlight the found text or otherwise indicate to the
user that the find operation has succeeded. However, the script can do anything
it pleases.

Leo executes the the find script repeatedly when you press the Find All button.
Leo keeps executing the find script until app.searchDict["continue"] evaluates
to false. Initially there is no entry for app.searchDict["continue"], so the
find script must set app.searchDict["continue"] = true if it wants Leo to keep
executing it.

Leo executes the change script once when you press the Change button. Typically,
the change script would change the selected text. Usually the change script will
compute the new value of body text and call c.setBodyString(p,newText) to
make that change permanent. 

The change script also may handle undo, typically by calling
c.frame.onBodyChanged(v,"Change",oldText=oldText). Leo does not handle undo
automatically. Indeed, Leo makes no assumptions whatever about what the change
script really does.

Leo executes the the change script repeatedly when you press the Change All
button. Just as with the Find All command, Leo keeps executing the change script
until app.searchDict["continue"] evaluates to false.

Most find and change scripts will ignore settings in the Find Panel like "whole
word", "pattern match", and "reverse". However, these settings are available to
the scripts via ivars such as c.whole_word_flag, etc. if desired.
#@+node:ekr.20040201113232: *9* Using the initScriptFind script
@nocolor

The Scripts node in LeoPy.leo contains a script called initScriptFind.  This script makes it easy to set up script based searches as follows:

1. Put the following code in the root of a tree that will contain your script search:

@color
# Initialize Leo's find panel using the named children of this node.
from leoGlobals import *
initScriptFind("Find script","Change script") # Second argument is optional.
# Start searching at the top.
top().selectVnode(c.rootVnode())
@nocolor

2. Put the search script in a child node called "Find script" (no quotes).

3. (Optional) Put the change script in a child node called "Change script"

4.  Execute the code above.  Leo does the following:

- Puts the body of the "Find script" into the find text of Leo's Find/Change dialog.
- Puts the body of the "Change script" into the change text of Leo's Find/Change dialog.
- Selects the Script Find radio button.
- Selects the Script Change checkbox if the change script exists.
- Selects the root of the entire outline.

Presto!  Leo is ready for a script search.
#@+node:edream.111803060152.2: *9* Ideas for using scripts
@nocolor

Some ideas for using scripts:

Either the find and change scripts may use Python's re module.  For
example, the find script could set app.searchDict["m"] to the match object
returned by re's match method.  The change script would then compute the
result, change the text and set the undo info as usual.

There is no reason to confine find/change scripts to operate on data only
within a Leo outline. These scripts could as easily traverse your file system
as the Leo outline. But notice: scripts could pull data from the file system
into the outline so that you can see the effects of changes as the scripts
operate. Again, this can all happen interactively if you like.
#@+node:edream.110303182253.3: *7* Leo now does an auto-save only if files have actually been changed.
Leo does an auto-save only if something has actually been changed.
#@+node:edream.111803062437: *7* Shift commands now shift single line if no selection
#@+node:edream.110303182719: *6* New config settings
The config_encoding setting controls the encoding of non-ascii characters in leoConfig.txt.

The use_gnx setting in leoConfig.txt determines whether uses gnx's (cvs friendly) or ints.  No version of Leo before 4.1 can read .leo files containing gnx.   Only gnx's are immutable.  Leo recomputes all non-gnx indices from scratch whenever writing a .leo file. It is possible to convert between 3.x and 4.1 file formats by changing the use_gnx setting.
#@+node:edream.110203163054.64: *4* 4.1 alpha 1
Leo 4.1 alpha 1                   November 3, 2003

*** Alpha quality code:  Please make full backups before playing with this code!

This release marks another significant milestone in Leo's history:

- Leo's 4.x file code is complete. At present I have no plans to change the
format of .leo files or external files. I am eating my own dog food: I do all my
editing with the 4.1 code base.

- Leo uses immutable gnx's (id:timestamp:n) by default to associate tnodes with
vnodes in .leo files. This makes Leo as cvs friendly as possible. From now on
.leo files will be checked in to cvs with the -ko (text/keywords off) option.

- The use_gnx setting in leoConfig.txt determines whether uses gnx's (cvs
friendly) or ints. No version of Leo before 4.1 can read .leo files containing
gnx. Only gnx's are immutable. Leo recomputes all non-gnx indices from scratch
whenever writing a .leo file. It is possible to convert between 3.x and 4.1 file
formats by changing the use_gnx setting.

- The 4.1 code base has been reorganized to support gui's other than tkinter.
Leo's src directory contains several new source files.

- The file test.leo in the test directory contains real regression tests for
syntax coloring. Regression testing scripts create regression tests dynamically
from data in Leo's outline. Very cool, very easy, very general. In particular,
regression tests may use temporary nodes in test.leo rather than creating
separate Tk windows for testing.

Known bugs:

- The Extract commands eat one character too much.

- The __wx_gui.py plugin is only partly functional.
#@+node:ekr.20050210102150: *3* 4.2... @file-thin, shared tnodes
#@+node:ekr.20040922074200: *4* 4.2 final
Leo 4.2 Final       September 20, 2004

The highlights of Leo 4.2:

- @thin trees make Leo much more friendly to cvs. Files derived from @thin can
be committed to cvs and updated from cvs without having to commit or update the
corresponding .leo file. There is no longer any need to keep .leo files and
external files in synch.

- Leo's data structures have been reorganized. As a result, all outline
operations are much faster. To support this organization, scripts that traverse
Leo's data structures must now use a positions rather than vnodes. Old scripts
that appear to use vnodes will still work because methods like c.currentVnode
that appear to return vnodes actually return positions.

- A new mod_scripting plugin is a big advance in scripting and testing.
test.leo now uses @test and @script nodes to define unit tests without
explicitly creating subclasses of unittest.TestCase. Converting scripts to unit
tests now takes a few seconds!

- A much faster and more robust spell checker plugin. (requires Python 2.3)

- Leo is now much more friendly to using spaces instead of tabs.

- The Execute Script command reports erroneous lines more clearly.
#@+node:ekr.20040914103359: *4* 4.2 rc1
Leo 4.2 release candidate 1        September 14, 2004

This version fixes a number of minor bugs reported since the last release. See
the children of this node for details.

The highlights of Leo 4.2:

- @thin trees make Leo much more friendly to cvs. Files derived from @thin can
be committed to cvs and updated from cvs without having to commit or update the
corresponding .leo file. There is no longer any need to keep .leo files and
external files in synch.

- Leo's data structures have been reorganized. As a result, all outline
operations are much faster. To support this organization, scripts that traverse
Leo's data structures must now use a positions rather than vnodes. Old scripts
that appear to use vnodes will still work because methods like c.currentVnode
that appear to return vnodes actually return positions.

- A new mod_scripting plugin is a big advance in scripting and testing.
test.leo now uses @test and @script nodes to define unit tests without
explicitly creating subclasses of unittest.TestCase. Converting scripts to unit
tests now takes a few seconds!

- A much faster and more robust spell checker plugin. (requires Python 2.3)

- Leo is now much more friendly to using spaces instead of tabs.

- The Execute Script command reports erroneous lines more clearly.

- The Perfect Import feature guarantee that Leo imports file exactly.
#@+node:ekr.20040914103743.1: *5* Added new features
#@+node:ekr.20040914103359.137: *6* Added c.frame.openDirectory to sys.path when executing scripts
#@+node:ekr.20040914103359.37: *6* Added expanded_click_area option to disable left click logic in outline pane
#@+node:ekr.20040914103359.2: *6* Restored the "iconclick1/2" hooks
#@+node:ekr.20040914103359.19: *6* (Allow longer headlines for to support long url's)
#@+node:ekr.20040914103359.20: *7* Report
@killcolor

From Dan Winkler:

On a couple of occasions, I tried to paste in a long @url node and got 
this message:

	Truncating headline to 250 characters

I wonder if the 250 character limit on headline length should be 
rethought in light of the @url directive and long web addresses.
#@+node:ekr.20040914103743: *5* Fixed bugs
#@+node:ekr.20040914103359.47: *6* Disabled perfect import
There were too many problems with this feature. In the future Leo will have a
Check Import command.
#@+node:ekr.20040914103359.12: *6* Fixed Import External Files command
If only one file was specified Leo gave an error for every character of the file name!
#@+node:ekr.20040914103359.15: *6* Fixed parsing of minimal <preferences> tag
#@+node:ekr.20040914103359.7: *6* Fixed problem with tabs on MacOs
With TclTkAqua on the Mac (but *not* with tcltk installed via Fink), the tab
problem doesn't exist there), the tab, return, and backspace keys did not generate
ASCII codes, i.e. event.char is an empty string. So when I press the tab key,
Tk inserts a tab character and Leo isn't even aware of it.
#@+node:ekr.20040914103359.28: *6* Fixed read errors with @language html
#@+node:ekr.20040914103359.4: *6* Made sure a proper message is given with invalid versions of Python
#@+node:ekr.20040914103359.110: *6* Removed failed assert from colorizer
#@+node:ekr.20040914103359.31: *6* Removed spurious "Warning: updating changed text" messages
#@+node:ekr.20040914103359.129: *6* Shifted all Alt-shortcuts to Ctrl shortcuts on the Mac
http://sourceforge.net/forum/message.php?msg_id=2742238
By: hinsen

The shortcut definitions in Leo are quite inconvenient on the Mac, as those
using the Alt key don't work. Alt is used for entry of additional characters.
On the other hand, ctrl is available for shortcuts but not used in Leo, since
the ctrl-based shortcuts are shifted to the command key (following standard
Mac practice).

The patch at the end of this message simply shifts all Alt-shortcuts to Ctrl
on the Mac.

That leaves one minor clash: Command-` is used for CloneNode in Leo, although
it canonical MacOS function (switching between the windows of an application)
would be very useful in Leo as well. Removing the CloneNode binding is easy
enough, but it seems that I must implement a window switching function myself.
Not today :-)

Konrad.
#@+node:ekr.20040713110718: *4* 4.2 beta 3
Leo 4.2 beta 3           August 10, 2004

This version of Leo is feature complete.  Leo's core code has been stable for several months.

To do: most plugins work with the new code base, but other plugins need some more work.

The highlights of Leo 4.2:

- @thin trees make Leo much more friendly to cvs. Files derived from @thin can
be committed to cvs and updated from cvs without having to commit or update the
corresponding .leo file. There is no longer any need to keep .leo files and
external files in synch.

- Leo's data structures have been reorganized. As a result, all outline
operations are much faster. To support this organization, scripts that traverse
Leo's data structures must now use a positions rather than vnodes. Old scripts
that appear to use vnodes will still work because methods like c.currentVnode
that appear to return vnodes actually return positions.

- A new mod_scripting plugin is a big advance in scripting and testing.
test.leo now uses @test and @script nodes to define unit tests without
explicitly creating subclasses of unittest.TestCase. Converting scripts to unit
tests now takes a few seconds!

- A much faster and more robust spell checker plugin. (requires Python 2.3)

- Leo is now much more friendly to using spaces instead of tabs.

- The Execute Script command reports erroneous lines more clearly.

- The Perfect Import feature guarantee that Leo imports file exactly.
#@+node:ekr.20040804165258.1: *5* Bug fixes
#@+node:ekr.20040804164600.16: *6* Leo gives the user a chance to save read-only files
Leo now vetoes the shutdown logic if saving a dirty file fails.

Leo prints in red the warning about not being able save the read-only file. The
user can use the Save To command to save the file. The Save To command does not
clear the file's dirty bit, so Leo will prompt again to save the file. The user
will have to ignore this prompt in order to exit. This is correct: the
_original_ file has not been saved.
#@+node:ekr.20040804164600.36: *6* Fixed some unit-test bugs
- g.getScript implicitly assumed that p == c.currentPosition.
  I removed that assumption.

- The scriptButton callback in the scripting.py plugin no longer calls c.executeScript.
  It's simpler and easier to call exec directly.

- Improved c.checkOutline:
    - Added full keyword arg.
    - Print more if verbose is on.
#@+node:ekr.20040804164600.56: *6* Added 3 .cascading style sheets to the distribution list
#@+node:ekr.20040804164600.98: *6* Fixed some bugs in g.importFromPath
#@+node:ekr.20040804164600.102: *6* Fixed major bug in write logic
Spurious entries in a tnodeList for @thin trees wiped out all the headlines in
the @thin tree.
#@+node:ekr.20040804164600.265: *6* Fixed bug in p.isAncestorOf
#@+node:ekr.20040804164600.275: *6* Leo now writes only the currently selected tree when pasting to the clipboard
# The new code only writes tnodes for the current tree when pasting to the clipboard.
#@+node:ekr.20040804164600.377: *6* Fixed performance bug when reading .leo files
There was a big performance bug in the nodenavigator plugin.
#@+node:ekr.20040804170846: *6* Leo now reports problems with bad directories more clearly
@thin bad-directory caused excessive and confusing tracebacks.
#@+node:ekr.20040804164600.394: *6* Leo reads collapsed xml tags properly in .leo files
@nocolor

As a result, the minimal .leo file is:

@color
@language html

<?xml version="1.0" encoding="UTF-8"?>
<leo_file>
<leo_header/>
<globals/>
<preferences/>
<find_panel_settings/>
<vnodes/>
<tnodes/>
</leo_file>

@nocolor

The empty_leo_file plugin now uses this code. The minimal .leo file that Leo
might actually write is more like this:

@color

<?xml version="1.0" encoding="UTF-8"?>
<leo_file>
<leo_header/>
<globals/>
<preferences/>
<find_panel_settings>
    <find_string/>
    <change_string/>
</find_panel_settings>
<vnodes/>
<tnodes/>
</leo_file>
#@+node:ekr.20040804164600.406: *6* Leo makes brings the confirm save box to the front
#@+node:ekr.20040804164600.419: *6* Improved how es_exception gets line number of errors
#@+node:ekr.20040804164600.421: *6* Fixed major bug: changing headline now marks subnodes dirty
This is required to make @thin work properly.
#@+node:ekr.20040804164600.470: *6* Leo now gives update warning only once per external file
#@+node:ekr.20040804164600.471: *6* Leo updates tnodeLists properly in all situations
A major change: putVnode doesn't put tnodeLists for @thin nodes.

Instead it issues an informational message and deletes the tnodeList.
#@+node:ekr.20040804164600.515: *6* Fixed several leaks of positions
Leo used to allocate more positions than necessary.  This unnecessarily stressed the garbage collector.
#@+node:ekr.20040804171818: *6* Fixed all unit tests so they work with both Python 2.2 and Python 2.3
#@+node:ekr.20040804165258.2: *5* Features
#@+node:ekr.20040804172113: *6* @test and @suite greatly aid unit testing
#@+node:ekr.20040804172113.1: *6* New scripts in test.leo make it very easy to use the gc, profile and timeit modules
#@+node:ekr.20040804165258.3: *6* Import dialogs allow multiple selections
Leo now allows you to select multiple files in the dialogs for all Import
commands. This fixes a major annoyance. However, you must be running Python 2.3
or above to get this feature.
#@+node:ekr.20040804165258.4: *6* New Check menu and commands
Added the Check submenu of the Outline menu. This contains the Check Outline and
Dump Outline commands, as well as four new commands:

The Check All Python Code and Check Python Code commands report any syntax
errors or tabnanny errors. These commands mark erroneous nodes. These commands
work on the selected Node and its descendants. These commands ignore any nodes
for which a) @ignore is in effect or b) @language python is in not effect.

The Check Python Code and Pretty Print Python Code commands replace nodes with
their pretty-printed alternative. No doubt everyone will have their own favorite
style. You could implement alternate pretty printers in a plugin merely by
overriding the following methods of class prettyPrinter in leoCommands.py:

---- putOperator:      puts whitespace around operators.
---- putNormalToken:   puts whitespace around everything else.
#@+node:ekr.20040804170531: *6* Perfect Import feature automatically corrects imported files
#@+node:ekr.20040804170657: *6* Improved performance of outline pane
Leo now reuses all widgets used to draw the outline pane. This improves
performance and ends leaks of bindings and widgets.
#@+node:ekr.20040804164600.424: *6* The Go To Line Number command ignores all @all nodes
This makes the command more useful.
#@+node:EKR.20040628095213: *4* 4.2 beta 1 & beta 2
Leo 4.2 beta 2           July 5, 2004
Leo 4.2 beta 1           June 30, 2004

The highlights of 4.2 beta 2:

- Leo now writes the entire contents of @ignore'd @thin trees to the .leo file.
This change ensures that users can create and remove @ignore directives without
any chance of losing data inadvertently.

- Leo now saves and restores marks and the expansion state of nodes in @thin trees.

- Leo marks @thin nodes as dirty whenever they become "newly unignored", i.e.,
when an @thin node no longer falls in the range of an @ignore directive.

Beta 1 completes all fundamental work in the 4.2 code base. All essential code
is complete. Dozens of bugs have been fixed since the Alpha 3 release about a
month ago.

Known bugs in 4.2 beta 2:

- Not all plugins work correctly.
- Some plugins leak memory very slightly.

The highlights of Leo 4.2:

- @thin trees make Leo much more friendly to cvs. Files derived from @thin can
be committed to cvs and updated from cvs without having to commit or update the
corresponding .leo file. There is no longer any need to keep .leo files and
external files in synch.

- Leo's data structures have been reorganized. As a result, all outline
operations are much faster. To support this organization, scripts that traverse
Leo's data structures must now use a positions rather than vnodes. Old scripts
that appear to use vnodes will still work because methods like c.currentVnode
that appear to return vnodes actually return positions.

Other features of 4.2:

- Leo is now much more friendly to using spaces instead of tabs.
- The Execute Script command reports erroneous lines more clearly.
- The usual assortment of bug features and minor features.

Coming soon in 4.2:

- Perfect Import will guarantee that Leo imports file perfectly.
- @import will allow you to study files using Leo without changing those files.
#@+node:EKR.20040628095213.311: *5* New coding conventions
@nocolor

- Leo now uses True and False everywhere instead of true and false.

- All of Leo's code uses spaces instead of tabs for indentation.
#@+node:EKR.20040524104904.242: *5* Extending the format of .leo files
Leo reads and writes "foreign" attributes in <v> and <t> elements in .leo files as follows:

- When reading a .leo file, Leo will create t.unknownAttributes or v.unknownAttributes ivars for
  any tnode or vnode whose corresponding <v> or <t> element in the .leo file contains a foreign attribute.

- The unknownAttributes ivars are dictionaries whose keys are the attribute names and whose values are strings.

- When writing a file, Leo will write "foreign" attributes if a vnode or tnode contains an unknownAttributes ivar.

- The only native attribute of <t> elements is tx.

- The native attributes of <v> elements are a, t, vtag and tnodeList.

- The native attributes of <v> elements are marks, expanded and descendentTnodeUnknownAttributes.

- Non-native attributes are called **foreign** attributes.

- Leo performs the usual xml escapes on these strings when reading or writing the unknownAttributes ivars.

Plugins may cause Leo to write such foreign attributes simply by attaching unknownAttributes ivars to a vnode or tnode.
Like this::

	if hasattr(v,"unknownAttributes"):
		v.unknownAttributes ["vnodeIcon"] = pathToIcon
	else:
		v.unknownAttributes = {"vnodeIcon" : pathToIcon}

See the section called "Recommended conventions for plugins" for advice about
how to avoid potential conflicts in naming new attributes.

All members of these dictionaries should be "pickleable". That is, Leo uses
Python's Pickle module to encode all values in these dictionaries. Leo will
discard any attributes that can not be pickled. This should not be a major
problem to plugins. For example, instead of putting a tnode into these
dictionaries, a plugin could put the tnode's gnx (a string) in the dictionary.

Leo writes only t.unknownAttributes when writing @thin trees to the .leo
file. Leo puts (the encoding of) these elements into an attribute called
descendentTnodeUnknownAttributes. This attribute is part of the <v>
element representing the @thin node. Leo does _not_ write
v.unknownAttributes in @thin trees because *only tnodes have gnx's in
thin external files*. In effect, vnodes are anonymous. We could attempt to get
around this by identifying vnodes by their corresponding tnodes, but that's not
a general solution and it is, in effect, equivalent to writing only
t.unknownAttributes. So it seems pointless to "pretend" to be writing
v.unknownAttributes.

The effect of this is to make all vnodes identical, as far as using
unknownAttributes is concerned. This won't work in all cases. For example, a
plugin that creates an arbitrary directed graph between vnodes must distinguish
between joined vnodes. In that case, the plugin should confine itself to @file
trees, or just vnodes in .leo files, for that matter.
#@+node:ekr.20040705111716: *5* in 4.2 b2
#@+node:ekr.20040705111716.1: *6* Savedmarks and expantion state in <v> elements for @thin nodes
Leo will write only t.unknownAttributes to the .leo file when writing the <v>
element corresponding to the root of an @thin tree. Leo will do this by writing
a new xml attribute, say descendentTnodeUnknownAttributes, in <v> element.

The reason that Leo will only write t.unknownAttributes and not
v.unknownAttributes is that only tnodes have gnx's in thin external files. In
effect, vnodes are anonymous. We could attempt to get around this by identifying
vnodes by their corresponding tnodes, but that's not a general solution and it
is, in effect, equivalent to writing only t.unknownAttributes. This being so, it
seems pointless to "pretend" to be writing v.unknownAttributes.

The effect of this is to make all vnodes identical, as far as using
unknownAttributes is concerned. As I've stated in the past, this won't do if,
for example, a plugin is trying create an arbitrary directed graph between
vnodes. In that case, the plugin should confine itself to @file trees, or just
vnodes in .leo files, for that matter.

7/1/04:

- Leo now writes "marks" and "expanded" attributes in the root <v> element for @thin trees.

- VERY IMPORTANT.  Leo now writes entire tree of @ignored @thin nodes.  This fixes a major bug.
#@+node:ekr.20040705111716.45: *6* Marked all related @thin nodes dirty when a node changesd
Leo marks as dirty all @file nodes when they become "newly unignored".
#@+node:ekr.20040705111716.126: *6* Fixed bug when reading  4.1 files with topology errors
#@+node:ekr.20040705150130: *6* Leo passes all important pychecker tests
Leo now generates no warnings with all significant tests enabled.  Some tests have been disabled in bases classes, and in a few cases pychecker gives erroneous warnings that have been suppressed directly in the source code using the __pychecker__ = arg syntax.
#@+node:ekr.20040705112148: *5* in 4.2 b1
#@+node:EKR.20040628095213.513: *6* Changed *nix install script
#@+node:EKR.20040628100535: *6* Fixed bugs
@killcolor
#@+node:EKR.20040628095213.3: *7* Made "end1" and "ilde"events work again
- Leo calls g.enableIdleTimeHook at end of startup code.
	- This means that g.idleTimeHookHandler gets called periodically, even if no hooks have been defined.
	- g.enableIdleTime hook now calls g.app.gui.setIdleTimeHook at most once.

- app.forceShutdown now calls "end1" hook before calling app.finishQuit.
	- This ensures that the "end1" hook always gets called once.
	- app.finishQuit calls doHook("end1",...) only if it hasn't been called before.
		- This isn't necessary, but it makes traces in doHook less confusing.

- idleTimeHookHandler now calls the idle-time hook for all open windows.
	- So having multiple windows open should not affect idle-time hooks.

** Warning: new convention required to workaround apparent Tk problems.
	- "idle" hooks should return if g.app.killed is True.
#@+node:EKR.20040628095213.23: *7* Put drawing hooks back in
@color

Added the following hooks:

tag argument                                               keys in keywords
(hook name)           overrides    when called           dictionary argument
---------             ---------    -----------           -------------------

"draw-outline-box"       yes   start of drawBox          tree,p,v,x,y (note 6)
"draw-outline-icon"      yes   start of tree.drawIcon    tree,p,v,x,y (note 6)
"draw-outline-node"      yes   start of tree.drawNode    tree,p,v,x,y (note 6)
"draw-outline-text-box"  yes   start of tree.drawText    tree,p,v,x,y (note 6)
"draw-sub-outline"       yes   start of tree.drawTree    tree,p,v,x,y,h,level,hoistFlag (note 6)
#@+node:EKR.20040628095213.56: *7* Fixed syntax colouring Bug in html mode
#@+node:EKR.20040628095213.60: *7* Colorizing fixes
Added support for RapidQ, css, shell scripts and PHP.
#@+node:EKR.20040628095213.113: *7* Fixed Select All bug
When in headline, the Select All command selected the body text.
#@+node:EKR.20040628095213.121: *7* Fixed bugs in @tab_width: support backspace with negative tab width
- idle_body_key must call g.scanDirectives in order to support @tab_width.
	- This must be done for tabs and newlines.

- Fixed bug in g.scanDirectives that was rejecting negative tabwidth values.
	- This bug did not exist in the other versions of scanDirectives.

- With a negative tabwidth, a backspace now computes what spaces are equivalent
to a tab and delete all of those. This is easy to do!
#@+node:EKR.20040628095213.143: *7* Fixed bugs in Remove Sentinel command
#@+node:EKR.20040628095213.160: *7* Eliminated spurious error messages in Import External File command
#@+node:EKR.20040628095213.192: *7* Removed gnx in headlines when importing thin external files
#@+node:EKR.20040628095213.202: *7* Fixed bugs reading 4.1 files
atFile.scanHeader was not handling -encoding fields properly.
#@+node:EKR.20040628095213.213: *7* Fixed Open With bug
#@+node:EKR.20040628095213.225: *7* Fixed Go To Line Number command
#@+node:EKR.20040628095213.246: *7* Fixed crash when importing Borland wstring.cpp
Namespace not handled very well.
#@+node:EKR.20040628095213.279: *7* Fixed bug in insertBodyTime
I inserted "import time", and while I was at it I improved the error checking.
#@+node:EKR.20040628095213.297: *7* Fixed bug when pasting large text into headlines
The code now limits what can be pasted to a maximum of one line or a about 250 characters.
#@+node:EKR.20040628095213.308: *7* Fixed bug in delete command
#@+node:EKR.20040628095213.312: *7* Fixed oops: nullGui setIdleTimeHook
#@+node:EKR.20040628095213.324: *7* Fixed problems with trailing newlines and spurious changed bit
- Set removeTrailing to True unless ch is a newline.

This allows Alt-f to work properly.

- Return "break" after the "final" text has been computed if nothing has changed.

This suppresses spurious newlines.

A new idea:  Make sure the text _does_ have a newline at all times.  I'm not sure this will work...

- ALWAYS set the text in select.  This prevents some weird problems with trailing newlines.
#@+node:EKR.20040628095213.346: *7* Fixed headline key handling
Hitting return in middle of a headline didn't work.
#@+node:EKR.20040628095213.348: *7* Fixed Problems executing script
#@+node:EKR.20040628095213.354: *7* Fixed problem with PHP and @last
#@+node:EKR.20040628095213.366: *7* Fixed bug when writing unknownAttributes
#@+node:EKR.20040628095213.368: *7* Fixed bugs opening a second file
#@+node:EKR.20040628095213.404: *7* Fixed bug: @last silently failed when extra lines exist
#@+node:EKR.20040628095213.407: *7* Fixed hang when dragging from one clone copy to another
#@+node:EKR.20040628095213.412: *7* Fixed crash in Write Missing
#@+node:EKR.20040628095213.442: *7* Fixed bug in getScript
This only happened after previous write error.

The fix was to init self.errors in openWriteFile.

The whole atFile logic is pretty gruesome.  It's got to be cleaned up.
#@+node:EKR.20040628095213.444: *7* Fixed problems with @all
- Allow indented @all.
    - Changed to g.is_special
    - Changed leoColor.doAtKeyword

- Fixed bug in is_special that broke p.isAtAllNode.
#@+node:EKR.20040628095213.499: *7* Fixed double print in Execute Script command
#@+node:EKR.20040628095213.512: *7* Fixed bug reading leo.nsi
The problem was setting endSentinelComment to None instead of "" in readDirective.

The code is pretty fragile; it should handle either None or "", but in fact it requires "".
#@+node:EKR.20040628100535.1: *6* Added new features
#@+node:EKR.20040628095213.52: *7* Allowed </leo_header> tag
#@+node:EKR.20040628095213.109: *7* Replaced the word "Leo" with Leo icon in Find/Compare/Prefs windows
http://sourceforge.net/forum/message.php?msg_id=2429098

The Leo icon can eliminate the need for the word Leo.

What I did:

- Eliminate Leo in name of Find panel.
- Derived leoTkinterPrefs from leoTkinterDialog: creates icon.
- Derived leoComparePanel from leoTkinterDialog: creates icon.
- Eliminated the -t option when opening Idle: the idle window is now called "Python Shell"
#@+node:EKR.20040628095213.110: *7* Improved Import command slightly
- Added @language html when importing ".htm" and ".html" files.
- Added @nocolor when importing ".txt" and ".text" files
#@+node:EKR.20040628095213.197: *7* Added 3 files to distribution lists
doc\leoUsersGuide.txt
doc\leoFAQ.txt
doc\leoLeaps.txt
#@+node:EKR.20040628095213.198: *7* Supported @tabwidth in indent/dedent
The old code used at c.tab_width.  It should also look for @tabwidth directives.

This was not good when @tabwidth -4 was in effect.
#@+node:EKR.20040628095213.264: *7* Import now creates absolute path
#@+node:EKR.20040628095213.269: *7* Created @killcolor directive
#@+node:EKR.20040628095213.282: *7* Added Paste Retaining Clones command
- By default, finishPaste command reassigns all indices in copied nodes.
- Created pasteOutlineRetainingClones.
- Added reassignIndices arg to pasteOutline, getLeoOutline and finishPaste.
- Added << recreate tnodesDict >> in getLeoOutline.
- Simplified getTnode slightly: the "if t" code is the same for both kinds of reads.
#@+node:EKR.20040628095213.314: *7* Added readLineGenerator & readLineClass to leoGlobals
#@+node:EKR.20040628095213.334: *7* Much better error handling in executeScript
- The string passed to exec now includes sentinels.

goToLineNumber needs sentinels to work properly.

- es_exception now gets the error line number from the traceback.

- Added new keyword arguments to goToLineNumber.

- Created goToScriptLineNumber, which just calls goToLineNumber.
#@+node:EKR.20040628095213.377: *7* Recovered nodes when reading .leo files containing topology errors
Changed getVnode so it checks for v = None after calling getExistingVnode.  Creating the node seems to work in this case: I wouldn't bet my life that it works in all cases.
#@+node:EKR.20040628095213.391: *7* Generalized write-to-string logic
- Added toString to most write methods.
- Retained scriptFile option for compatibility with plugins.
#@+node:EKR.20040628095213.408: *7* Added case_sensitiveLanguage to colorizer
#@+node:EKR.20040628095213.425: *7* Write entire @thin tree on write errors
#@+node:EKR.20040628095213.485: *7* Handled inner @language and @comment properly
There was a small hole in the format of external files. Leo assumed that comment
delimiters do not change within any particular external file. This assumption is
not necessarily true in files like leoProjects.txt.

What I did:

- putDirective and readDirective now check for @langauge and @comment, and
change comment delims appropriately.

This is slightly dubious: after all, an @langauge directive in the middle of
most external files will cause havoc. However, one could say that this is the
users problem :-)

BTW, this doesn't really solve all problems in @all trees: Leo can still get
mightily confused about comment delims if the user doesn't put proper @language
directives in @all trees.
#@+node:EKR.20040628095213.490: *7* Better reporting of body text conflicts
readEndNode uses the existing tempBodyString attribute to determine if the body text has changed.  If so, we mark the tnode dirty.  The code in 

top_df.read.<< copy all tempBodyStrings to tnodes >>

propagates the dirty marks to all ancestor @file nodes.  This can't be done in readEndNode because no positions are available at that time.
#@+node:EKR.20040628095213.493: *7* Improved error handling for unknownAttributes
#@+node:EKR.20040628095213.501: *7* Read and write all t.unknownAttributes in top vnode of an @thin tree
Leo now writes t.unknownAttributes to the .leo file when writing the <v> element
corresponding to the root of an @thin tree. Leo will do this by writing a new
xml attribute, descendentTnodeUnknownAttributes, in <v> element.

Leo will only write t.unknownAttributes, not v.unknownAttributes. This is
because only tnodes have gnx's in thin external files. In effect, vnodes are
anonymous. We could attempt to get around this by identifying vnodes by their
corresponding tnodes, but that's not a general solution and it is, in effect,
equivalent to writing only t.unknownAttributes. This being so, it seems
pointless to "pretend" to be writing v.unknownAttributes.

The effect of this is to make all vnodes identical, as far as using
unknownAttributes is concerned. As I've stated in the past, this won't do if,
for example, a plugin is trying create an arbitrary directed graph between
vnodes. In that case, the plugin should confine itself to @file trees, or just
vnodes in .leo files, for that matter.
#@+node:EKR.20040601084317: *4* 4.2 a3
Leo 4.2 alpha 3           June 1, 2004

This version fixes completes the essential features of version 4.2. All known
incompletions and bugs involving shared nodes and Leo's new file format have
been fixed. BTW, this version of Leo completes Leaps 201 and 202.

It should be safe to use this version for collaboration between Leo's
developers. I hereby encourage people to start using cvs for collaboration. Only
by doing so will we discover any possible problems.

The only item that must be completed before releasing 4.2 beta is fixing the Go
To Line Number command so it supports thin external files.

There are many known bugs in this version: most are minor bugs that have been
around for a long time. All known bugs will be fixed by the first release
candidate. See the to-do list in LeoPy.leo for the complete list.

The highlights of this version:

- All features of @file-thin are now complete and appear to be stable. - All
	.leo files in the distribution use @thin files where possible. - Leo ignores
	all directives within the range of the @all directive. - The @+middle and
	@-middle sentinels allow sections to be defined in any descendant node. -
	The @clone sentinel marks duplicate cloned siblings. - The beginnings of a
	new undo scheme are in place. - @thin, @nosent, @noref and @asis are
	abbreviations for @file-thin, @file-nosent, @file-noref and @file-asis. -
	Created new iterators that return lists of vnodes and tnodes, including
	iterators that remove all duplicates from those lists.
#@+node:EKR.20040601084317.2: *5* Bug fixes
#@+node:EKR.20040601101118: *6* Fixed copy/paste operations involving @thin trees
If the copied node was an @thin or @file-thin node node only the root node was copied.
#@+node:EKR.20040601101430: *6* Fixed Change Headline command
This bug exists in 4.1 final. Leo did not properly show the found text in
headlines. The fix was in the code that redraws the screen, not in the
find/change code itself.
#@+node:EKR.20040601084317.99: *6* Eliminated spurious "Not written x.tmp" message after write errors
This happened after write errors such as orphan nodes.
#@+node:EKR.20040601084317.142: *6* Fixed problems saving unknownAttribute field
When writing .leo files Leo now pickle's and hexlify's all data in the
v.unknownAttribute and t.unknownAttribute dictionaries. When reading .leo files
Leo does the reverse.

Leo ignores all elements in these dictionaries if some element can not be pickled.
#@+node:EKR.20040601102115: *6* Fixed unicode problem in the Dump Outline command
#@+node:EKR.20040601101227: *5* New Features
#@+node:EKR.20040601101227.1: *6* Leo ignores all directives in @all trees
#@+node:EKR.20040601101430.1: *6* @+-middle sentinels allow sections to be defined in grandchildren
#@+node:EKR.20040601101510: *6* @clone sentinel allows siblings to be cloned
#@+node:EKR.20040601101547: *6* Created @thin, @nosent, @noref and @asis abbreviations
#@+node:EKR.20040601084317.102: *6* Made undo extensible
Added u.registerUndoHandlers.

This will become largely unnecessary in the new undo scheme.  It's good to have though.
#@+node:EKR.20040601102703: *6* Started work on simple new undo scheme
The new scheme simply saves all information in one or more vnodes and their
associated tnodes. This is a general scheme that can be used by almost any
command.

At present only the u.saveTree method exists. Coming soon, u.saveNode,
u.saveNodeAndChildren and u.saveListOfNodes.
#@+node:EKR.20040601084317.161: *6* Created new c, p, v iterators
I have fallen madly in love with generators.
The following new iterators are defined with generators.

c.all_positions_iter
c.all_tnodes_iter
c.all_vnodes_iter
c.all_unique_tnodes_iter
c.all_unique_vnodes_iter

p.tnodes_iter
p.vnodes_iter
p.unique_tnodes_iter
p.unique_vnodes_iter

v.self_and__subtree_iter
v.self_and_unique_subtree_iter
#@+node:EKR.20040601102808: *5* Known bugs
See the to-do list in LeoPy.leo for a list of known bugs in this version.

None of these bugs is serious:  I consider this version to be suitable for day-to-day work.
#@+node:EKR.20040518070558: *4* 4.2 a2
Leo 4.2 alpha 2           May 18, 2004

This is an important milestone in Leo's history; the two defining features of
the 4.2 code base are complete:

1. This is the first stable version using the "shared nodes" code base.

Shared nodes dramatically improve the time needed to insert, delete, and move
nodes. Moreover, the new code base is code compatible with the old. Indeed, much
of Leo still uses the old code base. See the Scripting Leo for full details of how to
script Leo with the 4.2 code base.

2. This is the first version to use @file-thin for most external files.

@file-thin makes it possible to use Leo effectively in a cvs environment.  Indeed, cvs now contains only a "dummy" version of LeoPy.leo.  The idea is that:

- LeoPyRef.leo hardly ever changes. Developers will download LeoPyRef.leo once
from cvs, then rename LeoPyRef.leo to be LeoPy.leo. LeoPy.leo is private to each
developer.

- Developers will commit and update to cvs only thin external files. There is no
longer any need to keep .leo files and the files derived from them "in synch".

- Similar remarks apply to LeoPlugins.leo. Cvs contains only LeoPluginsRef.leo,
and contributors will need only to submit thin external files.

I have been using the new code base without incident for weeks now, and I am
fairly confident that it is safe to use. Nevertheless, I would suggest routine
caution when dealing with this version until more people have tested it.

Known bugs

- Cutting and pasting an @file-thin node does not work properly. This will be
easy to fix, I think.

- The present algorithm for reading thin external files probably does not handle
properly the situation in which a named node is some kind of grand child of the
referencing node rather than being an immediate child of the referencing node.
This is a rare situation, easily avoided, and it doesn't happen at all in
LeoPy.leo. Nevertheless, something must be done.

Other improvements:

- Fixed a number of problems with using Leo on MacOS X. In particular, Leo now
uses the clover key as is usual on the Mac. More Mac and *nix specific
improvements are coming.

Still to do:

- Perfect import and @import. - Make the Go To Line Number command work with
@file-thin files. - Fix minor bugs and add new features See the "To Do: 4.2"
node in the leoToDo.txt node in LeoPy.leo.
#@+node:EKR.20040518070940.5: *5* Implemented @file-thin
What I did:

File format

Added -thin field to @+leo sentinel

Recognizers

- Added vnode recognizers for @file-thin option.
- Added position proxies for vnode recognizers.

Directives & sentinels
- Added support for @all.

Writing

- Added top-level atFile code to write @file-thin tree.
- DO write @file-thin vnodes if there was an error writing the external file.
	- No autosave for @file-thin.
 	- Leo writes @file nodes first, so this is not a problem.
	- putVnode checks orphan bit, which gets set if there was an error.
- Don't write vnodes (or related tnodes) for @file-thin trees. (fileCommands).
- Do write empty nodes in @thin trees.
- Don't generate close node sentinels until all children have been generated.

Reading

- Set at.thinFile when reading thin files.
- Suppressed changed message and related items for thin files.
- Modified scanText4 and allies to read thin external files.
	- Don't look for tnodeList for thin files.
	- Initially, at.lastThinNode is at.root.v
	- readStartNode calls createThinChild
	- createThinChild makes a child of at.lastThinNode if needed and sets at.lastThinNode.
- Updated fc.tnodesDict in at.createThinChild.
	Otherwise clones existing only in two thin files won't be linked properly.
#@+node:EKR.20040518070824: *5* Fixed bugs
#@+node:EKR.20040518071415: *6* Fixed clone bug that caused parts of outlines to disappear
Leo did not handle moving a node to the root position of the outline correctly.
#@+node:EKR.20040518070940.156: *6* Fixed long-standing problem with the outline-only command
After a match, the find-next command searched only in the suboutline where the first match occurred.
To fix this, we call g.app.findFrame.handleUserClick in various Tk event handlers.
#@+node:EKR.20040518070824.1: *6* Made sure file indices are always assigned when writing files.
- Moved call to assignFileIndices into write_Leo_file.
- Called assignFileIndices in writeAtFileNodes, writeDirtyAtFileNodes, writeMissingAtFileNodes
#@+node:EKR.20040518070940: *6* Fixed problems with missing tnodeList with @file-noref
#@+node:EKR.20040518070940.164: *6* Added t.writeBit
@nocolor


p.v.t.visitedBit was used for two purposes:

- To mark the nodes to be written.
- To mark nodes that are not orphan.

What I did:

- Added t.is/set/clearWriteBit.
- Call t.setWriteBit in putVnode unless we are in a thin node.
- putTnodes tests for t.writeBit rather than t.visitedBit.
#@+node:EKR.20040518075457: *5* Dangers of @file-thin
Using @ignore with @file-thin is asking for trouble.
If you remove the @ignore and then save, you will lose data.

How to recover the data:
	- Read Outline.
	- Remove @ignore
	- Import External File... 
#@+node:ekr.20060206111600: *3* 4.3...@settings
#@+node:ekr.20050917092557: *4* 4.3.3 final
Leo 4.3.3 final                 September 17, 2005

Leo 4.3.3 fixes several bugs reported in Leo 4.3.2 final in the last several days.

To learn about Leo, see: http://webpages.charter.net/edreamleo/intro.html

The highlights of 4.3.3 (and 4.3.2)
-----------------------------------

- Improved Leo's documentation:
    - A tutorial introduction to Leo:
      http://webpages.charter.net/edreamleo/intro.html
    - A 5-minute guide to programming with Leo:
      http://webpages.charter.net/edreamleo/intro.html#quick-start-for-programmers

- The new rst3 plugin creates .html and .tex files from reStructuredText
  embedded in Leo files. Any node of the source outline may contain options for
  the rst3 plugin, which makes this plugin much more useful and flexible than
  the previous rst plugins. All of Leo's documentation was created using this
  plugin from sources in LeoDocs.leo. For full documentation for rst3 see:
  http://webpages.charter.net/edreamleo/rstplugin3.html.

- The spellpyx (spell checking) plugin is now much easier to use.

- The vim and openWith plugins now use Python's subprocess module if it is present.

- Improved the Pretty Printing command.

- The usual assortment of bug fixes.
#@+node:ekr.20050917105646: *5* Fixes made in 4.3.3
- Fixed bug that caused the Open With command to crash if the subprocess module was not installed.

- Fixed problems in the niceNocent and fastGotoNode plugins.
#@+node:ekr.20050917092557.1: *5* Rewrote documentation
Here is a summary of the changes:

- General: All chapters created with rst3 plugin. This ensures a uniform look.
The source is in LeoDocs.leo. Removed all references to older versions of Leo,
except when discussing old file formats in the Appendices. Corrected all text so
it discusses present version.

- rst3 plugin itself: Correct bug that caused chapters to be formatted
differently when processing multiple @rst trees.

- rst3 button in LeoDocs.leo: The script first looks *up* the tree, looking for
an @rst node. If found, it processes just that tree. If not found, it processes
all @rst nodes *below* the originally selected node. The button is now much more
convenient to use.

- Preface: Shorter, no history. No longer a dead end.

- What People are Saying About Leo: No longer a dead end.

- FAQ: Reorganized, simplified, revised. Added entries for running Leo in a
console window and debugging docutils. Improved entry for using cvs.

- Installation: Now the first chapter. Revised.

- Tutorial: Completely rewritten. Like Python's tutorial, this
chapter contains everything a beginner needs to understand and use Leo. The
`Quickstart for programmers` section is the heart of this chapter. All terms
used have links either to their definition in the tutorial or in the Glossary.
Newbies should be able to digest this chapter easily. This chapter should make
Leo comprehensible to many more people.

- Using Outlines: Revised per general remarks above.

- Writing Programs in Leo. Completely rewritten. The old chapter was
an embarrassment. The new chapter is a reference guide, properly organized as
such. The introduction warns newbies away.

- Using Leo's Commands. 'Minor' revisions and corrections create a
substantially better result.

- Scripting Leo with Python: Rewritten, simplified, updated and
corrected. The sources in LeoDocs.leo are directly executable. rST sources use
literal blocks instead of code-blocks so that the sources are simplified.
(Important when executing examples). Properly discusses positions, including
'supremely important' section on copying positions.

- Customizing Leo. Heavily revised. Discusses leoSettings.leo, not
leoConfig.txt. Security warnings are more reasonable. Section on script buttons.
Rewrote section on uA's (Adding extensible attributes to nodes and .leo files).

- History of Leo. Rewritten. Much shorter and more useful. Discusses
the major milestones, concentrating on explaining the major differences between
versions. Gone are details of how discoveries came to be. They are in
LeoPostings.leo, which will be included in the distribution.

- Theory of Operation. Largely rewritten. Discusses positions
properly. Omits discussion of how clones were implemented before 4.2.

- White Papers. A new chapter. This is a slightly-edited version of
writing that had been buried in the appendices.

- Appendices. Heavily revised and reformatted. Rewrote sections on file formats.

- Glossary: A separate chapter. All terms have links to their definition. All
definitions are rST targets so other chapters may refer to them. Added several
new entries.
#@+node:ekr.20050917092557.2: *5* Bug fixes...
#@+node:ekr.20050917092557.3: *6* Fixed various unicode bugs
- Fixed bug with non-unicode characters in file name

    http://sourceforge.net/forum/message.php?msg_id=3224635

    Leo crashed try to read .leo files whose name contained non-ascii characters.

- Fixed bug with non-unicode characters in settings value

    http://sourceforge.net/forum/message.php?msg_id=3222750

    Leo crashed try to write settings whose values contained non-ascii characters.

- Fixed bug tangling sections with non-unicode characters.

    http://sourceforge.net/forum/message.php?msg_id=3307318
#@+node:ekr.20050917092557.4: *6* Fixed bugs relating to recent files
http://sourceforge.net/forum/message.php?msg_id=3218558
#@+node:ekr.20050917092557.5: *6* Fixed minor crasher in colorizer
The fix was to add an entry of 'unknown' state to state_dict. This fixes the
crash by brute force, but may not be strictly correct. However, this is pretty
much moot: we shall soon be moving to the new colorizer.
#@+node:ekr.20050917092557.6: *6* Protected several methods used by plugin manager
The code gets c = keywords.get('c') in several places.
The protection is to return if c is None.
This affects the following files: plugins_menu.py, pluginsTest.py, plugin_manager.py
#@+node:ekr.20050917092557.7: *6* Added test files to distribution list and cvs
http://sourceforge.net/forum/message.php?msg_id=3231597

test.leo had some non-@ignore'd @thin nodes for files not in the distribution.

- Only files used by unit tests should be on cvs and the distribution.
    - test\unittest\batchTest.py and test\unittest\errorTest.py were already on cvs.
    - Added these files to the distribution.

- Other test files should be distributed in @ignore nodes.

- Leo's distribution checklist now has an item to check that the distributed test.leo can be opened without errors.
#@+node:ekr.20050917092557.8: *5* New and improved  plugins
#@+node:ekr.20050917092557.9: *6* New rst3 plugin
See http://webpages.charter.net/edreamleo/rstplugin3.html for full documentation
of this plugin.

The rst3 plugin creates output files from Leo outlines containing
reStructuredText (rST) ReStructuredText is a simple and powerful text formatting
markup language. Outlines are a natural way to organize rST (or any text).

This plugin adds the Write Restructured Text command to Leo's Edit menu. The
Write Restructured Text command searches the selected outline looking for rst
root nodes whose headline have the form @rst <filename>. The plugin then creates
the named file in various ways depending which rst3 options are in effect.

By default, the rst3 plugin creates rST headings automatically from outlines, so
the higher-level nodes in the outline correspond to higher-level sections in the
output. Creating rST headings automatically relieves you from one of the most
tedious chores in creating rST markup.

To use this plugin effectively, Python's docutils module must be installed. The
rst3 plugin will use the SilverCity syntax coloring package if it installed.

This plugin sends .htm, .html or .tex files to the docutils module for further
processing. Docutils generates HTML files or LaTeX files depending on the file's
extension. HTML files generated by docutils refer to three .css (cascading style
sheet) files that should exist in the same directory as the generated HTML file.
You can control the formatting of the HTML file by altering these .css files.
#@+node:ekr.20050917092557.11: *6* Improved vim and openWith plugins
These plugins now use Python's subprocess module if it is present. The
subprocess module comes standard with Python 2.4. For Linux systems, Leo will
use subprocess.py in Leo's extensions folder if necessary.

For Windows systems you can install Python's subprocess module in Python 2.2 or
2.3 as follows:

    - Go to http://www.effbot.org/downloads/#subprocess

    - Download and execute one of the following installers, depending on your version of Python:
        subprocess-0.1-20041012.win32-py2.3.exe 
        subprocess-0.1-20041012.win32-py2.2.exe

This installer installs the subprocess sources and also _subprocess.pyd in Python's site-packages folder.
#@+node:ekr.20050917092557.12: *5* New & improved features...
#@+node:ekr.20050917092557.13: *6* Added g.es_print, g.es_trace function
Calling print directly is dangerous: it will fail for unicode characters.
#@+node:ekr.20050917092557.14: *6* Improved PrettyPrinting
The new Pretty Print code has the following improvements:

- Strip trailing blanks in get.
- Many improvement to doOp.
- Improved DoMultiline:
    - Added special case logic to ensure '#' is preceded by space except at start of line.
    - Added blank after multi-line string if needed.
- Added lastName token for special-case handling depending on previous token.
- No change to put, putArray or doName.
#@+node:ekr.20050913131848: *4* 4.3.2 final
Leo 4.3.2 final                 September 16, 2005

To learn about Leo, see: http://webpages.charter.net/edreamleo/intro.html

The highlights of 4.3.2:
-----------------------

- Improved Leo's documentation:
    - A tutorial introduction to Leo:
      http://webpages.charter.net/edreamleo/intro.html
    - A 5-minute guide to programming with Leo:
      http://webpages.charter.net/edreamleo/intro.html#quick-start-for-programmers

- The new rst3 plugin creates .html and .tex files from reStructuredText
  embedded in Leo files. Any node of the source outline may contain options for
  the rst3 plugin, which makes this plugin much more useful and flexible than
  the previous rst plugins. All of Leo's documentation was created using this
  plugin from sources in LeoDocs.leo. For full documentation for rst3 see:
  http://webpages.charter.net/edreamleo/rstplugin3.html.

- The spellpyx (spell checking) plugin is now much easier to use.

- The vim and openWith plugins now use Python's subprocess module if it is present.

- Improved the Pretty Printing command.

- The usual assortment of bug fixes.
#@+node:ekr.20050906104918.1: *5* Rewrote documentation
Here is a summary of the changes:

- General: All chapters created with rst3 plugin. This ensures a uniform look.
The source is in LeoDocs.leo. Removed all references to older versions of Leo,
except when discussing old file formats in the Appendices. Corrected all text so
it discusses present version.

- rst3 plugin itself: Correct bug that caused chapters to be formatted
differently when processing multiple @rst trees.

- rst3 button in LeoDocs.leo: The script first looks *up* the tree, looking for
an @rst node. If found, it processes just that tree. If not found, it processes
all @rst nodes *below* the originally selected node. The button is now much more
convenient to use.

- Preface: Shorter, no history. No longer a dead end.

- What People are Saying About Leo: No longer a dead end.

- FAQ: Reorganized, simplified, revised. Added entries for running Leo in a
console window and debugging docutils. Improved entry for using cvs.

- Chapter 1: Installation: Now the first chapter. Revised.

- Chapter 2: Tutorial: Completely rewritten. Like Python's tutorial, this
chapter contains everything a beginner needs to understand and use Leo. The
`Quickstart for programmers` section is the heart of this chapter. All terms
used have links either to their definition in the tutorial or in the Glossary.
Newbies should be able to digest this chapter easily. This chapter should make
Leo comprehensible to many more people.

- Chapter 3: Using Outlines: Revised per general remarks above.

- Chapter 4: Writing Programs in Leo. Completely rewritten. The old chapter was
an embarrassment. The new chapter is a reference guide, properly organized as
such. The introduction warns newbies away.

- Chapter 5: Using Leo's Commands. 'Minor' revisions and corrections create a
substantially better result.

- Chapter 7: Scripting Leo with Python: Rewritten, simplified, updated and
corrected. The sources in LeoDocs.leo are directly executable. rST sources use
literal blocks instead of code-blocks so that the sources are simplified.
(Important when executing examples). Properly discusses positions, including
'supremely important' section on copying positions.

- Chapter 8: Customizing Leo. Heavily revised. Discusses leoSettings.leo, not
leoConfig.txt. Security warnings are more reasonable. Section on script buttons.
Rewrote section on uA's (Adding extensible attributes to nodes and .leo files).

- Chapter 9: History of Leo. Rewritten. Much shorter and more useful. Discusses
the major milestones, concentrating on explaining the major differences between
versions. Gone are details of how discoveries came to be. They are in
LeoPostings.leo, which will be included in the distribution.

- Chapter 10: Theory of Operation. Largely rewritten. Discusses positions
properly. Omits discussion of how clones were implemented before 4.2.

- Chapter 11: White Papers. A new chapter. This is a slightly-edited version of
writing that had been buried in the appendices.

- Appendices. Heavily revised and reformatted. Rewrote sections on file formats.

- Glossary: A separate chapter. All terms have links to their definition. All
definitions are rST targets so other chapters may refer to them. Added several
new entries.
#@+node:ekr.20050906104931.1: *5* Bug fixes...
#@+node:ekr.20050909082711: *6* Fixed various unicode bugs
- Fixed bug with non-unicode characters in file name

    http://sourceforge.net/forum/message.php?msg_id=3224635

    Leo crashed try to read .leo files whose name contained non-ascii characters.

- Fixed bug with non-unicode characters in settings value

    http://sourceforge.net/forum/message.php?msg_id=3222750

    Leo crashed try to write settings whose values contained non-ascii characters.

- Fixed bug tangling sections with non-unicode characters.

    http://sourceforge.net/forum/message.php?msg_id=3307318
#@+node:ekr.20050906104931.15: *6* Fixed bugs relating to recent files
http://sourceforge.net/forum/message.php?msg_id=3218558
#@+node:ekr.20050906104931.38: *6* Fixed minor crasher in colorizer
The fix was to add an entry of 'unknown' state to state_dict. This fixes the
crash by brute force, but may not be strictly correct. However, this is pretty
much moot: we shall soon be moving to the new colorizer.
#@+node:ekr.20050906104931.42: *6* Protected several methods used by plugin manager
The code gets c = keywords.get('c') in several places.
The protection is to return if c is None.
This affects the following files: plugins_menu.py, pluginsTest.py, plugin_manager.py
#@+node:ekr.20050906104931.43: *6* Added test files to distribution list and cvs
http://sourceforge.net/forum/message.php?msg_id=3231597

test.leo had some non-@ignore'd @thin nodes for files not in the distribution.

- Only files used by unit tests should be on cvs and the distribution.
    - test\unittest\batchTest.py and test\unittest\errorTest.py were already on cvs.
    - Added these files to the distribution.

- Other test files should be distributed in @ignore nodes.

- Leo's distribution checklist now has an item to check that the distributed test.leo can be opened without errors.
#@+node:ekr.20050908164150: *5* New and improved  plugins
#@+node:ekr.20050908164150.1: *6* New rst3 plugin
See http://webpages.charter.net/edreamleo/rstplugin3.html for full documentation
of this plugin.

The rst3 plugin creates output files from Leo outlines containing
reStructuredText (rST) ReStructuredText is a simple and powerful text formatting
markup language. Outlines are a natural way to organize rST (or any text).

This plugin adds the Write Restructured Text command to Leo's Edit menu. The
Write Restructured Text command searches the selected outline looking for rst
root nodes whose headline have the form @rst <filename>. The plugin then creates
the named file in various ways depending which rst3 options are in effect.

By default, the rst3 plugin creates rST headings automatically from outlines, so
the higher-level nodes in the outline correspond to higher-level sections in the
output. Creating rST headings automatically relieves you from one of the most
tedious chores in creating rST markup.

To use this plugin effectively, Python's docutils module must be installed. The
rst3 plugin will use the SilverCity syntax coloring package if it installed.

This plugin sends .htm, .html or .tex files to the docutils module for further
processing. Docutils generates HTML files or LaTeX files depending on the file's
extension. HTML files generated by docutils refer to three .css (cascading style
sheet) files that should exist in the same directory as the generated HTML file.
You can control the formatting of the HTML file by altering these .css files.
#@+node:ekr.20050910143326: *6* Improved vim and openWith plugins
These plugins now use Python's subprocess module if it is present. The
subprocess module comes standard with Python 2.4. For Linux systems, Leo will
use subprocess.py in Leo's extensions folder if necessary.

For Windows systems you can install Python's subprocess module in Python 2.2 or
2.3 as follows:

    - Go to http://www.effbot.org/downloads/#subprocess

    - Download and execute one of the following installers, depending on your version of Python:
        subprocess-0.1-20041012.win32-py2.3.exe 
        subprocess-0.1-20041012.win32-py2.2.exe

This installer installs the subprocess sources and also _subprocess.pyd in Python's site-packages folder.
#@+node:ekr.20050906104931.48: *5* New & improved features...
#@+node:ekr.20050906104931.49: *6* Added g.es_print, g.es_trace function
Calling print directly is dangerous: it will fail for unicode characters.
#@+node:ekr.20050906104931.56: *6* Improved PrettyPrinting
The new Pretty Print code has the following improvements:

- Strip trailing blanks in get.
- Many improvement to doOp.
- Improved DoMultiline:
    - Added special case logic to ensure '#' is preceded by space except at start of line.
    - Added blank after multi-line string if needed.
- Added lastName token for special-case handling depending on previous token.
- No change to put, putArray or doName.
#@+node:ekr.20050906104918: *4* 4.3.2 beta 1
Leo 4.3.2 beta 1                  September 10, 2005

To learn about Leo, see: http://webpages.charter.net/edreamleo/intro.html

The highlights of 4.3.2:
-----------------------

- Improved Leo's documentation:
    - A tutorial introduction to Leo:
      http://webpages.charter.net/edreamleo/intro.html
    - A 5-minute guide to programming with Leo:
      http://webpages.charter.net/edreamleo/intro.html#quick-start-for-programmers

- The new rst3 plugin creates .html and .tex files from reStructuredText
  embedded in Leo files. Any node of the source outline may contain options for
  the rst3 plugin, which makes this plugin much more useful and flexible than
  the previous rst plugins. All of Leo's documentation was created using this
  plugin from sources in LeoDocs.leo. For full documentation for rst3 see:
  http://webpages.charter.net/edreamleo/rstplugin3.html.

- The spellpyx (spell checking) plugin is now much easier to use.

- The vim and openWith plugins now use Python's subprocess module if it is present.

- Improved the Pretty Printing command.

- The usual assortment of bug fixes.
#@+node:ekr.20050620144052: *4* 4.3.1
Leo 4.3.1                    June 20, 2005

- Added support for Tk resource files.
- Added support for coloring the PL/SQL language.
- All Mark commands are now undoable.
- Improved Resize To Screen command.
- The usual assortment of minor bug fixes.
#@+node:ekr.20050620144052.2: *5* Bug fixes...
#@+node:ekr.20050620144052.3: *6* Fixed bug in @ratio setting
http://sourceforge.net/forum/message.php?msg_id=3166883
By: rogererens

I swear I didn't wait for the release to be the first to report a bug! I just
didn't try this in the alpha/beta versions:

Leo 4.3 final, build  1.262 , May 23, 2005
Python 2.4.1, Tk 8.4.7, win32

Changing
Global settings: C:\Leo\config\leoSettings.leo-->Window options-->@page Options
for new windows-->@ratio initial_horizontal_ratio = 0.3
or any of the other ratios, does not save them to leoSettings.leo. So after
restarting I still have the old settings in use.
#@+node:ekr.20050620144052.6: *6* Fixed crasher footprint plugin
http://sourceforge.net/forum/message.php?msg_id=3167166

The fix was to add the following line to the init function:

    global click_registry, coloured_nodes
#@+node:ekr.20050620144052.8: *6* Fixed invalid position bug)
Modifying outlines can invalidate existing positions! This rarely happens. At
present it affects the atFile.read logic when reading an outline whose initial
current position is a clone outside an @thin tree with another clone inside the
@thin tree. So the read logic computes the expected current position before
reading all external files, and this expected current position becomes invalid.

What I did:

1. Moved << set current and top positions >> from getVnodes to end of
getLeoFile. This ensures that the outline won't change after computing the
position.

2. Unit tests will have to be revised to make sure that only valid positions get
used.
#@+node:ekr.20050620144052.48: *6* Fixed undo problems in unit tests
- Fixed bugs in convertAllBlanks and convertAllTabs.

These must always call afterChangeGroup to match beforeChangeGroup, even if
nothing has changed.

- Added u.getMark and u.rollbackToMark.

These allow unit tests to cut the undo stack back to an initial position in the
tearDown method. This should be done for all tests that use u.undo and u.redo
methods. The bug was probably the result of changing the outline in the tearDown
method.

Both the Reformat Paragraph and Edit Body unit tests now roll back the undo stack.

- Added traces for unexpected conditions in u.undo, u.redo and tree.select.

- Call u.setUndoTypes() in u.setUndoTypingParams when returning early.

- Corrected Edit Body unit tests.

These tests should not call undo/redo when nothing is expected to change. Doing
so may trigger the new 'cant undo' traces in u.undo.

- doTest in leoTest.py now makes copies of both p and p1.

It's not clear that this is needed, it can't hurt, and it may have been important.
#@+node:ekr.20050620144052.112: *6* Made sure same case is used in all recent files entries
The problem was that leo.__file__ returns a randomly upper or lower cased drive letter.
#@+node:ekr.20050620144052.114: *6* Made sure all dialogs gets focus when they are run
# The About Leo dialog was not getting focus.
#@+node:ekr.20050620144052.116: *6* Improved Resize To Screen command
#@+node:ekr.20050620144052.119: *6* Made sure comments are always visible in setting dialog even for non-@ nodes
http://sourceforge.net/forum/message.php?msg_id=3176499

5) am I missing text in the Settings panels?  the outline shows that certain
nodes have text (e.g., "About keyboard shortcuts" has the blue rectangle), yet
the body pane is empty; heck, even the title suggests that something should
be there...
#@+node:ekr.20050620144052.154: *6* Fixed problem with leading @ in body text
http://sourceforge.net/forum/message.php?msg_id=3190593

As luck would have it, I need to put an @ character at the beginning of a line
in source code (windows registry file format) and can't figure out how to do
it. 
#@+node:ekr.20050620144052.166: *6* Fixed several  crashers while undoing a move involving clones
#@+node:ekr.20050620144052.182: *6* Fixed Unicode encoding problem
http://sourceforge.net/forum/message.php?msg_id=3186385

I just tried 4.3-final, and it seems it does not work with Chinese LC_CTYPE:
#@+node:ekr.20050620144052.185: *6* Fixed problem with coloring @language plain
http://sourceforge.net/forum/message.php?msg_id=3175553

When I set default_target_language to plain in 4.2., no words in any body text
is colored. This behavior seems to have changed in 4.3. Is it right, that I
now have to write @nocolor on top of *every* body text to get rid of randomly
colored words?

What I did:

- Added entries for target_language to ivarsDic and defaultsDict in leoConfig.py.
- Added @language target_language = Python to leoSettings.leo.
- Convert c.target_language to lowercase in several places.
#@+node:ekr.20050620144602: *6* Fixed bug: Mark Clones command did not work
#@+node:ekr.20050620144052.207: *5* New features...
#@+node:ekr.20050620144052.208: *6* Created separate helpers for idle_body_key
idle_body_key now calls doAutoIndent and convertBlanksToTabs. The idea is that
plugins could override these methods if desired.
#@+node:ekr.20050620144052.210: *6* Made all Mark commands undoable
# I also fixed a bug: the Mark Clones command did not work!
#@+node:ekr.20050620144052.222: *6* Removed dependence on profile and pstats modules from leoTest.py
Some non-standard distributions don't include the profile and pstats modules.
#@+node:ekr.20050620144052.231: *6* Added support for tk resource files
Leo will now look for a file called .leo_xresources in the users home directory.
If found, Leo will pass that file to Tk's option_readfile method for the top
widget. This allows users to set Tk options.
#@+node:ekr.20050620144425: *6* Added support for coloring the PL/SQL language
#@+node:ekr.20050523092026: *4* 4.3-final
Leo 4.3 final                 May 23, 2005

Leo 4.3 is here after almost five months of work.

The defining features of Leo 4.3:
---------------------------------
1. Leo now stores options in @settings trees, that is, outlines whose headline
is '@settings'. When opening a .leo file, Leo looks for @settings trees not only
in the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.  Readers of Python's configParser shootout take note!

2. The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

3. Leo now stores recent files information in .leoRecentFiles.txt files.

4. Leo's read/write code in leoAtFile.py has been rewritten to support user-
defined tangling and untangling.  This is a major cleanup of Leo's core.

5. Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables
and disables plugins automatically. This plugin also tells you everything you need to know
about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

6. You can install third-party extensions in Leo's extensions directory. Leo
will attempt to import such extensions from the extensions directory if normal
imports fail. Leo is distributed with Pmw (Python Mega Widgets), path.py and
sets.py in this directory.
#@+node:ekr.20050523092056.1: *5* Fixed crasher when pie-menu plugin enabled
http://sourceforge.net/forum/message.php?msg_id=3155657

Enabling the Pie Menu plug-in caused Leo to quit when opening .leo files.
#@+node:ekr.20050523092056.4: *5* Fixed crasher in Extract Section Command
This fixed a recent bug.
The crash happened if not section text was specified.
Added new checks and new error messages.
#@+node:ekr.20050513141852: *4* 4.3-beta 2
Leo 4.3 beta 2                 May 15, 2005

Leo 4.3 beta 2 completes all major features of Leo 4.3 and fixes all bugs
reported since the beta 1 release.

The defining features of Leo 4.3:
---------------------------------
1. Leo now stores options in @settings trees, that is, outlines whose headline
is '@settings'. When opening a .leo file, Leo looks for @settings trees not only
in the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.  Readers of Python's configParser shootout take note!

2. The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

3. Leo now stores recent files information in .leoRecentFiles.txt files.

4. Leo's read/write code in leoAtFile.py has been rewritten to support user-
defined tangling and untangling.  This is a major cleanup of Leo's core.

5. Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables
and disables plugins automatically. This plugin also tells you everything you need to know
about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

6. You can install third-party extensions in Leo's extensions directory. Leo
will attempt to import such extensions from the extensions directory if normal
imports fail. Leo is distributed with Pmw (Python Mega Widgets), path.py and
sets.py in this directory.
#@+node:ekr.20050513141913.1: *5* Fixed bugs...
#@+node:ekr.20050513141913.16: *6* Fixed nodenavagator bug
http://sourceforge.net/forum/message.php?msg_id=3133917

'Recent' and 'Marked' button now appear in new windows.
#@+node:ekr.20050513141913.17: *6* Fixed LaTex Coloring bug
http://sourceforge.net/forum/message.php?msg_id=3133915

The colorizer now correctly handles the following:

\@, \(, \), \{, \}

And also constructs like \documentclass{report}.
#@+node:ekr.20050513141913.22: *6* Error messages in scripts are now redirected properly.
http://sourceforge.net/forum/message.php?msg_id=3051870
#@+node:ekr.20050513141913.30: *6* Fixed 2 crashers in nav_buttons plugin
http://sourceforge.net/forum/message.php?msg_id=3138608

The nav_buttons plugin was using self.c rather than keywords.get('c') in a hook
handler. The general rule is that hook handlers should do nothing if self.c !-
keywords.get('c').  This was an old bug, arising from the rewrite of the plugin.

I added a warning to that effect in the plugin template.

It would perhaps be better to specify an optional commander in registerHandler
and only call the handler if the commander matches. However, this isn't so easy
or clean to do.I

http://sourceforge.net/forum/forum.php?thread_id=1282631&forum_id=10226

The plugin was failing to set the positionList ivar (in the base
tkinterListBoxDialog class). This was a fairly recent blunder: I saw that
positionList wasn't used in the plugin directly, so I 'improved' the code by
using a local var instead of self.positionList. This illustrates a hazard of
using subclassing.
#@+node:ekr.20050513141913.57: *6* Fixed crasher in yoffsetTree
This happened when creating a new chapter with chapters.py enabled.
#@+node:ekr.20050513141913.60: *6* Fixed crasher in undo
http://sourceforge.net/forum/forum.php?thread_id=1281868&forum_id=10226

The fix was to recompute newSel in << handle backspace with negative tab_width >> in idle_body_key.
#@+node:ekr.20050513141913.82: *6* Fixed  several problems with Extract and Extract Section
- The section name lost its indentation.
- The created section had extra indentation.
- Undoing did not remove the inserted section node.

The unit tests now properly test indentation.
#@+node:ekr.20050513141913.91: *6* Fixed bug with Delete in headlines
http://sourceforge.net/forum/message.php?msg_id=3143895

The Edit->Delete command did nothing when the selected text was in a headline.
#@+node:ekr.20050513141913.127: *6* Fixed bugs re initial_splitter_orientation & @strings & @ints generally
http://sourceforge.net/forum/forum.php?thread_id=1281868&forum_id=10226

doStrings now accepts either:

@strings[values]name=value
@strings name[values]=value

Similarly, doInts accepts:

@ints[values]name=value
@ints name[values]=value
#@+node:ekr.20050513141913.140: *6* Fixed bug with hoist + insert
http://sourceforge.net/forum/message.php?msg_id=3149604

Changed c.hoistStack[-1].current to c.hoistStack[-1].p in c.insertHeadline.
#@+node:ekr.20050513141913.145: *6* Fixed problem with settings dialog position when panes split horizontally
http://sourceforge.net/forum/forum.php?thread_id=1281868&forum_id=10226

The code now calls frame.resizePanesToRatio in createFrame in Leo.

Not only does this fix this bug, it honors the following settings:

- initial_horizontal_ratio
- initial_horizontal_secondary_ratio
- initial_vertical_ratio
- initial_vertical_secondary_ratio
#@+node:ekr.20050513141913.149: *6* Fixed problem changing shortcut & redid shortcuts widget
http://sourceforge.net/forum/message.php?msg_id=3138608

Replaced individual shortcuts widget with a single text widget. This allows the
user to add or delete shortcuts.
#@+node:ekr.20050513141913.187: *5* New Features...
#@+node:ekr.20050513141913.97: *6* Marking any node sets the outline changed
The following methods changed:

- markAllAtFileNodesDirty
- markAtFileNodesDirty
- markClones
- markHeadline
- markSubheads

I also rewrote the code using explicit positions.
#@+node:ekr.20050513141913.188: *6* Allow quoted urls in  @urls nodes
http://sourceforge.net/forum/message.php?msg_id=3135170
#@+node:ekr.20050513141913.194: *6* Moved executeFile into core
For a test of this, see the script in test.leo at:

Scripts-->Script to execute @test, @suite or file

Read the documentation in that node before running the script.
#@+node:ekr.20050513141913.197: *6* Rewrote g.getScript using at.writeFromString
g.getScript now fully processes all scripts, regardless of where they came from.

- Changed g.getScript:
    - p arg is now required.
    - Removed unused script arg.
    - Added forcePythonSentinels arg (default is True).
    - g.getScript no longer temporarily alters any body text.
        - atFile.writeFromString gets the initial text using the fromString arg.
    - g.getScript now always calls atFile.writeFromString to handle all Leo directives.

- Added forcePythonSentinels to atFile.initWriteIvars and atFile.scanAllDirectives.
    - Default is None, in which case the code sets forcePythonSentinels to the scriptWrite arg.

- Added forcePythonSentinels to atFile.scanAllDirectives.
    - Default is False.

- Created atFile.putAtFirstLines and atFile.putAtLastLines.
    - These replace the corresponding sections in writeOpenFile.
    - It was not actually necessary to define these, but it cleans up the code.

- Created atFile.writeFromString.
    - This handles all the details of simulating a write _from_ a string _to_ a string.

- atFile.initWriteIvars and atFile.openFileForWriting now allow root to be None.
    - This is not used at present: root is always defined.

- Added fromString arg to atFile.writeOpenFile and atFile.putBody.
#@+node:ekr.20050513141913.233: *6* Added define_name arg to c.executeScript
http://sourceforge.net/forum/forum.php?thread_id=1281640&forum_id=10228

The default is ''.  It define_name exists c.executeScript executes the script in an environment containing
__name__ = define_name.
#@+node:ekr.20050429094215: *4* 4.3-beta 1
Leo 4.3 beta 1                 April 30, 2005

Leo 4.3 beta 1 completes all major features of Leo 4.3. There are no known
significant bugs remaining.

The defining features of Leo 4.3:
---------------------------------
1. Leo now stores options in @settings trees, that is, outlines whose headline
is '@settings'. When opening a .leo file, Leo looks for @settings trees not only
in the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.  Readers of Python's configParser shootout take note!

2. The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

3. Leo now stores recent files information in .leoRecentFiles.txt files.

4. Leo's read/write code in leoAtFile.py has been rewritten to support user-
defined tangling and untangling.  This is a major cleanup of Leo's core.

5. Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables
and disables plugins automatically. 
This plugin also tells you everything you need to know
about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

6. You can install third-party extensions in Leo's extensions directory. Leo
will attempt to import such extensions from the extensions directory if normal
imports fail. Leo is distributed with Pmw (Python Mega Widgets), path.py and
sets.py in this directory.
#@+node:ekr.20050429094215.2: *5* Fixed bugs...
#@+node:ekr.20050429094215.3: *6* Made sure NameErrors are reported with tracebacks in scripts
The initial bug report:

http://sourceforge.net/forum/message.php?msg_id=3048149

The problem arose from a misguided attempt to eliminate non-useful information
from traces. Alas, the baby got thrown out with the bath water.

Here are the changes I made:

 - c.executeScript now calls g.es_exception(full=True) to ensure that a full
 stack trace always gets produced. This is especially important when the
 exception happens in a module (file) called by the script.

- c.executeScript now always executes the section < < dump the lines near the
error > >, regardless of context. The lines are printed (in black) in the log.
This is useful information in almost all cases.

- After much experimentation, g.es_exception is basically unchanged. Note: If
the error occurs in your script itself (as contrasted with an exception thrown
from a file called by your script) Leo always has properly put the cursor on the
offending line. I made no changes in this logic.

BTW, calling pdb.set_trace() in your scripts may cause more problems than it is
worth. Indeed.pdb.set_trace() uses only the information on the stack, and that
may not be enough information to be useful. I usually use g.trace to find out
what is happening. This works well.
#@+node:ekr.20050429094215.22: *6* Finally! fixed .leoID problem!
Initial bug report:

http://sourceforge.net/forum/message.php?msg_id=3053699

There were three similar bugs, all arising from the fact that g.os_path_abs and
g.os_path_join return the _working_ directory if the initial path is None!

I removed my HOME directory for testing. This was essential.

- Compute home directory must return None, rather than the working directory if
the HOME variable is None.

- app.setLeoId must be careful (in two sections) to do nothing if any of
(homeDir,globalConfigDir,loadDir) is None.
#@+node:ekr.20050429094215.31: *6* Investigated problem with LeoPluginsRef.leo
The problem is that newButtons must use @nosent, so any changes to newButtons
must be accompanied by a change to LeoPluginsRef.py. There is nothing more that
needs to be done.
#@+node:ekr.20050429094215.41: *6* Fixed conflicts in menu shortcuts
The De-hoist command conflicted with the Expand/Contract submenu.

The Paste Node As Clone conflicted with the Mark submenu.
#@+node:ekr.20050429094215.113: *6* Fixed bug in p.initStatus caught by pychecker
The status bits weren't being passed to v.initStatus!
#@+node:ekr.20050429094215.116: *6* Fixed crasher in import logic (leoAtFile)
Traceback (most recent call last):
  File "c:\prog\leoCVS\leo\src\leoCommands.py", line 174, in doCommand
    command()
  File "c:\prog\leoCVS\leo\src\leoCommands.py", line 863, in importDerivedFile
    c.importCommands.importDerivedFiles(v,names)
  File "C:\prog\leoCVS\leo\src\leoImport.py", line 137, in importDerivedFiles
    isThin = at.scanHeaderForThin(theFile,fileName)
  File "C:\prog\leoCVS\leo\src\leoAtFile.py", line 570, in scanHeaderForThin
    junk,junk,isThin = at.scanHeader(theFile,fileName)
  File "C:\prog\leoCVS\leo\src\leoAtFile.py", line 2616, in scanHeader
    at.error("Bad @+leo sentinel in: %s" % fileName)
  File "C:\prog\leoCVS\leo\src\leoAtFile.py", line 4500, in error
    self.printError(message)
  File "C:\prog\leoCVS\leo\src\leoAtFile.py", line 4509, in printError
    if self.errors == 0:
AttributeError: atFile instance has no attribute 'errors'
#@+node:ekr.20050429094215.120: *6* Put in protections against unbounded recursion in idle_scrollTo
Traceback (most recent call last):
  File "C:\prog\leoCVS\leo\src\leoTkinterTree.py", line 1409, in idle_scrollTo
    h1 = self.yoffset(p)
  File "C:\prog\leoCVS\leo\src\leoTkinterTree.py", line 1488, in yoffset
    h, flag = self.yoffsetTree(root,v1)
  File "C:\prog\leoCVS\leo\src\leoTkinterTree.py", line 1506, in yoffsetTree
    h2, flag = self.yoffsetTree(child,p1)

# Maximum recursion depth exceeded.

It is still not completely clear why this happened.
#@+node:ekr.20050429094215.130: *5* New features...
#@+node:ekr.20050429094215.131: *6* Created stand-alone leoGlobals.py module
- Moved computeGlobalConfigDir, computeHomeDir, computeLoadDir and
startupEncoding from leo.py to leoGlobals.py.

- Created g.computeStandardDirectories and used it in leo.py.

- Created g.createStandAloneApp using the above functions. This function was
based on the 'Standalone Operation' classed in the plugin_manager plugin.
g.createStandAloneApp doesn't actually use any of these classes because the
nullGui class is basically a clumsier version of the BlackHole class.

- Added a do-nothing attachLeoIcon method to nullGui class to suppress a
warning. As I said, the nullGui class is not as elegant as Paul's BlackHole
class.

- Added <<importLeoGlobals>> button to newButtons plugin. This creates a node
  named << define importLeoGlobals >> whose body text defines an
  importLeoGlobals function.

The idea is that importing leoGlobals from a stand-alone plugin is a bit tricky.
The importLeoGlobals handles these details. Note that we don't want to define
importLeoGlobals in a node included by @others, because this function must be
available to the code in the << imports >> section. So we use a named section
and reference it in before referencing the << imports >> section. See the
plugin_manager plugin for an example.

- Changed the plugin_manager plugin as follows: - Used the newButtons plugin to
    add an << define importLeoGlobals >> section. - Simplified the import logic
    using importLeoGlobals function. - Commented out the Standalone Operation
    classes. - Called g.createStandAloneApp in the '__name__ == "__main__"'
    code.
#@+node:ekr.20050429094215.139: *6* Leo now ignores problems opening settings file for chapters plugin
- config.openSettingsFile returns None if there is a read error.

- leoFileCommand.open gives no BadLeoFile message if silent is True.
#@+node:ekr.20050429094215.145: *6* Improved write logic
- Simplified write_Leo_file using new leoFileCommand.deleteFileWithMessage and g.utils_rename.

- Eliminated outputList var.
    - The code that writes to a clipboard sets self.outputFile to g.fileLikeObject.

- Sped up put routine: it always writes to self.outputFile.

- self.outputFile is now a cStringIo object.  However, the heart of the put routine is:

    s = g.toEncodedString(s,self.leo_file_encoding,reportErrors=True)
    self.outputFile.write(s)

and it appears that the call to g.toEncodedString is the limiting factor.
#@+node:ekr.20050429094215.173: *6* Rewrote the undo code
- Use g.Bunch to simplify code.
- Added 'before' & 'after' methods
- Added entries to optionalIvars dynamically in bead methods.
- Eliminated 'case-itis' by making it unnecessary ever to add more cases.
- Removed 'v' key in undoer:  replaced it with 'p'.
- Replaced u.v by u.p and v by p in find code (It's too confusing).
- p.setDirty and p.setAllAncestorAtFileNodesDirty  return list of nodes that were marked dirty.
- Create new top-level before/after methods & helpers:
- Changed setUndoTypingParams to use new dispatch method.
- Removed makeBeadDict.
- Removed updateSetChangedFlag.
- Added new methods to nullUndoer class.
- Moved undo methods from leoNodes.py to leoUndo.py
- Added dirtyVnodeList param to afterChangeNodeContents.
#@+node:ekr.20050429094215.286: *6* Implemented undo/redo for Paste Retaining clones
#@+node:ekr.20050429094215.316: *6* Added support for 'str_' uA's
The only changes concern how Leo encodes and decodes items in
t.unknownAttributes and v.unknownAttributes.

Without changing the file format, the only way to tell Leo how to write
attributes is to use naming conventions. When writing attributes, Leo now does
the following:

- Do nothing except apply xml escapes if the attribute name (in
t.unknownAttributes or v.unknownAttributes) starts with str_ and the attribute
is, in fact, a string. If the string is a Unicode string Leo converts the
Unicode string to an encoded string.

- Use the present pickling/hexlifying scheming otherwise. In particular, issue a
warning and ignore the attribute if the attribute can not be pickled. BTW, there
is no need for separate base64 support: hexlifying guarantees that the result is
valid in any xml environment.

Leo now does the reverse when reading.

BTW, plugins could add their own naming conventions in an emergency. Indeed, the
conventions will be confined to code in atFile.putUa and atFile.getUa, so a
plugin would only need to override these two methods.
#@+node:ekr.20050429094215.347: *6* Removed unused params from leoAtFile.py
Removed inAtOthers  param from putOpen/CloseNodeSentinel.
Removed inAtAll param from putCloseNodeSentinel.
Removed putCloseSentinel param from putAtAllBody
Removed putCloseSentinel param from putBody

Removed toString param from openFileForWritingHelper
Removed toString param from v.putUnknownAttributes

Note: most(all?) top-level atFile.write methods pass toString to initWriteIvars.
#@+node:ekr.20050429094215.353: *6* Leo  saves recent files info in .leoRecentFiles.txt files
Leo stores recent files information as follows.

1. Leo stores recent files info in files called .leoRecentFiles.txt. These will
be a plain text files with one line per recent files entry. An Easter egg: if
the file starts with read-only, read_only, readonly, etc. Leo will never update
the file and will not remember changes to the Recent Files menu.

2. On startup, Leo searches for the .leoRecentFiles.txt files in the user's home
directory, if it exists. Leo looks in Leo's config directory next, but only if
the home directory does not exist, or does not contain a .leoRecentFiles.txt
file. In other words, Leo will use at most one .leoRecentFiles.txt file on
startup.

3. When opening a .leo file, Leo looks for .leoRecentFiles.txt in the directory
containing the file.

4. At no time after installation does Leo create any .leoRecentFiles.txt file.
This will allow users (or their managers) to set policy regarding where to store
this information (if anywhere).

5. Leo writes at most one .leoRecentFiles.txt file when saving a .leo file,
namely the file read in item 3 if it exists, or the file read in item 2
otherwise.

This is a flexible scheme that should meet most needs without having to resolve
thorny questions about exactly where recent files info belongs.
#@+node:ekr.20050429094215.354: *7* What I did
@killcolor

- Properly implemented undo/redo Clear Recent Files.

- readSettingsFiles now reads @recentfiles nodes from all settings files.

- Created @settings nodes and @recent-files nodes if they do not exist.
#@+node:ekr.20050429094215.355: *7* New plan
You all have convinced me that storing recent files data in .leo files is a
dubious idea. My new plan is as follows:

1. Leo will store recent files info in files called .leoRecentFiles.txt. These
will be a plain text files with one line per recent files entry. These will be
local files, so problems concerning directory structure and path specifications
should go away.

2. On startup, Leo will search for the .leoRecentFiles.txt files in the user's
home directory, if it exists. Leo will look in Leo's config directory next, but
only if the home directory does not exist, or does not contain a
.leoRecentFiles.txt file. In other words, Leo will use at most one
.leoRecentFiles.txt file on startup.

3. When opening a .leo file, Leo will look for .leoRecentFiles.txt in the
directory containing the file.

4. At no time after installation will Leo create any .leoRecentFiles.txt file.
This will allow users (or their managers) to set policy regarding where to store
this information (if anywhere).

5. Leo will write at most one .leoRecentFiles.txt file when saving a .leo file,
namely the file read in item 3 if it exists, or the file read in item 2
otherwise.

6. Leo will have settings to tell which .leoRecentFiles.txt files may be
written.

7. Leo will never create @settings nodes or @recent-files nodes automatically.
Moreover, I shall remove the @recent-files panel from the settings dialog and
the corresponding @recent-files code from the config classes.

I believe this will address everyone's concerns without the need for resolving
thorny questions about exactly where recent files info belongs.
#@+node:ekr.20050429095849: *6* Finished all @settings coding
- Saved expansion state of @settings trees when the user hits the OK button.

- Added support for UNL's in the status line when the settings dialog is active.

- Debugged @if-platform, @if-gui, @ints & @strings.

- Reloaded settings files when opening the settings dialog.

- Removed support for @recent-files nodes.  This is now handled by .leoRecentFiles.txt files.
#@+node:ekr.20050313101229: *4* 4.3-a4
Leo 4.3 alpha 4                 March 15, 2005

Leo 4.3 is the culmination of more than five months of work. This alpha 4
focuses on plugins: all known plugins are now in leoPlugins.leo. Most plugins
now work with the 4.3 code base. Warning: not all plugins have been tested
thoroughly.

This alpha 4 release also adds the frequently-requested Add Comments and Delete
Comments commands to Leo's Edit Body menu.

The defining features of Leo 4.3:

1. Leo now stores options in @settings trees, that is, outlines whose headline
is '@settings'. When opening a .leo file, Leo looks for @settings trees not only
in the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.  Readers of Python's configParser shootout take note!

2. The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

3. Leo's read/write code in leoAtFile.py has been rewritten to support user-
defined tangling and untangling.  This is a major cleanup of Leo's core.

4. Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables
and disables plugins automatically. 
This plugin also tells you everything you need to know
about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

5. You can install third-party extensions in Leo's extensions directory. Leo
will attempt to import such extensions from the extensions directory if normal
imports fail. Leo is distributed with Pmw (Python Mega Widgets), path.py and
sets.py in this directory.
#@+node:ekr.20050313101229.2: *5* Fixed bugs...
#@+node:ekr.20050313101229.74: *6* Fixed @wrap bug
http://sourceforge.net/forum/message.php?msg_id=3035471

Leo was not inserting a visible horizontal scrollbar when @nowrap was in effect.
#@+node:ekr.20050313101229.77: *6* Fixed change-all bug
http://sourceforge.net/forum/message.php?msg_id=3042593

Leo now properly redraws the screen after a Change All command.
#@+node:ekr.20050313103448: *5* New features...
#@+node:ekr.20050313101229.95: *6* Created Add Comments and Delete Comments commands
The Add Comments command puts comments around a block of code. This command uses
single-line comments if the language in effect for the node supports single-line
comments.

The Delete Comments command deletes the comments specified by the Add Comments command.
#@+node:ekr.20050313101229.94: *6* Deprecated new_c key in hooks, added c key
Several hooks use the 'new_c' key in the keywords dictionary. Plugin writers had
to remember whether to get the commander using keywords.get('c') or
keywords.get('new_c') or both. This was needlessly confusing.

All hooks that use the 'new_c' key now use also include the 'c' key. The 'new_c'
key is deprecated; plugins should use the 'c' key instead. 

None of the plugins presently in leoPlugins.leo use the 'new_c' key, but the
'new_c' key still exists for compatibility.

The following plugins were affected by this change:

ConceptualSort.py
URLloader.py
UASearch.py
arrows.py
autocompleter.py
base64Packager.py
cleo.py
dyna_menu.py
macros.py
mod_read_dir_outline.py
mod_scripting.py
multifile.py
nodebar.py
nodenavigator.py
open_with.py
scheduler.py
read_only_nodes.py
templates.py
#@+node:ekr.20050313103448.1: *6* Added the 'before-create-leo-frame' hook
Leo calls the 'before-create-leo-frame' hook just before calling frame.onCreate.
Similarly, Leo calls the 'after-create-leo-frame' just after calling
frame.onCreate.
#@+node:ekr.20050313101229.101: *6* Added support for mod_labels plugin
atFile.copyAllTempBodyStringsToTnodes calls:

    c.mod_label_controller.add_label(p,"before change:",old_body)
#@+node:ekr.20050313101229.100: *5* Revised plugins for the 4.3 code base
Fixed problems in the following plugins. See the << version history >> section
in each plugin for details.

autocompleter.py
cleo.py
mod_scripting.py
mod_tempfname.py
templates.py
vim.py
xemacs.py

Replaced the 'new_c' key by the 'c' key in the following plugins:

ConceptualSort.py
URLloader.py
UASearch.py
arrows.py
autocompleter.py
base64Packager.py
cleo.py
dyna_menu.py
macros.py
mod_read_dir_outline.py
mod_scripting.py
multifile.py
nodebar.py
nodenavigator.py
open_with.py
scheduler.py
read_only_nodes.py
templates.py

Replaced the 'start2' hook by the 'new' hook in the following plugins: (This was
made possible now that 'new' is called when opening a new window if the
'open1/2' hooks are not called.

URLloader.py
UASearch.py
at_produce.py
autocompleter.py
color_markup.py
fastGotoNode.py
groupOperations.py
import_cisco_config.py
multifile.py
nodebar.py
open_with.py
read_only_nodes.py
scheduler.py
table.py
usetemacs.py
xsltWithNodes.py
#@+node:ekr.20050221104844: *4* 4.3-a3
Leo 4.3 alpha 3                 February 24, 2005

Leo 4.3 is the culmination of more than five months of work. This alpha 3
release corrects various bugs in Leo's core and in plugins. This is the first
release that include an installer for MacOSX.

The defining features of Leo 4.3:

1. Leo now stores options in @settings trees, that is, outlines whose headline
is '@settings'. When opening a .leo file, Leo looks for @settings trees not only
in the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.  Readers of Python's configParser shootout take note!

2. The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

3. Leo's read/write code in leoAtFile.py has been rewritten to support user-
defined tangling and untangling.  This is a major cleanup of Leo's core.

4. Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables
and disables plugins automatically.
This plugin also tells you everything you need to know
about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

5. You can install third-party extensions in Leo's extensions directory. Leo
will attempt to import such extensions from the extensions directory if normal
imports fail. Leo is distributed with Pmw (Python Mega Widgets), path.py and
sets.py in this directory.
#@+node:ekr.20050221104844.2: *5* Bugs
#@+node:ekr.20050221104844.12: *6* Applied patch to rst2 plugin
http://sourceforge.net/forum/message.php?msg_id=2999651

I was pleasantly surprised to discover the reST2 plug-in working under 4.3a2
(this is one the first thing I try as I'd like to use Leo as an editor
for that).

As mentioned in early threads, it still needs @rst for each node to be included
in the reST rendering process. So I put @rst test.html and then a child with
@rst and some reST code and it worked !!

Then I tried to to get a simple rst file using @rst test but the plugin complained:

[snip]

  File "C:\dn_apps\Leo\plugins\rst2.py", line 164, in onIconDoubleClick
    writeTreeAsRst(rstFile,fname,p,c)
TypeError: writeTreeAsRst() takes exactly 5 arguments (4 given)

So I looked at the rst2.py and found a way to get it working but I would need
someone to verify it :

line 164, replaced   writeTreeAsRst(rstFile,fname,p,c)  by

syntax = False
writeTreeAsRst(rstFile,fname,p,c,syntax)

And it worked!
#@+node:ekr.20050221104844.14: *6* Revised searchbox plugin so it works with Leo 4.3
#@+node:ekr.20050221104844.27: *6* Fixed bugs in nav_buttons and nodenavigator plugins
http://sourceforge.net/forum/message.php?msg_id=3005140
By: ktenney

- perform a search which marks a number of nodes
- select "Outline -> Mark/Unmark -> Unmark All"
- Several marks are still listed in in the nodenavigator "Marks" list.
  (They are not marked in the outline.)

What I did:

- The p.set/clearMark methods now call the hook _after_ changing the marked status.
  This fixes the apparent bug in nodenavigator.py.
- Rewrote nav_buttons.py.  The old code was a mess; the new code is clean.
- Changed the vnodeList ivar in leoTkinterDialog to positionList.
- Rewrote c.unmarkAll to make clear that it is using positions.
    - Added test_c_unmark_all test routine.
#@+node:ekr.20050221104844.45: *6* Made sure Leo asks for leoID at most once
http://sourceforge.net/forum/message.php?msg_id=2958470
From: Rich

Leo 4.3 alpha 1, build  1.208 , January 24, 2005
Python 2.3.4, Tk 8.4.3, win32

Opened a new .leo file. It asked for an ID, and said it saved it. Closed the
new leo file & tried opening "Leo\config\leoSettings.leo". _It_ is asking for
a leoID!

What I did

All changes were to g.app.leoID():
    - Fixed bug:  set g.app.leoID in << put up a dialog requiring a valid id >>.
    - Improved signon message.
    - Better error handling and reporting. 
#@+node:ekr.20050221104844.54: *6* Fixed botch in g.pdb
g.pdb wasn't working because pdb wasn't imported inside the function.
#@+node:ekr.20050222100936: *6* Fixed crasher when executing a script if the script was selected text in a new window
http://sourceforge.net/forum/message.php?msg_id=3008045

Leo crashed when executing a script if the script was selected text in a new window.

What I did:

- g.getScript now calls g.getOutputNewline(c=c) rather than look at atFile.output_newline.

atFile.output_newline may not exist if a) the file is new and b) g.getScript
doesn't call atfile.write.

- Set scripting=scriptWrite in call to atFile.scanAllDirectives in atFile.write.

This suppresses the following irrelevant message when executing scripts:

    "No absolute directory specified anywhere."
#@+node:ekr.20050221104844.57: *5* New features
#@+node:ekr.20050221104844.58: *6* Added sets.py to distribution
This allows plugins such as plugin_manager.py to work on Python 2.2.x.
#@+node:ekr.20050221104844.59: *6* Added color='suppress' hack to g.es
g.es does nothing if color=='suppress'.  This can be useful in unit tests.
#@+node:ekr.20050126100405: *4* 4.3-a2
Leo 4.3 alpha 2                 February 14, 2005

Leo 4.3 is the culmination of more than four months of work. This alpha 2
release corrects various bugs and distribution problems.

a2 also adds several new features:

- Adds 'word', 'line' and 'node' undo granularities.
- Predefines 'c','g', and 'p' in scripts and unit tests.
- Added support for top-level init functions in plugins.
- Buttons can remove themselves when their scripts fail.

The defining features of Leo 4.3:

1. Leo now stores options in @settings trees, that is, outlines whose headline
is '@settings'. When opening a .leo file, Leo looks for @settings trees not only
in the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.  Readers of Python's configParser shootout take note!

2. The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

3. Leo's read/write code in leoAtFile.py has been rewritten to support user-
defined tangling and untangling.  This is a major cleanup of Leo's core.

4. Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables
and disables plugins automatically. 
This plugin also tells you everything you need to know
about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

5. You can install third-party extensions in Leo's extensions directory. Leo
will attempt to import such extensions from the extensions directory if normal
imports fail.  Leo is distributed with Pmw (Python Mega Widgets) in this directory.
#@+node:ekr.20050130112336.1: *5* To do: Improve how Leo handles recent files
Warning: The following features of @recentfiles nodes are confusing and probably
will be changed:

- Leo does not save recent file information unless the open .leo file has an
@settings tree and an @recentfiles node within the @settings tree. That is, Leo
does not save recent files information in leoSettings.leo files.

- Changing the @rencentfiles node doesn't mark the Leo file as dirty, so if you
don't save the .leo file the recent files information will not be updated.
#@+node:ekr.20050209141626.3: *5* Bugs fixed...
#@+node:ekr.20050209141626.4: *6* Fixed very old bug in Undo Insert Node
http://sourceforge.net/forum/message.php?msg_id=2795653

1. Select a node in the tree
2. Hit CTRL-I to insert a node
3. Hit CTRL-Z to undo the insert
4. There is no longer a node selected in the tree so keyboard tree navigation etc 
commands don't work until you click on something with the mouse

-----

http://sourceforge.net/forum/message.php?msg_id=2795656

1. Select a node in the tree
2. Hit CTRL-I to insert a node
3. Hit CTRL-Z to undo the insert
4. Hit Hoist before clicking on anything

Now you are hoisted on the recently removed node! The node is dead but his memory lives on ...
#@+node:ekr.20050209141626.8: *6* Made sure to remove duplicates from recent files
#@+node:ekr.20050209141626.12: *6* Fixed indentation problems in leoTkinterFind.py
#@+node:ekr.20050209141626.13: *6* Changed leoConfig.txt to leoSettings.leo in Help menu, etc.
#@+node:ekr.20050209141626.16: *6* Investigated recent files problems
http://sourceforge.net/forum/message.php?msg_id=2966541

---- Report:

"Recent Files"  is not remembering files after one closes all open leo sessions.

But it does update the "Recent Files" list while leo is open in the same session.
If one opens more files it adds them to the list. But close all files and Leo
forgets them all.

---- Added to @recentfile documentation: 

Warning: The following features of @recentfiles nodes are confusing and probably
will be changed:

- Leo does not save recent file information unless the open .leo file has an
@settings tree and an @recentfiles node within the @settings tree. That is, Leo
does not save recent files information in leoSettings.leo files.

- Changing the @rencentfiles node doesn't mark the Leo file as dirty, so if you
don't save the .leo file the recent files information will not be updated.
#@+node:ekr.20050209141626.23: *6* Improved queuing of log messages
http://sourceforge.net/forum/message.php?msg_id=2960328

Symptom

Can not import messages were not being sent to the console, even though there is a call to es in g.cantImport.

What I did

- The code in g.es now checks for nullLog as well as log == None when deciding when to queue messages.

- g.openWithFileName now calls g.app.writeWaitingLog immediately after enabling the new log.

This writes the queued log messages in the proper order: a major advance in clarity.

- Added silent param to two methods.

This allows the 'reading settings from' message to be sent to the log instead of the default 'reading' message.
#@+node:ekr.20050209141626.42: *6* Fixed crasher in Change All command
#@+node:ekr.20050209141626.43: *6* Fixed crasher in script button
The new code no longer requires that the present node have a tnodeList.

File "/Users/edream/leoCVS/leo/src/leoAtFile.py", line 3830, in putOpenNodeSentinel
    at.root.v.t.tnodeList.append(p.v.t)

AttributeError: 'tnode' object has no attribute 'tnodeList'
#@+node:ekr.20050209141626.46: *6* Fixed print problems on the Mac
The message 'command for widget 5' was a message from Tk saying in effect that no command was bound to the button.

Indeed, this was so: a recent botch in a change in mod_scripting.py prevented the binding.

Moreover, there were some extra print statements in the g.es logic for the Mac.
#@+node:ekr.20050209141626.53: *6* leoTest.runTests now makes copies of all positions
This makes the test more robust in case of failure.
#@+node:ekr.20050209141626.54: *6* Fixed problems with unit test file paths
Changed the setup code for the import/export test cases so that it uses os.path.sep when it sees \\ in the test nodes.

With this change all unit tests pass on the Mac as well as on XP.
#@+node:ekr.20050209141626.55: *6* Made local config settings work again
*None* of the local settings were working(!!)

The old init code in the configSettings class had no chance of working. We must
use the full g.app.config.get logic.

Added some very simple unit tests to make sure the basics will never break
again so easily.
#@+node:ekr.20050209141626.91: *6* Fix problems searching for nothing but whitespace
There were problems searching for whitespace.

Note: it just ran slowly & silently.
#@+node:ekr.20050210101318: *6* Fixed problems with typing return in the Find panel
Typing return now correctly invokes the Find button, without adding a newline in the find string.
#@+node:ekr.20050209141626.101: *6* Buttons no longer work in toolbars when settings dialog is open
#@+node:ekr.20050209141626.102: *6* Fixed bug in delayed focus logic
http://sourceforge.net/forum/message.php?msg_id=2958470

I opened a new .leo file, and the cursor was flashing in the text box. I started
typing "@language", and found that the first character is in the text box, and
the rest is in the headline!

What I did:

This was the result of a race condition in the new scheme for setting focus. I
rewrote set_focus so the delayed callback always sets the last requested focus.
The new code also takes care to clear the last request after fulfilling it.
#@+node:ekr.20050209141626.105: *6* Made sure Leo asks for leoID at most once
http://sourceforge.net/forum/message.php?msg_id=2958470

All changes were to g.app.leoID():

- Fixed bug:  set g.app.leoID in << put up a dialog requiring a valid id >>.
- Improved signon message.
- Better error handling and reporting. 
#@+node:ekr.20050209141626.113: *6* Leo now prints unicode characters properly in the log pane
This now works: g.es('ﺻﺱ',color='red')

g.es must send the original unicode string to the log pane widget, NOT an encoded string.
#@+node:ekr.20050209141626.114: *6* Fixed various problems with opening files with Unicode filenames
http://sourceforge.net/forum/message.php?msg_id=2983923

- Replaced string.+ with string.% in numerous places.
- Simplified g.openWithFileName and corrected problems in error-reporting logic.
#@+node:ekr.20050211095754: *6* Fixed bug reading encoding field in external files
@nocolor
http://sourceforge.net/forum/message.php?msg_id=2990951
Milan Melena

I think, I found two bugs:

1) leoAtFile.py:
<< read optional encoding param >>
changed first instance of i = j + 1 to i = j + 2

2) leoGlobals.py
g.getScript now returns with

if at.output_newline == 'crlf':
    return script.replace("\r\n","\n")
else:
    return script
#@+node:ekr.20050212054743: *6* Allow indented code blocks to be run using Execute Script command
At present, such indented blocks may not contain Leo directives or section references.  This will be fixed in 4.3a3.
#@+node:ekr.20050212144116: *6* Fixed problems found by pychecker
1. (fixed) C:\prog\leoCVS\leo\src\leoCommands.py:4539: No global (loadDir) found
    # Would cause leoSettings.leo in Window menu to crash.

2. (fixed) C:\prog\leoCVS\leo\src\leoGlobals.py:3426: No global (local) found

    # Local --> locale
    # Might cause getpreferredencoding to fail on *nix.

3. (fixed) C:\prog\leoCVS\leo\src\leoGlobals.py:4152: No global (testing) found
    # Should be self.testing.

4. (fixed) mu problems:
    - Changed x to self.x:
        - C:\prog\leoCVS\leo\src\leoGlobals.py:3795: No global (removeSentinelsFromLines) found
        - C:\prog\leoCVS\leo\src\leoGlobals.py:3838: No global (getSentinelsFromLines) found
    - Changed self.x to g.x:
        C:\prog\leoCVS\leo\src\leoGlobals.py:3854: No class attribute (comment_delims_from_extension) found
    - pull_source has been renamed, I don not know to what.
        C:\prog\leoCVS\leo\src\leoGlobals.py:4170: Object (mu) has no attribute (pull_source)
        (commented out the code that contains this)

5. (removed code) from << create a node p for  kind & root2 >>
    - last_p is None at first, so last_p.insertAfter does not make sense.
#@+node:ekr.20050209141626.150: *5* New features...
#@+node:ekr.20050126100405.1: *6* Added undo granularity
#@+node:EKR.20040524104904.48: *7* Undoing operations
Leo supports unlimited undo for all typing and all commands. The
'undo_granularity' setting controls the granularity of undo. There are four
possible values:

node
    Starts a new undo unit when typing moves to a new node.

line (default)
    Starts a new undo unit when typing moves to new line.

word
    Starts a new undo unit when typing starts a new word.

char (not recommended)
    Starts a new undo unit for each character typed.
    This wastes lots of computer memory.

Internally, setUndoTypingParams() calls recognizeStartOfTypingWord() to recognize the
start of words. Plugins can modify recognizeStartOfTypingWord(). It should
return True if the typing indicated by the params starts a new 'word' for the
purposes of undo with 'word' granularity. setUndoTypingParams() calls this
method only when the typing could possibly continue a previous word. In other
words, undo will work safely regardless of the value returned. See the actual
code for recognizeStartOfTypingWord() for more details.
#@+node:ekr.20050209141626.185: *6* Added support for top-level init function in plugins
When loading plugins, the Leo checks to see if the plugin has an init function
at the top level (the module level). If so, Leo calls the init function. This
function should return True (or equivalent) if the module loaded correctly.

If the top-level init function does not exist, Leo assumes the module loaded
correctly.
#@+node:ekr.20050209141626.190: *6* Changed name of Paste Retaining Clones to Paste Node As Clone
#@+node:ekr.20050209141626.193: *6* Added leoPlugins.leo to Help menu
#@+node:ekr.20050209141626.194: *6* Script buttons can request to be removed
A script in an @button node or script node can now request to be removed by
setting g.app.scriptDict['removeMe'] = True. Leo checks this value after
executing the script in the button.
#@+node:ekr.20050209141626.195: *6* Improved documentation in several nodes in leoSettings.leo
#@+node:ekr.20050209141626.196: *6* Predefined c,g & p in scripts, unit tests & test routines
@nocolor

Added define_p keyword arg in executeScript. When True (the default), the script
or unit test is run in an environment in which c, p and g are all defined.
c is the commander for the outline in which the script appears.
p is the same as c.currentPosition and g is the leoGlobals module.

Therefore, the following lines need never appear in scripts or unit tests!

@color

import leoGlobals as g
p = c.currentPosition()
#@+node:ekr.20050209141626.198: *6* Changed name of Preferences command to Settings
#@+node:ekr.20050122090311: *4* 4.3-a1
Leo 4.3 alpha 1                 January 24, 2005

Leo 4.3 is the culmination of more than four months of work. 

The defining features of Leo 4.3:

1. Leo now stores options in @settings trees, that is, outlines whose headline
is '@settings'. When opening a .leo file, Leo looks for @settings trees not only
in the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.  Readers of Python's configParser shootout take note!

2. The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

3. Leo's read/write code in leoAtFile.py has been rewritten to support user-
defined tangling and untangling.  This is a major cleanup of Leo's core.

4. Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables
and disables plugins automatically. This plugin also tells you everything you need to know
about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

5. You can install third-party extensions in Leo's extensions directory. Leo
will attempt to import such extensions from the extensions directory if normal
imports fail.
#@+node:ekr.20050123112834: *5* Defining features of 4.3
#@+node:ekr.20050123110009: *6* Using @settings trees and leoSettings.leo
Leo now stores options in @settings trees, that is, outlines whose headline is
'@settings'. When opening a .leo file, Leo looks for @settings trees not only in
the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.

The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

For full details, see the children of this node.
#@+node:ekr.20050122084954: *7* Using leoSettings.leo and @settings trees
Leo stores options in @settings trees, that is, parts of Leo outlines whose root node has the headline @settings.  When opening a .leo file, Leo looks for @settings trees in the following places:

- The file called leoSettings.leo in the leo/config directory.
- The file called leoSettings.leo in the users home directory.
- The file being loaded.

Settings that later in the above list override settings found earlier. For
example, any setting specified in an @settings tree in the file being loaded
overrides any setting seen in any leoSettings.leo file.

The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings dialog" pane. This settings dialog pane allows
you to change the settings selected in the outline pane using standard gui
widgets.

The format of nodes in @settings trees are as follows:

1. "Simple settings nodes" have headlines of the form:

@<type> name = val

set the value of name to val, with the indicated type.

<type> may be one of the following, with valid values shown:

<type>          Valid values
-----           ------------
\@bool           True, False, 0, 1
\@color          A Tk color name or value, such as 'red' or 'xf2fddff' (without the quotes)

For a list of Tk color specifiers see:

- http://www.tcl.tk/man/tcl8.4/TkCmd/colors.htm
- http://www.tcl.tk/man/tcl8.4/TkLib/GetColor.htm

\@directory      A path to a directory
\@float          A floating point number of the form nn.ff.
\@int            An integer
\@ints[list]     An integer (must be one of the ints in the list).
                 Example: @ints meaningOfLife[0,42,666]=42
\@path           A path to a directory or file
\@ratio          A floating point number between 0.0 and 1.0, inclusive.
\@string         A string
\@strings[list]  A string (must be one of the strings in the list).
                 Example: @strings tk_relief['flat','groove','raised']='groove'

2. "Complex settings nodes" have headlines of the form:

\@<type> description

The actual settings are specified in the body text.  At present, there are two such kinds of complex settings nodes:

- @font

The body text contains a list of settings for a font.  For example:

body_text_font_family = Courier New
body_text_font_size = None
body_text_font_slant = None
body_text_font_weight = None

- @recentFiles

The body text contains a list of paths of recently opened files, one path per line.

Warning: The following features of @recentfiles nodes are confusing and probably
will be changed:

- Leo does not save recent file information unless the open .leo file has an
@settings tree and an @recentfiles node within the @settings tree. That is, Leo
does not save recent files information in leoSettings.leo files.

- Changing the @rencentfiles node doesn't mark the Leo file as dirty, so if you
don't save the .leo file the recent files information will not be updated.

3.  All other nodes are "Organizer" nodes.  Such nodes have no effect on the settings shown in the dialog.  You may use them as you please to organize settings.

Notes:

A.  At present, you can not change @settings trees while executing the Settings command.  You can, however, change any @settings tree normally when not executing the Settings command.

B. Other kinds of settings nodes are planned for future releases.
#@+node:ekr.20050122091036: *7* Unfinished configuration features
The essential features of @settings trees and the settings dialog appear to be stable.  However, many improvements can be imagined, including the following:

- Allow searching for nodes while in the settings dialog.

- Allow adding, deleting, rearranging nodes while in the settings dialog.

- Allow adding, deleting, rearranging recent files while in the settings dialog.

These will be added as time permits and people request.
#@+node:ekr.20050123092834.520: *6* Rewrote Leo's read/write logic
The new code greatly simplifies the class structure. The intention is to allow plugins to override methods of this file more easily.

The highlights:

- Plugins may now override methods in this file much more easily.
    - All code is now in a single class.
    - Resolved the few name conflicts by renaming x to x3 or x4.
    - The new code generally uses methods instead of sections.
    - Initialization is now simple and sane, and is done in dedicated methods.
    - All constants are class constants: no more module-level constants.

- All top-level methods support toString or fromString arguments.
#@+node:ekr.20050123115804: *6* Added Plugins Manager plugin
Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables and
disables plugins automatically.This plugin also tells you everything you need to
know about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

Note. The Plugins Manager plugin requires Pmw. You can install Pmw in Leo's
extensions directory if you like.
#@+node:ekr.20050123115804.1: *6* You can install third-party extensions in Leo's extensions directory
You can can import any extension to Leo by putting the extension in the 'extensions' directory and using g.importExtension to import it.

- created the 'extensions' directory and g.app.extensionsDir

- created g.importModule and g.importExtension
#@+node:ekr.20050123092834.1: *5* Fixed bugs...
#@+node:ekr.20050123101208: *6*  Major bugs: these bugs corrupted external files!
#@+node:ekr.20050123092834.432: *7* Fixed double doc part bug
Leo did not correctly write adjacent @doc parts in @file trees.  Leo could not read the resulting external files!

The bug happened if any node in an @file tree contains adjacent @doc parts, like this:

@  first doc part
...
@ second doc part
...

Leo failed to write the closing #@-at sentinel that would finish the first @doc part.
#@+node:ekr.20050123092834.497: *7* Fixed bug in how Leo writes thin external files
Leo did not properly write external files that contained section references to grand-children.

For example:

<< current level>>
  reference to << 3. level>>
    << 1.level>>
        << 2.level >>
            << 3.level>>

The fix was simply to reverse the order in which putRefAt puts +middle and -middle sentinels.
#@+node:ekr.20050123092834.2: *6* Commands
#@+node:ekr.20050123092834.6: *7* Fixed problems with spawnv option of openWith
The Open With logic in createOpenWithMenuFromTable for the 'spawnv' case now
actually calls os.spawnv (rather than spawnl) and it allows a variable length
list of parameters.
#@+node:ekr.20050123092834.19: *7* Fixed bug in  Remove Sentinels command
The old code wasn't handling single file selections properly. The new code works
around an apparent bug in Tk.askopenfilename.
#@+node:ekr.20050123092834.27: *7* Fixed bug re Paste Node As Clone
The new code forbids Paste Node As Clone if the paste would result in a node being a clone of itself.
#@+node:ekr.20050123092834.42: *7* Fixed Pretty Print commands for Python 2.4
The '@' sign is an operator in Python 2.4, not an error token.
#@+node:ekr.20050123092834.71: *7* Fixed crasher in Import external files command
What I did:

- Created a new top-level method: scanHeaderForThin.

This sets self.encoding temporarily. The actual value of self.encoding does not
really matter: no errors will be given by readLine and its helpers even if there
are unicode encoding errors.

- We must _not_ set self.encoding in scanHeader: that would interfere with
normal initialization.
#@+node:ekr.20050123092834.510: *7* Search commands are now restricted to hoisted area
#@+node:ekr.20050123100706.1: *6* Distribution
#@+node:ekr.20050123092834.491: *7* Fixed file association in leoDist.leo
Changed the open command associated with .leo files on Windows from:

pythonw.exe "<leodir>\src\leo.py" %1

to:

"pythonw.exe" "<leodir>\src\leo.py" "%1"

The difference is in quotes.  Especially quotes around "%1" seem to matter.
#@+node:ekr.20050123092834.165: *6* Files
#@+node:ekr.20050123092834.492: *7* g.import wrappers return module if it is in sys.modules
This is an important difference. imp.load_module is equivalent to a reload, so
we must not call this if the module already exists!
#@+node:ekr.20050123092834.166: *7* Disabled changes to comment delims in @@language and @@comment sentinels
he readDirective method was changing the comment delimiters as the result of
seeing the sentinels corresponding to @language or @comment directives. But in
general this makes no sense! Comment delimiters should be set once and for all
in the @+leo sentinel: there is no compiler in the world that tolerates mixed
comment delimiters.

BTW, the way to set javascript "inner" comments is to use @delims, not @comment.
N.B. The @language and @comment delimiters _will_ have an effect, and that
effect is in the _write_ logic, not the read logic. The effect is to set the
comment delims in the @+leo sentinel.

The quick fix is to comment out code in readDirective.
#@+node:ekr.20050123092834.176: *7* Made sure files that differ only in line ending get written if @lineending is in effect
The old code did not honor the @lineending directive if the two files would otherwise be identical.

What I did:

- Added self.explicitLineEnding to remember whether an explicit @lineending directive is in effect.

- Make sure the user knows why an otherwise identical file was written.

- Changed name of compareFilesIgnoringNewlines to compareFiles.

- Added ignoreLineEndings arg to compareFiles.
#@+node:ekr.20050123092834.196: *7* Fixed bug:  @nosent wrote sentinels!
The fix was to add nosentinels=nosentinels in the call to initWriteIvars in atFile.write.
#@+node:ekr.20050123092834.422: *7* Fixed bug in replaceTargetFileIfDifferent
This method now does nothing if at.toString is True.
#@+node:ekr.20050123092834.424: *7* Made sure that @ignore forces writing of inner @thin trees
#@+node:ekr.20050123092834.431: *7* Fixed crasher when attempting to write a external file to an invalid path
#@+node:ekr.20050123092834.434: *7* Fixed Python 2.4 deprecation warning when saving .leo files
The new code uses protocol=1 instead of the deprecated bin argument to Pickler.
#@+node:ekr.20050123092834.499: *7* Fixed crasher in getOutputNewline
In some cases g.app.config.output_newline was None.  The new code sets the default to '', and then assigns a valid default to ''.
#@+node:ekr.20050123092834.544: *7* Always use os.rename in utils_rename
Apparently distutils.file_util is not present in all Python distributions!

New approaches:
    - Fall back on code in distutils.file_util if import fails.
    - Make sure the src and dst volumes are the same (so Linux os.rename will always work)
    - Simplify replaceTargetFileIfDifferent by creating new routines.

What I did:
    - Rewrote replaceTargetFileIfDifferent in terms of atFile.rename, atFile.remove, etc.
    - Rewrote update_file_if_changed in terms of g.utils_rename, g.utils_remove, etc.
#@+node:ekr.20050123151338: *7* Fixed bugs handling @language & @comment in atFile.scanAllDirectives & g.scanDirectives)
Changed scanDirectives and atFile.scanDirectives so they work like
tangle.scanAllDirectives. Also added a few clarifying words in LeoDocs.leo.

This should have worked, but didn't:

+ Code 
  @language python 
  + @file sql_create.sql 
    @comment -- 

So I rearranged the outline (probably more logical anyway) to  
+Code 
  + Python 
  ... 
+ SQL 
  ... 
#@+node:ekr.20050123103303: *6* Gui
#@+node:ekr.20050123092834.502: *7* Put the scrollWheel workaround in createTkTreeCanvas
This binds scroll-wheel events to Button-4 and Button-5
#@+node:ekr.20050123100706.2: *6* Menus
#@+node:ekr.20050123092834.81: *7* Fixed problems with Control-E
- Restored non Pmw code in resizePanesToRatio. This code got deleted by mistake.
The Equal Sized Panes works again.

- Added many do-nothing methods to nullMenu class.

This should prevent the startup logic from messing with shortcuts in any way.
It's also the right thing to do.

- Added an entry for EqualSizedPanes to leoSettings.leo. This overrides the
default (Ctrl-E) and thereby prevents the default from overriding the entry for
ExecuteScript!

- Re-enabled code in createMenuEntries that warns when shortcuts have been
redefined. Not sure if this is a wise idea, or indeed if it actually does
anything :-)

I am tempted to remove all the default entries entirely. This would simplify
error reporting, but then Leo would hardly work at all if leoSettings.leo were
not present.
#@+node:ekr.20050123092834.490: *7* Better handling of duplicate menu shortcuts
The code now clears previous shortcut, and tells what the previous entry was.
#@+node:ekr.20050123092834.159: *6* Nodes
#@+node:ekr.20050123092834.160: *7* Fixed crash after cutting an imported node
p.moveToParent now just returns if p is a null position.
#@+node:ekr.20050123092834.163: *7* Removed invalid assert in lastVisible
# Leo looped after this assert failed.
#@+node:ekr.20050123093854.1: *7* Fixed bugs in tnodes_iter and unique_tnodes_iter
tnodes_iter and unique_tnodes_iter were returning vnodes, not tnodes!
#@+node:ekr.20050123111723: *6* Plugins
#@+node:ekr.20050123092834.1047: *7* Fixed two bugs in Plugins Manager plugin
- This plugin now handles both kinds of triple-quotes correctly so that both
kinds of docstrings are recognized.
#@+node:ekr.20050123092834.1052: *7* Fixed bug re referencing destroyed ivars
Created callTagHandler. This checks 'idle' hooks to make sure that any commander
referenced by the 'c','new_c' or 'old_c' keywords still exists.
#@+node:ekr.20050123092834.1057: *7* Fixed bug in registerOneHandler
leoPlugins.registerOneHandler wasn't working properly at all. In effect, only
the last registered hook was ever being remembered!
#@+node:ekr.20050123092834.506: *7* Fixed conflict between settings panel and chapters plugin
chapters.py requires that the canvas have a name ivar.

Added treeCanvas.name = '1' in:

<< replace tree pane with settings tree >>
#@+node:ekr.20050123092834.526: *6* Pychecker
Fixed shadow warnings.  The following are all Python global functions:

cmp -> compare
dict -> theDict
dir -> theDir
file -> theFile
id -> theId
type -> theType
input  (suppressed the warning)
iter -> theIter
#@+node:ekr.20050123092834.438: *6* Scripting
#@+node:ekr.20050123092834.439: *7* Fixed unbounded recursion with --script and redirected output
The problem was that nullLog.write calls print, and if print is redirected the
code ends up calling nullLog.write again.

What I did:

- g.redirectClass.redirect does nothing if g.app.batchMode is True.
- added g.rawPrint.
- Changed self.old.write(s) to self.old.write(s+'\n') throughout.
#@+node:ekr.20050123092834.474: *7* Script buttons now execute the entire script
It makes no sense to use only the selected text.
#@+node:ekr.20050123092834.480: *7* Fixed error reporting in executeScript when the error happens outside the script
The old code assumed that the error is always in the script itself. Not true!
The error could happen in methods called by the script.

This code works with Python 2.3.4 and Python 2.4.  It may be version dependent.
#@+node:ekr.20050123092834.486: *6* Startup
#@+node:ekr.20050123092834.487: *7* Non-existent command-line file becomes name of new Leo wiindow
Leo now sets the name of the frame to the requested file name on the command line even if the file name does not exist.
#@+node:ekr.20050123092834.1011: *7* computeHomeDir now handles references to other vars
computeHomeDir() now test the first retrieval of the %HOME% var and grab it's
results if it is in fact another environment variable.
#@+node:ekr.20050123092834.896: *5* New or improved features...
#@+node:ekr.20050123110009: *6* Using @settings trees and leoSettings.leo
Leo now stores options in @settings trees, that is, outlines whose headline is
'@settings'. When opening a .leo file, Leo looks for @settings trees not only in
the outline being opened but also in various leoSettings.leo files.

The key design goal of @settings trees was that Leo's user options must be
infinitely flexible. That goal has been accomplished. Indeed, users can create
arbitrarily complex user options with @settings trees. Leo settings outlines
are, in fact, infinitely more flexible and powerful than any scheme based on
flat text.

The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings pane". This settings pane allows you to change
the settings selected in the outline pane using standard gui widgets. The
settings pane is dynamically created from nodes in the settings tree; it is as
extensible as the @settings tree itself.

For full details, see the children of this node.
#@+node:ekr.20050122084954: *7* Using leoSettings.leo and @settings trees
Leo stores options in @settings trees, that is, parts of Leo outlines whose root node has the headline @settings.  When opening a .leo file, Leo looks for @settings trees in the following places:

- The file called leoSettings.leo in the leo/config directory.
- The file called leoSettings.leo in the users home directory.
- The file being loaded.

Settings that later in the above list override settings found earlier. For
example, any setting specified in an @settings tree in the file being loaded
overrides any setting seen in any leoSettings.leo file.

The Settings command temporarily replaces the outline pane with an outline
showing all the @settings trees in effect. The Settings command also replaces
the body pane with a "settings dialog" pane. This settings dialog pane allows
you to change the settings selected in the outline pane using standard gui
widgets.

The format of nodes in @settings trees are as follows:

1. "Simple settings nodes" have headlines of the form:

@<type> name = val

set the value of name to val, with the indicated type.

<type> may be one of the following, with valid values shown:

<type>          Valid values
-----           ------------
\@bool           True, False, 0, 1
\@color          A Tk color name or value, such as 'red' or 'xf2fddff' (without the quotes)

For a list of Tk color specifiers see:

- http://www.tcl.tk/man/tcl8.4/TkCmd/colors.htm
- http://www.tcl.tk/man/tcl8.4/TkLib/GetColor.htm

\@directory      A path to a directory
\@float          A floating point number of the form nn.ff.
\@int            An integer
\@ints[list]     An integer (must be one of the ints in the list).
                 Example: @ints meaningOfLife[0,42,666]=42
\@path           A path to a directory or file
\@ratio          A floating point number between 0.0 and 1.0, inclusive.
\@string         A string
\@strings[list]  A string (must be one of the strings in the list).
                 Example: @strings tk_relief['flat','groove','raised']='groove'

2. "Complex settings nodes" have headlines of the form:

\@<type> description

The actual settings are specified in the body text.  At present, there are two such kinds of complex settings nodes:

- @font

The body text contains a list of settings for a font.  For example:

body_text_font_family = Courier New
body_text_font_size = None
body_text_font_slant = None
body_text_font_weight = None

- @recentFiles

The body text contains a list of paths of recently opened files, one path per line.

Warning: The following features of @recentfiles nodes are confusing and probably
will be changed:

- Leo does not save recent file information unless the open .leo file has an
@settings tree and an @recentfiles node within the @settings tree. That is, Leo
does not save recent files information in leoSettings.leo files.

- Changing the @rencentfiles node doesn't mark the Leo file as dirty, so if you
don't save the .leo file the recent files information will not be updated.

3.  All other nodes are "Organizer" nodes.  Such nodes have no effect on the settings shown in the dialog.  You may use them as you please to organize settings.

Notes:

A.  At present, you can not change @settings trees while executing the Settings command.  You can, however, change any @settings tree normally when not executing the Settings command.

B. Other kinds of settings nodes are planned for future releases.
#@+node:ekr.20050122091036: *7* Unfinished configuration features
The essential features of @settings trees and the settings dialog appear to be stable.  However, many improvements can be imagined, including the following:

- Allow searching for nodes while in the settings dialog.

- Allow adding, deleting, rearranging nodes while in the settings dialog.

- Allow adding, deleting, rearranging recent files while in the settings dialog.

These will be added as time permits and people request.
#@+node:ekr.20050123103303.1: *6* Code
#@+node:ekr.20050123092834.520: *7* Rewrote Leo's read/write logic
The new code greatly simplifies the class structure. The intention is to allow plugins to override methods of this file more easily.

The highlights:

- Plugins may now override methods in this file much more easily.
    - All code is now in a single class.
    - Resolved the few name conflicts by renaming x to x3 or x4.
    - The new code generally uses methods instead of sections.
    - Initialization is now simple and sane, and is done in dedicated methods.
    - All constants are class constants: no more module-level constants.

- All top-level methods support toString or fromString arguments.
#@+node:ekr.20050123092834.173: *7* Added g.cantImport
#@+node:ekr.20050123092834.901: *7* Added g.fileLikeObject.readline
This supports the fromString option in read commands.
#@+node:ekr.20050123092834.928: *7* Added support for g.app.debugSwitch in es_exception
It's not clear that this support is so useful for debugging scripts.

If g.app.debugSwitch is True es_exception gives a full traceback.
#@+node:ekr.20050123092834.984: *7* Restored drawing/event hooks
Restored the following hooks:

"boxclick1"     before click in +- box            c,p,v,event
"boxclick2"     after  click in +- box            c,p,v,event
"drag1"         before start of drag              c,p,v,event
"drag2"         after  start of drag              c,p,v,event
"dragging1"     before continuing to drag         c,p,v,event
"dragging2"     after  continuing to drag         c,p,v,event
"enddrag1"      before end of drag                c,p,v,event
"enddrag2"      after  end of drag                c,p,v,event

The following already existed.  I added v=p keyword params:

"iconclick1"    before single click in icon box   c,p,v,event
"iconclick2"    after  single click in icon box   c,p,v,event
"iconrclick1"   before right click in icon box    c,p,v,event
"iconrclick2"   after  right click in icon box    c,p,v,event
"icondclick1"   before double click in icon box   c,p,v,event
"icondclick2"   after  double click in icon box   c,p,v,event
#@+node:ekr.20050123092834.1004: *7* Added p=p param to all hooks containing v=v
Changed these hooks:

"bodyclick1", "bodyclick2",
"bodydclick1", "bodydclick2",
"bodyrclick1", "bodyrclick2",
"bodykey1", "bodykey2",
"command1", "command2",
"headclick1", "headclick2",
"headrclick1", "headrclick2",
"headkey1", "headkey2", 
"hyperclick1", "hyperclick2",
"hyperenter1", "hyperenter2",
"hyperleave1", "hyperleave2", 
"openwith1", "openwith2",
"menu1", "menu2", 
"recentfiles1", "recentfiles2",
"save1", "save2",
"select1", "select2", "select3",
"start2",
"unselect1", "unselect2",
"url1", "url2", 

"clear-mark", "set-mark", 
"color-optional-markup",
"create-popup-menu", 
"draw-outline-icon",
"draw-outline-node",
"draw-outline-text-box",
"draw-sub-outline", 
"init-color-markup",
"scan-directives", 
"draw-outline-box",
"enable-popup-menu-items",
"show-popup-menu",
#@+node:ekr.20050123092834.565: *7* Implemented delayed focus scheme
Leo's code now contains an important simplification to Leo's gui code. This
arose because of a problem in the UNL plugin. The window that opened when double
clicking an @url UNL node wasn't staying on top.

It turns out that this was essentially impossible to fix with the old code. The
proximate cause of the original problem button-1 was bound to OnActivateTree,
which called g.app.gui.set_focus after the new window was visible, thereby
bringing the old tree to the front.

Further investigation revealed other problems. For example, the idle-time code
in the status line logic was also messing with the focus. It turns out that
repeatedly calling g.app.gui.set_focus is a very bad idea, for lots of reasons
which I won't go into in detail here.

The old code called g.app.gui.set_focus explicitly whenever it wanted focus to
change. But there is a much better way, namely to have routines that _indicate_
where they want the focus to be "after the dust settles", that is, when all gui
calls have been completed. I call this a "delayed focus" scheme.

So I rewrote all the code that sets the focus. The new code replaces direct
calls to g.app.gui.set_focus with calls to the following methods in
leoTkinterFrame class: bodyWantsFocus, statusLineWantsFocus, treeWantsFocus and
logWantsFocus. Actually, these xWantsFocus methods all do the same thing, but
using different methods improves traces.

This is an excellent pattern. Again, rather than setting the focus directly,
these xWantsFocus methods merely signal their intension to set the focus. This
allows very complex logic to be hidden in leoTkinterFrame.set_focus.

leoTkinterFrame.set_focus is indeed complex. It took me several hours this
morning to get it just right. It queues up a 'one-shot' callback. That is, at
most one copy of the callback is ever waiting to be executed. Furthermore, the
callback is only queued for execution at the result of a call to xWantsFocus; it
is never run automatically at idle time. Finally, even when executed, the
callback does nothing if the last requested commander (in the new ivar,
g.app.wantedFocus) does not match the commander to which the callback was bound.

These checks allow the UNL plugin to open a window properly and keep it topmost.

This is a big step forward for Leo, for the following reasons:

- Delayed focus ensures that the body pane always has focus unless the code has
a specific, positive reason for the focus to be elsewhere. This was difficult
(or rather impossible) to do with the old code: there are _many_ Tk calls that
can affect the focus.

- Delayed focus minimizes calls to g.app.gui.set_focus. Unlike the old code,
many seconds may elapse between calls. The stress on Tk is much less, and I
believe this may cure some flakiness in how focus changes, especially in
headlines.

- There are some cases where focus must change immediately. The xWantsFocus
methods all support a 'later' keyword argument. By default it is True, but when
it is False leoTkinterFrame.set_focus calls g.app.gui.set_focus immediately.

- The xWantsFocus methods all support a 'tag' keyword argument that tells what
routine the method is called from. It is a big help in making sense of traces.
BTW, extensive traces are the _only_ possible way of tracking down
focus/selection problems.
#@+node:ekr.20050123103521: *6* Commands
#@+node:ekr.20050123092834.897: *7* Added 'Expand Or Go Right' and 'Contract or Go Left' commands
These commands work as do the similar commands in Windows Explorer. How did we
ever live without them?
#@+node:ekr.20050123092834.908: *7* Added keyboard shortcuts to find panel
- Tab toggles between the Search to the Replace areas.

- Control-Tab inserts a tab.

- Added hot keys for all settings.  Use Alt-x to activate hot key x.
  The Enter key activates the Find button.

- As usual, Alt-F4 dismisses the Find panel.
#@+node:ekr.20050123092834.1005: *7* Find panels are now associated with individual Leo windows
Leo no loner has any global windows!

- Each commander has its own find window.
    - It's title tells to what commander it applies.
#@+node:ekr.20050123105026: *7* Find panels are now inited from @settings nodes
- Leo now ignores all find settings in .leo files.  Instead, Leo inits find settings from @settings entries.

- Removed all c ivars corresponding to leoFind ivars.
    - This eliminates the ugliest code in Leo.
    - Inits all leoFind ivars from @settings in init, a helper of the ctor.
    - Updates all the leoFind ivars in update_ivars, called just before doing any find.

- Removed the _flag suffix from leoFind ivars.
    - Another major mess cleaned up.

- Renamed find/change_text to find/change_ctrl to avoid name conflict.
#@+node:ekr.20050123092834.961: *7* Improved Go To Line Number and Execute Script commands
- Go To Line Number command now assumes the presently selected node is a script if there is no ancestor @file node.

- Execute Script command uses this new logic to select the proper node and line in a script if there is an error.

How did we ever live without these features?
#@+node:ekr.20050123092834.1018: *7* Improved support for relative path names
Actually, support already existed for them in getBaseDirectly!

What I did.

- Added a c keyword to getBaseDirectory.
- Added similar logic to os_path_join.

- Changed some stupid code in g.openWithFileName (called by @url logic):
    changed: fileName = g.os_path_join(os.getcwd(),fileName)
    to:      fileName = g.os_path_abspath(fileName)

MAYBE g.os_path_abspath should force '.' to mean c.openDir, but I kinda doubt
it. This could be asking for trouble.

OTOH, the various flavors of scanAllDirectives already do this.  Hmmmmmm.
#@+node:ekr.20050123092834.1043: *7* Implemented 'Undo Clear Recent Files'
#@+node:ekr.20050123092834.517: *7* Removed old-style write commands
Leo can still read such files, but old-style file formats are now deprecated
#@+node:ekr.20050123092834.1044: *6* Plugins & extensions
#@+node:ekr.20050123115804: *7* Added Plugins Manager plugin
Leo now boasts a wonderful new Plugins Manager plugin. This plugin enables and
disables plugins automatically.This plugin also tells you everything you need to
know about each plugin. Finally, this plugin also lets you download plugins from
Leo's cvs site! Many thanks to Paul Patterson for this excellent work.

Note. The Plugins Manager plugin requires Pmw. You can install Pmw in Leo's
extensions directory if you like.
#@+node:ekr.20050123115804.1: *7* You can install third-party extensions in Leo's extensions directory
You can can import any extension to Leo by putting the extension in the 'extensions' directory and using g.importExtension to import it.

- created the 'extensions' directory and g.app.extensionsDir

- created g.importModule and g.importExtension
#@+node:ekr.20050123112151: *7* Improved doHandlersForTag
- leoPlugins.doHandlersForTag now executes the list of hook handlers for a
particular tag (hook name) until one of the handlers returns a non-None result.
doHandersForTag no longer tries to "sort" handlers, so the order that the
handlers are executed is the order in which they were registered.

I finally understand the concerns people have raised several times about hooks
interfering with each other. If two handlers try to return a non-None result
only one of them will ever execute. doHandlersForTag can't do much about this: a
better solution would require more conceptual framework. Not now...
#@+node:ekr.20050123092834.1013: *7* Leo now associates modules with hook handlers
#@+node:ekr.20050123103753: *6* Syntax Coloring & languages
#@+node:ekr.20050123092834.903: *7* Added support for Ada
Thanks to Bernhard Mulder for the new code.
#@+node:ekr.20050123092834.929: *7* Added support for Forth
Thanks to David McNab <david@freenet.org.nz> for this work.
#@+node:ekr.20060206111717.1: *3* 4.4 minibuffer, keys, autocompletion, multiple log panes
#@+node:ekr.20051219150602: *4* 4.4 alpha 5
Leo 4.4 alpha 5                                             January 6, 2006

This release completes the last major features of Leo 4.4:

- User-specified key-binding modes.
- Support for multiple key-bindings for individual minibuffer commands.

This will be the last alpha version of Leo 4.4. Beta 1 is coming in about a
week. You should be able to use this version safely; there are no known serious
bugs.

To learn about Leo, see: http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
----------------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name. Support for tab completion.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Support for most commands in the Emacs Cmds menu, including cursor and screen
movement, basic character, word and paragraph manipulation, and commands to
manipulate buffers, the kill ring, regions and rectangles.

- Per-pane key bindings. You can bind shortcuts to multiple commands depending
on which of Leo's panes presently has focus. For example, you can use arrow keys
to move nodes in the outline pane, while retaining their defaults in Leo's body
pane.

- User-specified key-binding modes. This feature makes it possible to emulate all
aspects of Emacs and Vim as far as key bindings are concerned.

- @command nodes create minibuffer commands. You can bind key shortcuts to
@button and @command nodes.

- Leo recovers from crashes much more reliably than in any previous version.

- Leo handles keystrokes and updates the screen immediately rather than waiting
for idle time.
#@+node:ekr.20051219150602.2: *5* Fixed bugs
#@+node:ekr.20051219150602.3: *6* Made sure focus doesn't go to log during tab completion or after writes to log
#@+node:ekr.20051219150602.7: *6* Fixed problem with getScript in batch mode
#@+node:ekr.20051219150602.10: *6* Text box is now selected in goto-line-number command
http://sourceforge.net/forum/message.php?msg_id=3464874
#@+node:ekr.20051219150602.13: *6* Restored headkey  & bodykey hooks
http://sourceforge.net/forum/message.php?msg_id=3466412

New in Leo 4.4: Leo calls the 'headkey1' and 'headkey2' hooks only when the user
completes the editing of a headline, and ch is always '\r', regardless of
platform.

http://sourceforge.net/forum/message.php?msg_id=3462294
#@+node:ekr.20051219150602.28: *6* Fixed ancient bug in read error logic that hung Leo
http://sourceforge.net/forum/message.php?msg_id=3467558

What I did:

- atFile.readError deletes root's entire subtree.
- atFile.read only warns about unvisited node if there is no error.
#@+node:ekr.20051219150602.75: *6* Fixed many headline problems
http://sourceforge.net/forum/message.php?msg_id=3461068

And a recent bug: clicking in the expand/contract box didn't save the headline.
#@+node:ekr.20051219150602.81: *6* Fixed problem in reformatParagraph
The problem was caused by the recent change to g.app.gui.setTextSelection.

The default for the new 'insert' keyword must be sel.end for compatibility with old code.
#@+node:ekr.20051219150602.85: *6* Installed LeoUsers patch
Read @file Nodes and Import external file commands no longer create copies of the root node.
#@+node:ekr.20060105182648.376: *6* Improved Import external files command.
Leo no longer creates a duplicate root node when importing external files.

The code is due to LeoUser.
#@+node:ekr.20060105182648.377: *6* Fixed crasher in backwardDeleteCharacter
#@+node:ekr.20060105182648.378: *6* Fixed recent bug: dialogs now get focus properly when first opened.
#@+node:ekr.20060105182648.379: *6* Made sure shortcuts are printed clearly by k.registerCommand
#@+node:ekr.20060105182648.382: *6* Suppressed crash undoing a clone followed by a drag
The reason for this assert is unclear.
#@+node:ekr.20051219150602.100: *5* New features
#@+node:ekr.20051219150602.101: *6* created ut.leo, ut.py and ut.bat
The provide batch-mode unit testing.
#@+node:ekr.20051219150602.102: *6* Added modes/*.xml to distribution
#@+node:ekr.20051219150602.105: *6* Revised cursor movement commands and added selection-extension commands
Leo now supports the following commands, shown below with their present bindings:

back-char ! text = LtArrow
back-char-extend-selection ! text = Shift-LtArrow
back-paragraph ! text = Alt-braceleft 
back-paragraph-extend-selection ! text = Alt-Shift-braceleft
back-sentence ! text = Alt-a 
back-sentence-extend-selection  = None
back-word ! text = Alt-b  # No conflict   
back-word-extend-selection  ! text = Alt-Shift-b
beginning-of-buffer ! text = Alt-less # Note: same as Alt-Shift-less
beginning-of-buffer-extend-selection  = None
beginning-of-line ! text = Ctrl-a
beginning-of-line-extend-selection = None
exchange-point-mark = None
forward-char ! text = RtArrow
forward-char-extend-selection ! text = Shift-RtArrow
forward-paragraph ! text = Alt-braceright
forward-paragraph-extend-selection ! text = Alt-Shift-braceright
forward-sentence ! text = Alt-e
forward-sentence-extend-selection ! text = Alt-Shift-e
forward-word ! text = Alt-f
forward-word-extend-selection ! text = Alt-Shift-f
next-line ! text = DnArrow
next-line-extend-selection  ! text = Shift-DnArrow
previous-line ! text = Uparrow
previous-line-extend-selection ! text = Shift-UpArrow

The -extend-selection variants move the cursor and also extend the selection
from the insert point in the indicated direction. As usual exchange-point-mark
switches the insert point from one side of the selection to the other: which
side of the selection the insert point is on does make a difference.

I also added three commands that implement so-called 'extend mode':

clear-extend-mode = None
set-extend-mode = None
toggle-extend-mode = None

When extend mode is on (it is off at first), all cursor movement commands listed
above extend the selection. Very handy. Thanks to Brian for this suggestion.

This is the start of mouseless Leo. For the first time all the common Emacs
cursor-movement commands exist. These commands should work in any text widget.
#@+node:ekr.20051219151926: *6* Added classic key bindings in leoSettings.leo
leoSettings.leo now contains a node called:

@@shortcuts traditional Leo bindings

This node contains the 'classic' Leo key bindings that appeared in Leo 4.3. I
have proofed these settings carefully, but some errors may remain. Please report
any errors or any other suggestions for these settings.
#@+node:ekr.20060105182648.432: *6* Allow multiple key bindings to the same command
#@+node:ekr.20060105182648.469: *6* Settings command now opens leoSettings.leo
This is the end of the ill-fated settings dialog.

Important: you can use the show-colors and show-fonts commands to help set
colors and fonts in leoSettings.leo.
#@+node:ekr.20051028051444: *4* 4.4 alpha 4
Leo 4.4 alpha 4                                         December 5, 2005

Leo 4.4 a4 introduces the 'Newer World Order' for redrawing the screen,
corrects numerous bugs in the 4.4 code base, and introduces several new features.

You should be able to use this version safely. There are no known serious bugs,
but several minibuffer commands are not ready for prime time. All the major
features of 4.4 are in place.

To learn about Leo, see: http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
----------------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name. Support for tab completion.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Support for almost all commands in the Emacs Cmds menu, including cursor
and screen movement, basic character, word and paragraph manipulation, and
commands to manipulate buffers, the kill ring, regions and rectangles.

- Per-pane key bindings. You can bind shortcuts to multiple commands depending
on which of Leo's panes presently has focus. For example, you can use arrow keys
to move nodes in the outline pane, while retaining their defaults in Leo's body
pane. Per-pane key bindings are essential for mouseless Leo.

- @command nodes create minibuffer commands. You can bind key shortcuts to
@button and @command nodes.

- A rewrite of Leo's keystroke handling. In particular, Leo handles key events
immediately rather than queuing them for idle time.

- Leo recovers from crashes much more reliably than in any previous version.

- Leo updates the screen immediately rather than waiting for idle time.
This 'Newer World Order' simplifies the code and improves performance.

Known bugs in Leo 4.4a4
-----------------------
- Several minibuffer commands do not work.  See the release notes for details.

Coming in later releases of Leo 4.4:
------------------------------------
- An auto-complete command that shows class members in the Completion tab.

- More support for mouseless Leo. There will be commands to manipulate all
aspects of Leo using commands, so your fingers will never have to leave the
keyboard.

- Support for Vim and other 'plain-key' input modes.
#@+node:ekr.20051028051444.1: *5* Quick Start
Here are the default bindings relating to the minibuffer. Any of
these may be changed by changing @shortcuts nodes in leoSettings.leo.

Alt-x: Just like Emacs: starts minibuffer. The prompt is 'full-command' Type a
full command name, then hit <Return> to execute the command. Tab completion
works, but not for file names.

Alt-c: Like Emacs Control-C: (Ctrl-C conflicts with XP cut). starts minibuffer.
The prompt is 'quick-command'. This mode is not completed, but stuff like
`Ctrl-C r` and `Ctrl r r` do work.

Alt-u: Like Emacs Ctrl-u: (Ctrl-u conflicts with move-outline-up). Add a repeat
count for later command. Ctrl-u 999 a adds 999 a's, but many features remain
unfinished.

Ctrl-g: Just like Emacs Ctrl-g: Closes the mini-buffer.

The @bool useMinibuffer setting in leoSettings.leo just controls whether the
minibuffer is visible. The minibuffer exists (and you can type into it) even if
it isn't visible! You can use the show-mini-buffer, hide-mini-buffer and
toggle-mini-buffer commands to show or hide the minibuffer.
#@+node:ekr.20051028051444.2: *5* The 'key' features of 4.4
The most important new features of Leo 4.4 have to do with key bindings.

See the children of this node for details.


#@+node:ekr.20051101161405: *6* Leo's minibuffer works like the Emacs mini-buffer
At the bottom of Leo's window you will now see an area labeled the mini-buffer.
You can't type in it directly, you activate the buffer by typing Alt-x or Alt-c.
Typing Alt-x takes you to 'full-command' mode. Type the full name of a command,
followed by a 'return'. 

- To get help, type Alt-x help.
- For a list of commands, type Alt-x print-commands.
- For a list of present key bindings, type Alt-x print-bindings.
- To leave the mini-buffer at any time type Ctrl-g.

Note: you can redefine any of these keys as you wish.

Important: you can execute any of Leo's 'legacy' commands from the mini-buffer.
For example, Alt-x about-leo or Alt-x open-find-dialog. Note: Leo's Find
*dialog* is deprecated. You will find it much more convenient to use Leo's new
Find *tab*. Use the open-find-tab command.

You can use tab-completion in the minibuffer to cycle through the list of
commands that start with what is in the buffer. Typing backspace takes you back
to the what you previously typed (less on character.) The 'Completion' tab shows
all possible completions. This tab appears automatically when you type a tab in
the minibuffer.

The mini-buffer reduces the need for shortcuts dramatically. For example, none
of Leo's import commands need a shortcut because it is easy enough to execute
them from the minibuffer. In particular, executing commands from the minibuffer
is much easier than executing commands by hand from a menu. 
#@+node:ekr.20051101161405.1: *6* @shortcuts nodes in leoSettings.leo allow per-pane bindings
leoSettings.leo contains one functional @shortcuts node and one disabled
@@shortcuts node. These node contain entries for every command.

You can assign key shortcuts to any command, as discussed in the comments in
that file. You can leave the nodes as they are, use them as base for
modifications, or roll your own. You should define a binding for every function,
even if that binding is 'None'. If you don't, Leo will issue a warning.

Leo now supports per-pane bindings.  Bindings of the form:

command-name ! pane = shortcut

bind the shortcut to the command only withing a single pane. The possible values
for 'pane' are:

pane    affected panes
----    --------------
all     body,log,tree
body    body
log     log
mini    minibuffer
text    body,log
tree    tree
#@+node:ekr.20051101161405.2: *6* The scripting plugin allows key bindings
The scripting plugin has been improved in two ways:

1. You can specify key bindings in @button nodes as follows:

@button name @key=shortcut

This binds the shortcut to the script in the script button. The button's name is
'name', but you can see the full headline in the status line when you move the
mouse over the button.

2. You can create new minibuffer commands with @command nodes:

@command name @key=shortcut

This creates a new minibuffer command and binds shortcut to it.
#@+node:ekr.20051101161405.3: *6* EKR shortcuts
Abbreviations may not work at present. A new kind of abbreviation is presently
hard coded in add_ekr_altx_commands in leoKeys.py. For example, one ekr-shortcut
is: 'f', which is bound to leo-find-panel. Typing Alt-x f Return executes
leo-find-panel. These may be quicker than Emacs abbreviations, or not.
#@+node:ekr.20051101162123: *6* Leo now ignores key bindings in menu tables
These 'hard-coded' bindings are no longer needed and interfere with per-pane bindings.
#@+node:ekr.20051205091625: *5* Status of minibuffer commands
- The abbreviation and buffer commands are not ready yet.

- repeat-complex-command does not work.

- Moving the cursor when the 'mark' has been defined does not expand the visibly
selected text.

- Yanking and killing have not been well tested.

- C-u 5 <return> works but is not undone properly. Also, the kill-line command
does not work as in Emacs.

- Many new commands must be generalized to handle the more complex environment
Leo offers. For example, search commands must be told whether to limit the
search a single node, or a node or and its descendants, or the entire outline.
We need a set-variable command that sets a (Python) variable using an
emacs-style variable name.

- The notion of the 'point' must be expanded so it indicates a node as well as
text location.

- New commands are needed to support 'mouseless-Leo'. The user must be able to
drive all dialogs from the keyboard, or to get the same effect without using a
dialog at all. Examples: dismiss-top-dialog, scroll-outline-up/down. We also
need commands to change focus and to manage menus. Examples: focus-in-body,
focus-in-tree, etc, activate-edit-menu, etc.
#@+node:ekr.20051028051616: *5* New in alpha 1...
#@+node:ekr.20051028051444.4: *6* New options
#@+node:ekr.20051028051444.5: *7* The @bool useMinibuffer option
1. The minibuffer exists regardless of this setting, but will not be shown
   initially if it is False.

2. Hiding the minibuffer does not change any bindings or the operation of Leo in
   any other way. Therefore, if you do hide the minibuffer initially, and never
   want to use it, you should not bind shortcuts to any commands that use the
   minibuffer.

3. You can execute the show-mini-buffer, hide-mini-buffer and toggle-mini-buffer
   commands (or any other minibuffer command!) if the minibuffer is hidden.
   Indeed, the following will work even if the minibuffer is hidden.

       <alt-x>show-mini-buffer<return>
#@+node:ekr.20051028051444.6: *7* The @bool useCmdMenu option
This option controls whether Leo creates a Cmds menu.

This menu is not ready yet, though nothing bad happens if this option is True.
#@+node:ekr.20051028051444.7: *7* Options for selected body text
http://sourceforge.net/forum/message.php?msg_id=3355954

'body_text_selection_background_color'  Default is 'Gray80'
'body_text_selection_foreground_color'  Default is 'white'
#@+node:ekr.20051028051444.8: *6* New mini-buffer commands
- The contract-and-go-right command moves to the parent node and collapses the
parent node.

- The goto-first-sibling and goto-last-sibling commands allow rapid movement
through an ouline without collapsing nodes.

- The print-bindings and print-commands show what commands exist and what keys
are bound to them.

- The help command gives a brief quick start introduction to Leo's Emacs-like
features.
#@+node:ekr.20051028051444.9: *6* New code-level features
#@+node:ekr.20051028051444.10: *7* Dictionaries of keys and commands
Leo maintains the following dictionaries.  As usual, k refers to c.keyHandler:

- c.keyHandler.registerCommand can be called from scripts to register new alt-x
  commands. It probably won't work from plugins yet.

New dictionaries and methods make it easier to customize and extend Leo:

- c.commandsDict describes all commands. Keys are full Emacs command names;
values are functions f.

- k.inverseCommandsDict: keys are f.__name__, values are emacs command names.

- k.leoCallbackDict: keys are leoCallback functions, values are called
functions.

- k.bindingsDict: keys are shortcuts, values are g.bunches with the following
    members: func, name, warningGiven, fromMenu.
#@+node:ekr.20051028051444.11: *7* Functions that return the present key bindings
The following helper functions make it easy to discover the binding presently in
effect for a command:

- k.getShortcutForCommandName(self,commandName) returns the shortcut given
  f.__name__.

- k.getShortcutForCommand(self,f) returns the shortcut for f.
#@+node:ekr.20051028051444.12: *7* Added registerCommand helper
c.k.registerCommand (self,commandName,shortcut,func)

This function make the func available as a minibuffer command, and optionally
binds a shortcut to func. You can wrap any method in a function, so the
restriction to functions is not significant.

Here is an example take from an @button node::

k = c.keyHandler

def f (event):
    g.es_print('Hello',color='purple')

k.registerCommand('print-hello','Alt-Ctrl-Shift-p',f)
k.registerCommand('print-hello2',None,f)
#@+node:ekr.20051028051444.13: *6* Bugs fixed (in 4.3 code base)
The following bugs exist in 4.3 final.
#@+node:ekr.20051028051444.14: *7* Leo protects c.endUpdate with a 'finally' clause
This makes it much harder to hang Leo after taking an exception. Leo 4.4a1 is
*much* more robust than Leo 4.3 final in this regard.
#@+node:ekr.20051028051444.15: *7* Added kludge to solve infamous control-v problems
Added big kludge to menu.createMenuEntries so that f.OnCut/Copy/PasteFromMenu get called
**only** when explicitly selected from the menu (rather than from a shortcut).
This allows the code in cut/copy/paste-text to be different as needed.

Users can override the shortcut by assigning shortcuts to cut/copy/paste-text commands.
The shortcut will appear in the menu, but does **not** get bound to c.frame.menu.

This is an essential step in solving the infamous Control-V problem.
The code appears to work properly on XP.  Not tested other places.

This is the last best hope to solve this problem: the code interacts as little as possible with Tk.
#@+node:ekr.20051028051444.16: *7* Fixed bug in Leo's read logic
http://sourceforge.net/forum/message.php?msg_id=3351985

Leo did not read empty tnodes like <t/> properly.
#@+node:ekr.20051028051444.17: *7* Fixed bug in goto-last-node.
#@+node:ekr.20051028051444.18: *7* Leo now reads @settings trees when opening a .leo file from another outline.
http://sourceforge.net/forum/message.php?msg_id=3376527
#@+node:ekr.20051028051444.19: *7* Improved g.removeExtraLws
It now computes the minimum leading whitespace of all non-blank lines. The old
code computed the leading whitespace of the *first* non-blank line. This would
give the wrong results if the first line were indented.
#@+node:ekr.20051028051616.1: *5* New in alpha 2
#@+node:ekr.20051101162123.1: *6* The tabbed log
- The open-find-tab command opens the Find tab.

- The open-spell-tab command opens the Spell-checking tab.

The Find and Spell *tabs* replace the corresponding legacy *dialogs*. Using tabs
eliminates previous problems with dialogs obscuring Leo's main window.

Two essential components of the settings dialog now are implemented in the tabbed log:

- The show-colors command creates the 'Colors' tab in the log pane.

- The show-fonts command creates the 'Fonts' tab in the log pane.

These two tabs allow you to pick color or font names without using the @settings dialog.

Important: scripts and plugins can easily create new tabs in the Log pane. See
Chapter 7 of the Users Guide for details.
#@+node:ekr.20051028051616.172: *7* Programming the tabbed log
@color

# Plugins and scripts can easily create new tabs in the log panel.
# Important: you can run any of these examples using the 'Run Script' button.

# To create a tab named "Test" or make it visible if it already exists:

c.frame.log.selectTab('Test')

# When first created, a tab contains a text widget.
# To write to this widget, add the tabName argument to g.es:

g.es('Test',color='blue',tabName='Test')

# Plugins and scripts can easily replace the default Text widget with other Tk widgets.
# c.frame.log.tabFrame contains the Tk.Frame that contains all the other widgets of the frame.
# c.frame.log.logCtrl contains the Tk.Text widget that is initially the only widget in this frame.
# So to remove this text widget just do:

c.frame.log.logCtrl.pack_forget()

# Now you can pack any other widgets into c.frame.log.tabFrame.

import Tkinter as Tk ; log = c.frame.log
log.selectTab('Test')
log.logCtrl.pack_forget()
f = Tk.Frame(log.tabFrame,bg='red',height='1inch',width='2inch')
f.pack(side='left',expand=0,fill='none')
#@+node:ekr.20051028061322: *6* New minibuffer commands
**Important**: The print-bindings and print-commands commands (new in a1) show
what commands exist and what keys are bound to them.

- The help command tells how to use the minibuffer.

- The show-minibuffer, hide-minibuffer and toggle-mini-buffer commands show and hide the minibuffer.

It *is* possible to execute these command even if the minibuffer isn't presently
visible. For example, typing 

<alt-x>toggle-mini-buffer<return>

should always work.

- The open-find-tab command opens the Find tab. The Find tab replaces the old
Find panel. The Find panel is deprecated.

- The open-spell-tab command opens the Spell-checking tab.

- The show-colors command creates the 'Colors' tab in the log pane. This tab allows you to
experiment with picking fonts.

- The show-fonts command creates the 'Fonts' tab in the log pane. This tab allows you to
experiment with picking colors.
#@+node:ekr.20051028051616.299: *6* Optional generation of closing brackets
Leo can optionally generate matching brackets depending on the setting:

@bool autocomplete-brackets = TrueOrFalse

If True, Leo will immediately type the corresponding closing bracket whenever
you type a '(', '[' or '{' character. You can use the forward-char command to
move past the closing bracket, and Leo will move past any closing bracket if you
type the closing bracket with the cursor just to the left of a closing bracket.
#@+node:ekr.20051101182739: *6* New settings in leoSettings.leo
- The node::

    @shortcuts traditional Leo shortcuts with important emacs bindings

contains Leo key bindings.

- The spelling settings in leoSettings.leo replace the settings in spellpyx.ini.

- You can specify the background of tabs using the following pattern::

    @color log_pane_XXX_tab_background_color = aColor

For example::

    @color log_pane_Find_tab_background_color = #d6c7d3

- The @bool autocomplete-brackets setting controls whether Leo types a matching
closing bracket immediately when you type '(', '[' or '{'.
#@+node:ekr.20051101161949: *6* Improved and retired plugins
#@+node:ekr.20051028051616.160: *7* Improved the scripting plugin
@nocolor

The scripting plugin has been improved as follows:

1. You can bind shortcuts in @button nodes.  Like this:

@button name @key=shortcut

This binds the shortcut to the script in the script button. The button's name is
'name', but you can see the full headline in the status line when you move the
mouse over the button. This is a clean and simple way of discovering the
shortcut.

2. You can create your own minibuffer commands with @command nodes.

A node whose headline has the form:

@command command-name

a new minibuffer command whose name is 'command-name'.

A node whose headline has the form:

@command command-name @key=shortcut

creates new minibuffer command and binds shortcut to it.

3. The scripting plugin no longer contains the 'bindLate' code-level option. The
scripts for all @button or @command nodes are computed 'dynamically', that is,
when the button is pushed or the command is executed from the minibuffer. This
is the most useful way, and the most intuitive.

Previously, scripts for @button nodes were never dynamic, while scripts in
@button nodes created by the 'Script button' button were dynamic only if
bindLate was True. You could call this a bug: it was unhelpful, annoying and
confusing.

4. The scripting plugin no longer prints an 'end of script' message. This allows
scripts to select tabs in the log pane
#@+node:ekr.20051101162947: *7* Retired the TabbedLog plugin
Leo's core now supports tabs in the log pane.
#@+node:ekr.20051101163145: *6* Many code-level improvements
Leo 4.4a2 contains a large number of code-level improvements--some very
significant. For full details, see the (Projects) section of LeoPy.leo.
#@+node:ekr.20051101163404: *6* Fixed minor bugs
The following bugs existed in the 4.4a1 code base and have now been fixed:

- Removed warnings from compare dialog.
#@+node:ekr.20051109112610: *5* New in alpha 3
#@+node:ekr.20051109112826: *6* The New and Newer World Orders
@nocolor

The New World Order means that drawing happens immediately, not at idle time.

The Newer World Order means that c.endUpdate is equivalent to c.redraw_now.
#@+node:ekr.20051109141223: *6* Bugs fixed...
#@+node:ekr.20051109112826.217: *7* Fix crasher in Open logic
http://sourceforge.net/forum/message.php?msg_id=3411030

The fix was to add guards so the code does not assume w._name exists for all widgets w.
#@+node:ekr.20051109112826.227: *7* (Undo ends editing
#@+node:ekr.20051109112826.257: *7* Disabled minibuffer when not in use
For now, I just set c.useTextMinibuffer = False,
so Leo uses a Tk.Label rather than a Tk.Text widget.

This will cause less confusion than always having the minibuffer enabled.
#@+node:ekr.20051109112826.315: *7* Fixed bug in Find Backward
http://sourceforge.net/forum/message.php?msg_id=3418304

Fixed an edge effect when backward searching for a match that occurs at the very
end of body text. In the process I removed an ancient hack.
#@+node:ekr.20051109112826.265: *7* Improved Spell tab
http://sourceforge.net/forum/message.php?msg_id=3415021

The code now uses the settings in leoSettings.leo.
#@+node:ekr.20051109141524: *6* New features
#@+node:ekr.20051109112826.222: *7* Created scripts.leo and unitTest.leo
Scripts.leo contains general-purpose scripts.

unitTest.leo contains all of Leo's unit tests.

test.leo is now for recent tests.  Its small size speeds up my workflow.
#@+node:ekr.20051109112826.254: *7* c.executeMinibufferCommand executes a minibuffer command by name
http://sourceforge.net/forum/message.php?msg_id=3412644

You can invoke minibuffer commands by name.  For example:

c.executeMinibufferCommand('open-outline')

Note: c.keyHandler.funcReturn contains the value returned from the command. In
many cases, as above, this value is simply 'break'.
#@+node:ekr.20051109112826.310: *7* Improved perl entries in language dicts
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3414639

The entries for Perl and Perlpod are now as follows:

@color

self.language_extension_dict = {
    "perl" : "pl",
    "perlpod" : "pod",
}

self.extension_dict = {
    "pl"    : "perl",
    "pod"   : "perlpod",
}
#@+node:ekr.20051109141524.1: *6* Code-level changes
#@+node:ekr.20051109112826.223: *7* Changed  edit_text to edit_widget everywhere
Changed the following plugins:

cleo.py, footprints.py,__wx_gui.py, zodb.py
#@+node:ekr.20051109112826.224: *7* Removed tree ivars
Removed tree.redrawScheduled, tree.updateCount and tree.disableRedraw

Three major complications are gone.
#@+node:ekr.20051109142920: *7* Removed frame.begin/endUpdate
This code should never have existed.  It was used only in the macro plugin.
#@+node:ekr.20051128181229: *5* New in alpha 4
#@+node:ekr.20051128181351: *6* Bugs fixed
#@+node:ekr.20051128181302.148: *7* Changed scripting plugin so files opened with buttons stay in front
The plugin can not call bodyWantsFocus.
#@+node:ekr.20051128181302.183: *7* Fixed undo/redo bugs
http://sourceforge.net/forum/message.php?msg_id=3434727

- Added calls to c.frame.body.onBodyChanged in cut/paste handlers.

- Added call to c.selectPosition(c.currentPosition()) in undo/redo.
    This is essential because previous calls to c.selectPosition may have had redraw_flag = False.
#@+node:ekr.20051128181302.192: *7* Fixed focus problem with tab completion
#@+node:ekr.20051128181302.193: *7* Fixed minor Save bug
http://sourceforge.net/forum/message.php?msg_id=3425967

When creating a new Leo outline (no leo file created yet), the Save As command
created the file Test4.leo instead of the expected Test4.3.leo
#@+node:ekr.20051128181302.231: *7* Fixed long-standing problem with Plugins Manager plugin
http://sourceforge.net/forum/message.php?msg_id=3442064

This was not, in fact, a problem with the plugins manager plugin.

The bug was in << put up a dialog requiring a valid id >> in app.setLeoID.
The code set g.app.gui to None after calling g.app.gui.runAskLeoIDDialog the code set!

While I was at it, Leo's core now always inits Pmw when creating Tk.Tk. This
removes the necessity for Plugins to do this.
#@+node:ekr.20051128181302.244: *7* Fixed 2 outline editing bugs
1: Outline not marked dirty during editing

https://sourceforge.net/forum/message.php?msg_id=3447570

2: Inserting a headline didn't save previous edits of headlines
#@+node:ekr.20051205090923.13: *7* Fixed crasher in deleteNextChar
#@+node:ekr.20051205090923.16: *7* Fixed new headline bug
http://sourceforge.net/forum/message.php?msg_id=3450435
#@+node:ekr.20051205090923.22: *7* Fix problems applying settings
http://sourceforge.net/forum/message.php?msg_id=3389810
#@+node:ekr.20051128181302.204: *7* Fixed several bugs in rst3 plugin
http://sourceforge.net/forum/message.php?msg_id=3427809

Allowed relative path to stylesheets.

http://sourceforge.net/forum/message.php?msg_id=3433717

The rst3 plugin now traverses the tree as was done previously in the @button rst3 nodes.

http://sourceforge.net/forum/message.php?msg_id=3456419

The rst3 plugin now looks up and down the tree for settings doc parts.

The rst3 plugin now supports the default_path option.
#@+node:ekr.20051128181651: *6* Code changes
Leo 4.4a4 completes the transition to the 'Newer World Order'.
#@+node:ekr.20051128181302.149: *7* Removed later arg from c.frame.xWantsFocus
Later may never come in the Newer World Order, so everything must happen immediately.
#@+node:ekr.20051128181302.196: *7* Created enableTclTraces
#@+node:ekr.20051128181302.208: *7* Eliminated w.update in g.app.gui.set_focus
@nocolor

- The focusIn/Out trace is a great tool.

- doTabCompletion now calls w.update before calling bodyWantsFocus.

- Eliminated w.update from g.app.gui.set_focus.  It is now called only in
those places where it is truly essential, such as in k.doTabCompletion and
wherever else it might be required.

- Pmw.Notebook does a *lot* when it switches panes (e.g., the _layout method)
and potentially any of the things it does could result in focus shifting to
widget. Rather than trying to make sense of it all, Leo will simply call
w.update as necessary to force completion of the Pmw.Notebook work before trying
to set focus.
#@+node:ekr.20051128181651.1: *6* New & improved features and files
#@+node:ekr.20051128181302.147: *7* Moved all scripts into scripts.leo
#@+node:ekr.20051128181302.150: *7* Improved how the New Tab and Rename Tab commands work in the log pane
This ensures that the widget is always visible.
#@+node:ekr.20051128181302.151: *7* Improved the appearance of the Spell tab
#@+node:ekr.20051128181302.156: *7* Added Clone-find checkbox to the Find tab
http://sourceforge.net/forum/message.php?msg_id=3425070

This code was contributed by Roger Erens.

When the Clone Find All checkbox is checked, the Find All command creates a new
root node called Found: <your search pattern>

This node contains clones of the nodes found by the Find All command. It is your
own responsibility to navigate to this new node and to clean it up when it's no
longer needed.
#@+node:ekr.20051128181302.171: *7* Improved find tab
The tab now scrolls properly.
#@+node:ekr.20051128181302.211: *7* Improved formatting of shortcuts in print-commands and print-bindings
#@+node:ekr.20051128181302.213: *7* Added settings for vim plugin
http://sourceforge.net/forum/message.php?msg_id=3440420

Added @string vim_cmd and @string vim_exe settings. The defaults now correspond
to default installations of vim.
#@+node:ekr.20051128181302.214: *7* Put up a dialog if can't import Pmw
http://sourceforge.net/forum/message.php?msg_id=3436726

The dialog warns about the extensions folder not containing Pmw. This can happen
when getting files from cvs.
#@+node:ekr.20051128181302.229: *7* Bound <Return> to end-edit-headline
http://sourceforge.net/forum/message.php?msg_id=3437089

The new default binding causes focus to move to the body pane when the user hits
<Return> to end editing in a headline.
#@+node:ekr.20060116174906: *4* 4.4 beta 1
Leo 4.4 beta 1                                             January 17, 2006

The code is stable; there are no known serious bugs. Some features are
incomplete.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://sourceforge.net/cvs/?group_id=3458
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060116174906.2: *5* Bugs fixed
#@+node:ekr.20060116174906.3: *6* Fixed minor headline problems
A 'backward' delete at the start of a headline deletes the first character.
delete-char did not work in headlines.
#@+node:ekr.20060116174906.63: *6* Fixed undo problems
http://sourceforge.net/forum/message.php?msg_id=3465251
#@+node:ekr.20060116174906.86: *6* Improved word-export plugin
http://sourceforge.net/forum/message.php?msg_id=3495741

The plugin now uses sys.getdefaultencoding() to set the encoding.
#@+node:ekr.20060116174906.87: *6* Removed a bad use of g.app.log in the find panel
This could have been the source of weird find behavior.
#@+node:ekr.20060116174906.88: *6* Fix crash: tab in minibuffer
The fix was to have x.getSelectedText return '' instead of None.
#@+node:ekr.20060116174906.90: *6* Installed patch for headline width
http://sourceforge.net/forum/message.php?msg_id=3510983
#@+node:ekr.20060116174906.97: *6* Redraw screen properly after Move To Next Dirty
#@+node:ekr.20060116174906.100: *6* Fixed focus bug
https://sourceforge.net/forum/message.php?msg_id=3514627

c.endUpdate now restores the previous focus by default.
#@+node:ekr.20060116174906.103: *6* Made sure to bring proper window on top in settings.leo button
#@+node:ekr.20060116174906.104: *6* Arrow keys now clear the text selection
http://sourceforge.net/forum/message.php?msg_id=3514755
#@+node:ekr.20060116174906.113: *6* Fixed several minor bugs
http://sourceforge.net/forum/message.php?msg_id=3515341
#@+node:ekr.20060116174906.118: *6* Fixed problems with plugins
http://sourceforge.net/forum/message.php?msg_id=3509141

Problems with cleo.  Installed patch: http://sourceforge.net/forum/message.php?msg_id=3517080

https://sourceforge.net/forum/message.php?msg_id=3515025

Problems with fastgotonode and and groupOperations.
#@+node:ekr.20060116174906.122: *6* Fixed old file handling bug
http://sourceforge.net/forum/message.php?msg_id=3518722

To generate HTML file I entered the outline header "@file bbb.xml" under which
I put the following body text:

//////////////// beginning of excerpt
@first <?xml version="1.0" encoding="windows-1250" ?>
@language html
@
comment line
@c
@others
//////////////// end of excerpt

This works OK.
But, if I put a space after the sole @ above "comment line",  save and close
the .leo file and then open it, Leo protests in log pane on the right:

//////////////// beginning of excerpt
----- error reading @file: bbb.xml
Missing open block comment
//////////////// end of excerpt
#@+node:ekr.20060116174906.125: *6* Use shutil.move in g.utils_rename
This corrects a problem that shows up as 'Invalid cross-device link' messages on Linux.

http://sourceforge.net/forum/message.php?msg_id=3519803
#@+node:ekr.20060116174906.130: *6* Simplified k.copyBindingsToWidget and eliminated k.onTextWidgetKey
These should be considered bug fixes.

- copyBindingsToWidget now binds keys in priority order. This also simplifies
and clarifies the code.

- Removed k.onTextWidgetKey.  Added a callback that invokes k.masterCommand.
#@+node:ekr.20060116174906.160: *6* Made sure that focus stays in body during tab completion
Hitting Backspace immediately put the focus in the log. Another backspace put
the focus in the body pane.

The problem was in log.clearTab.  It must do call t.update().
#@+node:ekr.20060116174906.163: *6* Leo now puts focus in body pane after deleting a window
#@+node:ekr.20060116174906.164: *6* Fixed many binding problems
#@+node:ekr.20060116174906.185: *6* Fixed extend-selection problems
extensionHelper resets movePoint any time there is no selection.
#@+node:ekr.20060116174906.187: *6* Fixed per-pane bindings!
#@+node:ekr.20060116174906.194: *6* Always redraw the screen after editing a label
The fix was to call endUpdate() rather than endUpdate(changed) in onHeadChanged.
#@+node:ekr.20060116174906.195: *5* Code level changes
#@+node:ekr.20060116174906.198: *6* Removed g.top from Leo's core and all plugins
g.top and the associated g.app.log logic is inherently unreliable.
#@+node:ekr.20060116174906.199: *6* Created c.exists ivar and related logic
This allows code to determine in a standard way whether a window is in the process of being destroyed.
#@+node:ekr.20060116174906.213: *6* Call c.setLog in all entries into code
This includes k.masterCommand and all event handlers.
#@+node:ekr.20060116174906.255: *6* Generalized doCommand
Leo now calls doCommand on all commands, so the 'command' hooks and error
processing always get done.
#@+node:ekr.20060116174906.258: *5* New features
#@+node:ekr.20060116174906.259: *6* Installed many standard bindings to leoSettings.leo
@nocolor
#@+node:ekr.20060116174906.262: *6* Added Check Bindings script in leoSettings.leo
#@+node:ekr.20060116174906.263: *6* Scripts now maintain original focus
http://sourceforge.net/forum/message.php?msg_id=3518792

EKR: The change in focus happened in c.endEditing in at.writeFromString.

I added a new restoreFocus keyword arg to c.endEditing.
#@+node:ekr.20060116174906.267: *6* Added scroll-up/down-extend-selection commands
#@+node:ekr.20060116174906.272: *6* Improved cursor move/extend commands
http://sourceforge.net/forum/message.php?msg_id=3515616

Could we have a visible-line-up and visible-line-down command? (I.e. to move
the cursor up or down by a visible rather than a logical line).  With these
commands, the arrows plugin could be permanently retired!

What I did:

- next-line and prev-line now work as requested.  This obsoletes the arrow plugin.
    - Removed the redundant tree.OnUpKey and tree.OnDownKey
    - Retired the arrows plugin.

- Created the extendHelper method.
    This creates and maintains the moveSpot, moveCol an moveSpotNode ivars,
    and is responsible for extending the selection range.
#@+node:ekr.20060116174906.296: *6* Added support for @mode nodes
Still to do:

Specify what mode to enter after each command:

- command-name -> mode-name = binding

will specify what mode to enter after each command.
At present, all commands exit to the top-level mode.

- Add @string active-keyset setting?
#@+node:ekr.20060116174906.306: *6* keyboard-quit restores default input mode
#@+node:ekr.20060116174906.257: *5* Added discusion to FAQ about when deleting a node is 'dangerous'
#@+node:ekr.20060111192108: *6* When is deleting a node dangerous?
A **dangerous** delete is a deletion of a node so that all the data in the node
is deleted *everywhere* in an outline. The data is gone, to be retrieved only
via undo or via backups. It may not be obvious which deletes are dangerous in an
outline containing clones. Happily, there is a very simple rule of thumb::

    Deleting a non-cloned node is *always* dangerous.
    Deleting a cloned node is *never* dangerous.

We could also consider a delete to be dangerous **if it results in a node being
omitted from an external file.** This can happen as follows. Suppose we have the
following outline (As usual, A' indicates that A is marked with a clone mark)::

    - @file spam.py
        - A'
            - B
    - Projects
        - A'
            - B

Now suppose we clone B, and move the clone so the tree looks like this::

    - @file spam.py
        - A'
            - B'
    - Projects
        - A'
            - B'
        - B'

If (maybe much later), we eliminate B' as a child of A will get::

    - @file spam.py
        - A'
    - Projects
        - A'
        - B

B has not been destroyed, but B is gone from @file spam.py! So in this sense deleting a clone node can also be called dangerous.
#@+node:ekr.20060206111508: *4* 4.4 beta 2
Leo 4.4 beta 2                                              February 14, 2006

This version fixes dozens of bugs, improves performance and polishes the user
interface. The code is stable; there are no known serious bugs.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4b2:
----------------------------
- Much better 'fit and finishes'.
- New commands that support mouseless Leo.
- Minibuffer search commands provide all features of Leo's legacy search commands.
- User modes are fully functional and you can create special bindings for the minibuffer.
- New master key and click handlers and improved allocation of screen widgets.

Coming in Leo 4.4b3:
--------------------
- A revived chapters plugin.
- Autocompleter Tab.
- Improved incremental searches.

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://sourceforge.net/cvs/?group_id=3458
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060206111508.2: *5* Bugs fixed
#@+node:ekr.20060206111508.3: *6* Fixed crasher in Save button
@nocolor

Must check for c.exists in c.executeScript after executing the script.
#@+node:ekr.20060206111508.4: *6* Fixed minor bugs & made minor improvements
@nocolor

- keyboard-quit now ends editing.

- print-bindings shows plain keys only in 'ignore' mode.

- Removed k.add_ekr_altx_commands and k.makeHardBindings.

- Added binding to vim plain shortcuts: mode-help = h

- Print the initial mode when first creating a window.
  The change had to be made in g.openWithFileName because of the UNL plugin.

- Improved print-bindings & mode help.

- endMode retains the widget on entry, so e.g., inserting a new node retaining the headline editing state.

@color
#@+node:ekr.20060206111508.5: *7* Fixed two annoying headline glitches
@nocolor

- Added initialClickExpandsOrContractsNode settings.  Clicking an node expands or contracts the node if this setting is True.  EKR much prefers False. 

- Selecting a headline should not select text in it.

@color
#@+node:ekr.20060206111508.14: *7* Insert headline didn't redraw headline properly in vim mode
@nocolor

What I did:

- endMode must not change focus.

- modeHelp calls c.endEditing(retainFocus=True)

@color
#@+node:ekr.20060206111508.40: *7* Improved printBindings, printCommands & modeHelp
#@+node:ekr.20060206111508.48: *6* Fixed crasher re BackSpace in log window

#@+node:ekr.20060206111508.49: *6* Fixed crashers in cut/copy/paste commands
Traceback (most recent call last):

  File "c:\prog\leoCVS\leo\src\leoCommands.py", line 250, in doCommand
    val = command() # Call legacy command

  File "C:\prog\leoCVS\leo\src\leoTkinterFrame.py", line 1777, in cutText
    oldText = w.get('1.0','end')

AttributeError: Canvas instance has no attribute 'get'
#@+node:ekr.20060206111508.54: *6* Fixed crasher when clicking the close box during a long command
#@+node:ekr.20060206111508.58: *6* cloneFindAll now honor present find settings
#@+node:ekr.20060206111508.63: *6* Double-click didn't work in the body pane.
#@+node:ekr.20060206111508.74: *6* Improved body.makeInsertPointVisible
Call w.see('insert'), not w.see('insert-5L')
#@+node:ekr.20060206111508.75: *6* Fixed cut/copy/paste from menu
#@+node:ekr.20060206111508.553: *6* Fixed major blunder: tree.onHeadChanged sets focus only if there was a real change
#@+node:ekr.20060206111508.97: *6* Disabled plain-key bindings in insert/overwrite modes
#@+node:ekr.20060206111508.103: *6* Disabled auto-scrolling in outline pane on clicks
The outline jumps around too much when expanding/contracting nodes
#@+node:ekr.20060206111508.136: *6* move-outline and find commands force a screen scroll
# This is required now that scrolling is disabled by default.
#@+node:ekr.20060211104746.2: *6* Fixed undo problem in headlines
In the new drawing scheme, tree.redraw_now always calls c.endEditing, which
calls tree.onHeadChanged. The effect of this was to reverse the action of
undo/redoNodeContents.

The solution was to change the edit widget directly before calling
tree.redraw_now. To do this, I created the new tree.setHeadline method.
#@+node:ekr.20060214085054: *6* Found the cause of 'sticking focus' problem
The problem with focus 'sticking' in the Pmw.Notebook was due to a call to
bringToFront. Apparently, the side effect was to assign a focus to the widget
that had it previously. This makes sense, and can not be considered a Tk bug.

Remove almost all calls to w.update in Leo.

No more calls to w.after that were used to draw the status line. The master key
and click handlers now call the label update method directly. This may ease a
major stress on Tk.
#@+node:ekr.20060211104746.162: *6* Fixed tree icon bug
Backspace in empty body text sometimes moved focus to canvas, and sometimes
improperly drew icon.

Made several fixes to onBodyChanged. There was no test for unchanged text! This
could have created all sorts of problems for undo.
#@+node:ekr.20060211104746.177: *6* Set remembered column properly in prev-line and next-line
http://sourceforge.net/forum/message.php?msg_id=3549737

for extend selection,
with binding to arrow keys,
if you switch from up to down arrow,
the selection restarts again.
this should just change extend direction
while still using the same selection.
#@+node:ekr.20060211104746.208: *6* Fixed focus problems in spell tab
#@+node:ekr.20060214074035.9: *6* Fixed problem with body_gmt_time setting
http://sourceforge.net/forum/message.php?msg_id=3549737

The fix was to call getBool rather than getString.
#@+node:ekr.20060214074035.20: *6* Made sure save updates the open directory
http://sourceforge.net/forum/message.php?msg_id=3534349
By: edcdave

Saving the Leo file is not sufficient - I have to exit the document and open
it again before the rst destination directory is set correctly.

The fix was to set c.frame.openDirectory in save.
#@+node:ekr.20060214074035.41: *6* Fixed sort-lines problems
The problem: event.widget is the minibuffer.  It must be the body text.

- k.fullCommand saves the initial event and passes it on to callAltXFunction.

- There was a bug in c.masterFocusHandler.  The correct test for 'no change' is:

    if c.hasFocusWidget and c.requestedFocusWidget == c.hasFocusWidget:

** Important: the 'extra' calls to set_focus are correct. The minibuffer messes
with the tab pane, and so we *must* be careful to yank the focus back to the
body.
#@+node:ekr.20060214074035.101: *6* Fixed bug: paste outline lost headline editing
#@+node:ekr.20060206111508.547: *5* Code improvements
- Replaced frame.xWantsFocus with c.xWantsFocus.
- Added event arg to all legacy commands.
- Replaced k.tkBindingFromSetting by k.shortcutFromSetting.
- Replaced k.canonicalizeShortcut by k.shortcutFromSetting.
- Replaced k.bindShortcut with bindKey.
- k.makeBindingsFromCommandsDict does not call k.bindKey for mode bindings.
- Call update_idletasks when writing to the log.
- Updated selection point immediately in masterKeyHandler.
  Otherwise, updateStatusLine would be one click behind.
#@+node:ekr.20060206111508.550: *6* Removed code in c.begin/EndUpdate and c.endEditLabel that tried to save/restore focus
@nocolor

This is logically and practically dubious.
True, a screen redraw shouldn't mess with the focus,
but there are the following problems:

1. c.endUpdate can happen anytime, and it could interfere with other efforts to set focus.
2. g.app.get_focus might get the 'wrong' or a 'bad' focus.
#@+node:ekr.20060206111508.596: *6* Improved tree allocation
A *major* improvement to the tree allocation code:

1.  Use p.key() to as keys to tree.visibleText.
 This greatly speeds up tree.findEditWidget

2. Eliminated the brain-dead requirement that previously-allocated widgets must match the position.
   - The allocation code just gets *any* previously allocated widget.
     This eliminates an n**2 search!
   - The ancient problem was that theId refers to the *window* not its Text widget:
     the *window* must be moved to the right spot.

3. recycleWidgets is simpler and a bit faster.

4. destroyWidgets now works: (the bug was not clearing tree.ids).
#@+node:ekr.20060211104746.12: *6* Created c.masterFocusHandler
* Found the reason why focus was *still* sticking in the outline pane:
    - The click handlers must return 'break', not continue.
    - However, OnActivateHeadline must return 'continue' when the headline is active
      so that Tk will handle the click properly.

- UNL does not seem to be causing problems.

- No need to save/restore focus in status line.

- Added several new traces to tkTree class.

* tree.redraw_now now ends editing properly. This fixes lots of bugs. In
particular, it avoid any chance that p.edit_widget won't correspond to the
present position.

- k.masterClickHandler calls tree.OnDeactivate() if there is no callback function.
  This solves most headline focus problems, provided that all panes bind clicks to k.masterClickHandler.

- toggle-active-pane now ends editing properly.

- insert-headline now calls c.editPosition after calling c.endUpdate().
#@+node:ekr.20060211104746.168: *6* Added unit tests for key dicts
@ This revealed several problems:

- Most find dialog commands do not actually exist. All find commands except
open-find-dialog actual refer to the find tab.

- Several other minor shortcut problems.
#@+node:ekr.20060211104746.346: *6* Special-cased commands for minibuffer
select-all-text, move back/forward line/char, start/end-of-line.
#@+node:ekr.20060214074035.6: *6* Made sure yield works with Python 2.2
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3549737

\src\leoEditCommands.py:340: 
Warning: 'yield' will become a reserved keyword 

for python2.2 leoEditCommands.py needs
from __future__ import generators

Also changed the following plugins:

at_produce.py
fastGotoNode.py
rst3.py
zodb.py
#@+node:ekr.20060214074035.12: *6* Use os.getenv('User") if it exists to get initial cvs name
http://sourceforge.net/forum/message.php?msg_id=3237845

On startup, it asked me for a unique id, "possibly your CVS username".
As a non-windows-user, that made no sense at all to me - at very least, it should
fill in os.getenv("USER") as a default, because it's right on non-windows systems,
isn't it?  (If it isn't, there's no explanation at that point that would tell
me otherwise, that's the value I used anyway...)  Just an out-of-box-experience
issue.
#@+node:ekr.20060206112001: *5* Improved commands
- Improved format of print-commands and print-bindings commands.

- Eliminated clone-find-all, selection-only, show-context checkboxes
  when show_only_find_tab_options setting is True.

- All minibuffer find commands copy the find string from the Find tab into the minibuffer.

- The replace-string command sets up arguments for Tab find. This is different
  from the normal Emacs replace-string command, but it works well in Leo.

- Leo doesn't abort the minibuffer if the command does not exist.
  This is much more convenient.
#@+node:ekr.20060212102459.4: *6* Minibuffer-oriented find commands
All minibuffer search commands, with the exception of the isearch (incremental) commands, simply provide a minibuffer interface to Leo's legacy find commands.  This means that all the powerful features of Leo's legacy commands are available to the minibuffer search commands.

Note: all bindings shown are the default bindings for these commands.  You may change any of these bindings using @shortcuts nodes in leoSettings.leo.

Settings

leoSettings.leo now contains several settings related to the Find tab:

- @bool show_only_find_tab_options = True

When True (recommended), the Find tab does not show the 'Find', 'Change', 'Change, Then Find', 'Find All' and 'Change All' buttons.

- @bool minibufferSearchesShowFindTab = True

When True, Leo shows the Find tab when executing most of the commands discussed below.  It's not necessary for it to be visible, but I think it provides good feedback about what search-with-present-options does.  YMMY.  When True, the sequence Control-F, Control-G is one way to show the Find Tab.

Basic find commands

- The open-find-tab command makes the Find tab visible.  The Find tab does **not** need to be visible to execute any search command discussed below.

- The hide-find-tab commands hides the Find tab, but retains all the present settings.

- The search-with-present-options command (Control-F) prompts for a search string.  Typing the <Return> key puts the search string in the Find tab and executes a search based on all the settings in the Find tab.   This command is my 'workhorse' search command.

- The show-search-options command shows the present search options in the status line.  At present, this command also shows the Find tab.

Search again commands

- The find-tab-find command (F3) is the same as the search-with-present-options command, except that it uses the search string in the find-tab.  This is what I use as my default 'search again' command.

- Similarly, the find-tab-find-previous command (F2) repeats the command specified by the Find tab, but in reverse.

- The find-again command a combination of the search-with-present-options and find-tab-find command.  It is the same as the find-tab-find command if a search pattern other than '<find pattern here>' exists in the Find tab.  Otherwise, the find-again is the same as the search-with-present-options command.

Setting find options

- Several minibuffer commands toggle the checkboxes and radio buttons in the Find tab, and thus affect the operation of the search-with-present-options command. Some may want to bind these commands to keys. Others, will prefer to toggle options in a mode.


Here are the commands that toggle checkboxes: toggle-find-ignore-case-option, toggle-find-in-body-option, toggle-find-in-headline-option, toggle-find-mark-changes-option, toggle-find-mark-finds-option, toggle-find-regex-option, toggle-find-reverse-option, toggle-find-word-option, and toggle-find-wrap-around-option.

Here are the commands that set radio buttons: set-find-everywhere, set-find-node-only, and set-find-suboutline-only.

- The enter-find-options-mode (Ctrl-Shift-F) enters a mode in which you may change all checkboxes and radio buttons in the Find tab with plain keys.  As always, you can use the mode-help (Tab) command to see a list of key bindings in effect for the mode.

Search commands that set options as a side effect

The following commands set an option in the Find tab, then work exactly like the search-with-present-options command.

- The search-backward and search-forward commands set the 'Whole Word' checkbox to False.

- The word-search-backward and word-search-forward set the 'Whole Word' checkbox to True.

- The re-search-forward and re-search-backward set the 'Regexp' checkbox to True.

Find all commands

- The find-all command prints all matches in the log pane.

- The clone-find-all command replaces the previous 'Clone Find' checkbox.  It prints all matches in the log pane, and creates a node at the beginning of the outline containing clones of all nodes containing the 'find' string.  Only one clone is made of each node, regardless of how many clones the node has, or of how many matches are found in each node.

Note: the radio buttons in the Find tab (Entire Outline, Suboutline Only and Node only) control how much of the outline is affected by the find-all and clone-find-all commands.

Search and replace commands

The replace-string prompts for a search string.  Type <Return> to end the search string.  The command will then prompt for the replacement string.  Typing a second <Return> key will place both strings in the Find tab and executes a **find** command, that is, the search-with-present-options command.

So the only difference between the replace-string and search-with-present-options commands is that the replace-string command has the side effect of setting 'change' string in the Find tab.  However, this is an extremely useful side effect, because of the following commands...

- The find-tab-change command (Ctrl-=) replaces the selected text with the 'change' text in the Find tab.

- The find-tab-change-then-find (Ctrl--) replaces the selected text with the 'change' text in the Find tab, then executes the find command again.

The find-tab-find, find-tab-change and find-tab-change-then-find commands can simulate any kind of query-replace command.  **Important**: Leo presently has separate query-replace and query-replace-regex commands, but they are buggy and 'under-powered'.  Fixing these commands has low priority.

- The find-tab-change-all command changes all occurrences of the 'find' text with the 'change' text.  Important: the radio buttons in the Find tab (Entire Outline, Suboutline Only and Node only) control how much of the outline is affected by this command.

Incremental search commands

Leo's incremental search commands are completely separate from Leo's legacy search commands.  At present, incremental search commands do not cross node boundaries: they work only in the body text of single node.

Coming in Leo 4.4b3: the incremental commands will maintain a list of previous matches.  This allows for

a) support for backspace and
b) an incremental-search-again command.

Furthermore, this list makes it easy to detect the end of a wrapped incremental search.

Here is the list of incremental find commands: isearch-backward, isearch-backward-regexp, isearch-forward and
isearch-forward-regexp.'''
#@+node:ekr.20060214074035.67: *6* Leo remembers the previous open directory
http://sourceforge.net/forum/message.php?msg_id=3571431
By: ktenney

To reiterate a request:

When doing File->Open the default directory should the directory which
was navigated to for previous 'Open'

What I did:

- Defined g.app.globalOpenDir # The directory last used to open a file.
#@+node:ekr.20060214090742: *5* Improved plugins
#@+node:ekr.20060214074035.65: *6* Fixed problem with view plugin
http://sourceforge.net/forum/message.php?msg_id=3538274

It's not clear that there were serious problems with the plugin, but I improved the code and error messages.  All features work for me.

Several plugins use the icon-double-click hook.  The reported problems could have been due to plugin conflicts.
#@+node:ekr.20060214074035.66: *6* Installed cleo patch
http://sourceforge.net/forum/message.php?msg_id=3517080
#@+node:ekr.20060214083808: *5* New commands
Debugging commands:

- dump-all-objects, ump-new-objects, verbose-dump-objects.
- free-text-widgets.

Find commands:

See the child of this node for details.

- find-again.
- find-all and clone-find-all.
- find-tab-find command, find-tab-find-previous.
- find-tab-change, find-tab-change-all, find-tab-change-then-find.
- hide-find-tab, open-find-tab.
- re-search-forward and re-search-backward.
- replace-string.
- search-with-present-options.
- search-backward and search-forward.
- show-search-options.
- word-search-backward and word-search-forward.

Search options:

- set-find-everywhere, set-find-node-only, and set-find-suboutline-only.
- toggle-find-ignore-case-option, toggle-find-in-body-option,
  toggle-find-in-headline-option, toggle-find-mark-changes-option,
  toggle-find-mark-finds-option, toggle-find-regex-option,
  toggle-find-reverse-option, toggle-find-word-option, 
  toggle-find-wrap-around-option.

Mouseless Leo:

- activate-cmds-menu, activate-edit-menu, activate-file-menu activate-help-menu,
  activate-outline-menu, activate-plugins-menu, activate-window-menu.
- contract-body-pane, contract-log-pane, contract-outline-pane, contract-pane.
- expand-body-pane, expand-log-pane, expand-outline-pane, expand-pane.
- fully-expand-body-pane, fully-expand-log-pane, fully-expand-outline-pane, fully-expand-pane.
- hide-body-pane, hide-log-pane, hide-outline-pane, hide-pane.
- click-click-box, click-headline, click-icon-box, double-click-headline,
  double-click-icon-box, simulate-begin-drag, simulate-end-drag.
  (These commands trigger event hooks. In particular, double-click-icon-box will
  invoke the vim or xemacs plugins if they are enabled.)
#@+node:ekr.20060212102459.4: *6* Minibuffer-oriented find commands
All minibuffer search commands, with the exception of the isearch (incremental) commands, simply provide a minibuffer interface to Leo's legacy find commands.  This means that all the powerful features of Leo's legacy commands are available to the minibuffer search commands.

Note: all bindings shown are the default bindings for these commands.  You may change any of these bindings using @shortcuts nodes in leoSettings.leo.

Settings

leoSettings.leo now contains several settings related to the Find tab:

- @bool show_only_find_tab_options = True

When True (recommended), the Find tab does not show the 'Find', 'Change', 'Change, Then Find', 'Find All' and 'Change All' buttons.

- @bool minibufferSearchesShowFindTab = True

When True, Leo shows the Find tab when executing most of the commands discussed below.  It's not necessary for it to be visible, but I think it provides good feedback about what search-with-present-options does.  YMMY.  When True, the sequence Control-F, Control-G is one way to show the Find Tab.

Basic find commands

- The open-find-tab command makes the Find tab visible.  The Find tab does **not** need to be visible to execute any search command discussed below.

- The hide-find-tab commands hides the Find tab, but retains all the present settings.

- The search-with-present-options command (Control-F) prompts for a search string.  Typing the <Return> key puts the search string in the Find tab and executes a search based on all the settings in the Find tab.   This command is my 'workhorse' search command.

- The show-search-options command shows the present search options in the status line.  At present, this command also shows the Find tab.

Search again commands

- The find-tab-find command (F3) is the same as the search-with-present-options command, except that it uses the search string in the find-tab.  This is what I use as my default 'search again' command.

- Similarly, the find-tab-find-previous command (F2) repeats the command specified by the Find tab, but in reverse.

- The find-again command a combination of the search-with-present-options and find-tab-find command.  It is the same as the find-tab-find command if a search pattern other than '<find pattern here>' exists in the Find tab.  Otherwise, the find-again is the same as the search-with-present-options command.

Setting find options

- Several minibuffer commands toggle the checkboxes and radio buttons in the Find tab, and thus affect the operation of the search-with-present-options command. Some may want to bind these commands to keys. Others, will prefer to toggle options in a mode.


Here are the commands that toggle checkboxes: toggle-find-ignore-case-option, toggle-find-in-body-option, toggle-find-in-headline-option, toggle-find-mark-changes-option, toggle-find-mark-finds-option, toggle-find-regex-option, toggle-find-reverse-option, toggle-find-word-option, and toggle-find-wrap-around-option.

Here are the commands that set radio buttons: set-find-everywhere, set-find-node-only, and set-find-suboutline-only.

- The enter-find-options-mode (Ctrl-Shift-F) enters a mode in which you may change all checkboxes and radio buttons in the Find tab with plain keys.  As always, you can use the mode-help (Tab) command to see a list of key bindings in effect for the mode.

Search commands that set options as a side effect

The following commands set an option in the Find tab, then work exactly like the search-with-present-options command.

- The search-backward and search-forward commands set the 'Whole Word' checkbox to False.

- The word-search-backward and word-search-forward set the 'Whole Word' checkbox to True.

- The re-search-forward and re-search-backward set the 'Regexp' checkbox to True.

Find all commands

- The find-all command prints all matches in the log pane.

- The clone-find-all command replaces the previous 'Clone Find' checkbox.  It prints all matches in the log pane, and creates a node at the beginning of the outline containing clones of all nodes containing the 'find' string.  Only one clone is made of each node, regardless of how many clones the node has, or of how many matches are found in each node.

Note: the radio buttons in the Find tab (Entire Outline, Suboutline Only and Node only) control how much of the outline is affected by the find-all and clone-find-all commands.

Search and replace commands

The replace-string prompts for a search string.  Type <Return> to end the search string.  The command will then prompt for the replacement string.  Typing a second <Return> key will place both strings in the Find tab and executes a **find** command, that is, the search-with-present-options command.

So the only difference between the replace-string and search-with-present-options commands is that the replace-string command has the side effect of setting 'change' string in the Find tab.  However, this is an extremely useful side effect, because of the following commands...

- The find-tab-change command (Ctrl-=) replaces the selected text with the 'change' text in the Find tab.

- The find-tab-change-then-find (Ctrl--) replaces the selected text with the 'change' text in the Find tab, then executes the find command again.

The find-tab-find, find-tab-change and find-tab-change-then-find commands can simulate any kind of query-replace command.  **Important**: Leo presently has separate query-replace and query-replace-regex commands, but they are buggy and 'under-powered'.  Fixing these commands has low priority.

- The find-tab-change-all command changes all occurrences of the 'find' text with the 'change' text.  Important: the radio buttons in the Find tab (Entire Outline, Suboutline Only and Node only) control how much of the outline is affected by this command.

Incremental search commands

Leo's incremental search commands are completely separate from Leo's legacy search commands.  At present, incremental search commands do not cross node boundaries: they work only in the body text of single node.

Coming in Leo 4.4b3: the incremental commands will maintain a list of previous matches.  This allows for

a) support for backspace and
b) an incremental-search-again command.

Furthermore, this list makes it easy to detect the end of a wrapped incremental search.

Here is the list of incremental find commands: isearch-backward, isearch-backward-regexp, isearch-forward and
isearch-forward-regexp.'''
#@+node:ekr.20060214083647: *5* New settings
New settings:

- @int max_undo_stack_size
- @bool minibufferSearchesShowFindTab
- @bool show_only_find_tab_options

New debugging settings:

@bool allow_idle_time_hook
@bool gc_before_redraw
@bool show_tree_stats
@bool trace_bindings
@bool trace_doCommand
@bool trace_f.set_focus
@bool trace_focus = False
@bool trace_g.app.gui.set_focus
@bool trace_gc
@bool trace_gc_calls
@bool trace_gc_verbose
@bool trace_masterClickHandler
@bool trace_masterCommand
@bool trace_masterFocusHandler
@bool trace_masterKeyHandler
@bool trace_modes
@bool trace_redraw_now
@bool trace_select
@bool trace_tree
@bool trace_tree_alloc
@bool trace_tree_edit
@bool use_syntax_coloring
@string trace_bindings_filter
@string trace_bindings_pane_filter
#@+node:ekr.20060214092741: *5* User input modes
- @mode nodes in leoSettings.leo allow you to specify input modes with separate key bindings.

See the child of this node for full details.

- All key bindings specified with !mini pane specifier apply to all modes.

#@+node:ekr.20060215112429: *4* 4.4 experimental 1
Leo 4.4 experimental 1                                      February 15, 2006

This version is an emergency measure.  It's goals:

1.  To fix some of the key-handling issues in Leo 4.4 b2.
2.  To allow further experimentation with key handling.
3.  To allow easy reporting of any other key handling problems.

Please do not use this version (or Leo 4.4b2) unless you are ready to report bugs.

My apologies for the key handling problems in Leo 4.4 b2.  I hope this version will
be all that is necessary to fix those problems.

Here are the details of the key-handling changes:

- Added support for trace_key_event setting.
- Added support for ignore_caps_lock setting.
- Added Caps_Lock and Num_Lock to k.tkNamesList and in the list of
  special keys in k.masterCommand and k.masterKeyHandlerHelper.
- Added support for k.ignore_unbound_non_ascii_keys logic in masterKeyHandlerHelper.
- Disabled unknown keysym trace in k.strokeFromEvent.
- Enabled the international keyboard on XP as an aid to testing.
- Added support for swap_mac_keys setting in k.shortcutFromSetting.
#@+node:ekr.20060215112429.9: *5* Fixed (maybe) problems with unicode characters & caps lock
http://sourceforge.net/forum/message.php?msg_id=3573470

What I did:

- Added support for trace_key_event setting.
- Added support for ignore_caps_lock setting.
- Added Caps_Lock and Num_Lock to k.tkNamesList and in the list of
  special keys in k.masterCommand and k.masterKeyHandlerHelper.
- Added support for k.ignore_unbound_non_ascii_keys logic in masterKeyHandlerHelper.
- Disabled unknown keysym trace in k.strokeFromEvent.
- Enabled the international keyboard on XP as an aid to testing.
- Added support for swap_mac_keys setting in k.shortcutFromSetting.
#@+node:ekr.20060215112429.2: *5* Restored some legacy bindings
extract                             = Shift-Ctrl-D
extract-names                       = Shift-Ctrl-N
extract-section                     = Shift-Ctrl-S  # Shift-Ctrl-E: end-of-line-extend-selection

write-at-file-nodes                 = Shift-Ctrl-W # Was enter-file-mode.
write-dirty-at-file-nodes           = Shift+Ctrl+Q

# Removed definitions of find and file modes.  I never used them.
#@+node:ekr.20060215112429.3: *5* Fixed crasher in Go To Line command
http://sourceforge.net/forum/message.php?msg_id=3545403
#@+node:ekr.20060215112429.6: *5* Fixed menu problem on Linux
The patch was reported at:

http://sourceforge.net/forum/message.php?msg_id=3577681
#@+node:ekr.20060217071505: *4* 4.4 a6
Leo 4.4 alpha 6                                         February 17, 2006

Leo 4.4 b2 was broken on some platforms.  Leo 4.4 a6 should fix those problems
forever.  However, only wider distribution will verify that for certain.

Besides fixing the fatal problems with Leo 4.4b2, this version fixes two minor bugs
and adds some new settings in leoSettings.leo.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4 b2 and a6:
----------------------------
- Smoother user interface.
- New commands that support mouseless Leo.
- Minibuffer search commands provide all features of Leo's legacy search commands.
- User modes are fully functional; you can create special bindings for the minibuffer.
- New master key and click handlers and improved allocation of screen widgets.

Coming in Leo 4.4b3:
--------------------
- A revived chapters plugin.
- Autocompleter Tab.
- Improved incremental searches.

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://sourceforge.net/cvs/?group_id=3458
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060217071505.1: *5* Fixed urgent compatibility problems
The new scheme binds to keystrokes, not commands.  This should be as portable
and robust as all previous versions (except b2, which was broken).

- Created k.completeAllBindings, called last in k.makeAllBindings. This binds
all keystrokes in k.bindingsDict to k.masterKeyHandler with an optional stroke
argument. This allows k.masterKeyhandler to dispense with the problematic call
to k.strokeFromEvent. This is all that is really required. 

- Added code to menu.createMenuEntries that clears the accelerator on MacOS for
any key that isn't a control, alt or command key. This solves the recurring
problems with the Return key. The only effect is that the menu won't mention a
binding that is actually in effect, but apparently that cannot be helped.

- Added g.safeCompareStrings, which may, or may not, fix the crasher when
comparing k.abortAllModesKey to the incoming keystroke in k.masterKeyHandler.
It's a bit tricky to test.

- The ignore_caps_lock is no longer functional. Sigh. This depends on knowing
the Caps_Lock bit in key events. I may put this back later, but I can't delay a6
even a minute for this.
#@+node:ekr.20060217072324: *5* Minor bugs fixed
- Fixed crasher in k.masterCommand.

- Arrow keys no longer destroy UNL line
#@+node:ekr.20060217072647: *5* New debugging options in leoSettings.leo
- @bool trace_autocompleter # The autocompleter itself is not ready yet.
- @bool trace_key_event
- @bool trace_minibuffer
- @bool trace_status_line
#@+node:ekr.20060227102028: *4* 4.4 a7
Leo 4.4 alpha 7                                             February 28, 2006

This version fixes some minor problems with Leo 4.4a6 and adds autocompletion
and calltips.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Autocompletion and calltips.  Autocompletion works much like tab completion.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://sourceforge.net/cvs/?group_id=3458
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060227102028.2: *5* Bugs Fixed
#@+node:ekr.20060227102028.3: *6* Fixed binding bug
# http://sourceforge.net/forum/message.php?msg_id=3583335
#@+node:ekr.20060227102028.14: *6* Fixed bug in open-find-dialog
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3586962
By: bwmulder

the open-find-dialog is broken. 

Error: 4 
TypeError Exception in Tk callback 
Function: <function findButtonCallback at 0x04E219F0> (type: <type 'function'>) 
Args: () 
Traceback (innermost last): 
File "C:\Python24\lib\site-packages\Pmw\Pmw_1_2\lib\PmwBase.py", line 1747, in __call__ 
return apply(self.func, args) 
TypeError: findButtonCallback() takes at least 1 argument (0 given) 
#@+node:ekr.20060227102028.15: *6* Ensure dialogs properly get focus
#@+node:ekr.20060227102028.16: *6* Disabled autocompleter in headlines
# This was causing problems.  It may be an easy fix, but I kinda doubt it.
#@+node:ekr.20060227102028.17: *6* Removed horrible g.app.dialogs hack

#@+node:ekr.20060227102028.18: *6* Fix crasher in plugin
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3597694
By: tfer

Template Plug-in (maybe others too) co,plain when activated:
exception executing command
Traceback (most recent call last):
  File "leoCommands.py", line 265, in doCommand
    val = command(event)
  File "c:\Leo_Cvs\Leo\plugins\plugins_menu.py", line 350, in about
    PluginAbout(self.name, self.version, self.doc)
  File "c:\Leo_Cvs\Leo\plugins\plugins_menu.py", line 576, in __init__
    g.app.dialogs += 1
AttributeError: LeoApp instance has no attribute 'dialogs'
#@+node:ekr.20060328171518: *4* 4.4 b3
Leo 4.4 beta 3                                             April 14, 2006

This version fixes some minor problems and adds various features.  This code
has been in use for several weeks without any major problems reported.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Autocompletion and calltips.  Autocompletion works much like tab completion.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://sourceforge.net/cvs/?group_id=3458
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060328171518.1: *5* New features
#@+node:ekr.20060328171518.10: *6* Added scroll outline pane commands
http://sourceforge.net/forum/message.php?msg_id=3608246

Added the following commands:

scroll-outline-down-line       
scroll-outline-down-page       
scroll-outline-up-line       
scroll-outline-up-page
#@+node:ekr.20060328171518.11: *6* Improved registerCommand
It now properly creates bindings.
#@+node:ekr.20060328171518.15: *6* Suppressed autocompletion after numbers
#@+node:ekr.20060328171518.16: *6* Added colorizing support for Lua language
http://sourceforge.net/forum/message.php?msg_id=3572598
#@+node:ekr.20060328171518.45: *6* Added run-unit-test command
This is equivalent to the Unit Test script button in unitTest.leo
#@+node:ekr.20060328171518.47: *5* Bugs
#@+node:ekr.20060328171518.48: *6* Fixed problem with left & right arrows in outline mode
http://sourceforge.net/forum/message.php?msg_id=3619340

Just tried out CVS today, and on Linux left/right and L/R in outline mode
(Ctrl-Shift-O) seem to do nothing, whereas they should expand/contract parent
nodes.
#@+node:ekr.20060328171518.57: *6* Fixed undo problem with clones
http://sourceforge.net/forum/message.php?msg_id=3639193

The dirty bits were not updated properly in several undo/redo operations.
#@+node:ekr.20060328171518.83: *6* Investigated setting descendant @file nodes dirty when changing body text
http://sourceforge.net/forum/message.php?msg_id=3642892

The present code is probably the best compromise between strict accuracy and marking too many nodes dirty.
#@+node:ekr.20060328171518.85: *6* Work around newline problems on the Mac
http://sourceforge.net/forum/message.php?msg_id=3606515

Added insert-newline command and fixed some related commands.
#@+node:ekr.20060328171518.101: *6* Got rid of settings messages
Apparently g.app.unitTesting isn't set properly for the new-window test.
#@+node:ekr.20060328171518.108: *6* Clicks outside minibuffer no longer rip focus
The bug: Hit control-f, then select the text that doesn't have focus.
#@+node:ekr.20060328171518.111: *6* Handled missing leoSettings.leo files more gracefully
http://sourceforge.net/forum/message.php?msg_id=3641107

ConfigSettings.initEncoding now uses the g.app.config settings if no other settings are available.

In particular, this causes at.encoding to be inited to a reasonable value.
#@+node:ekr.20060328171518.119: *6* Converted all shortcuts to unicode
- onBodyChanged now converts everything to unicode, either directly or by calling g.app.gui.getAllText.

- Replaced all calls to g.safeStringCompare by g.app.gui.getAllText which calls g.toUnicode.

- Converted all shortcuts to unicode in shortcutFromSetting (a.k.a strokeFromSetting)

- Removed g.safeStringCompare.  This function was a bad idea.

Important: Leo is supposed to convert all characters to unicode, so there should
never be a need for safeStringCompare. The proper way to avoid UnicodeError's is
to call g.toUnicode(s,g.app.tkEncoding).
#@+node:ekr.20060328171518.135: *6* Made Open With shortcuts work again
http://sourceforge.net/forum/message.php?msg_id=3607355
#@+node:ekr.20060328171518.151: *6* Made sure autocompleter and calltip text stick
#@+node:ekr.20060328171518.152: *6* Fixed a bug in c.openWith
http://sourceforge.net/forum/message.php?msg_id=3573148

c.openWith now calls g.enableIdleTimeHook
#@+node:ekr.20060328171518.169: *6* Import/export commands now set directory for next open
These commands now set g.app.globalOpenDir.
#@+node:ekr.20060328171518.190: *6* Investigated colorizer problems: can not reproduce
http://sourceforge.net/forum/message.php?msg_id=3585710
#@+node:ekr.20060328171518.248: *6* Removed support @ifgui: it doesn't and can't work
Alas, @if-gui can't be made to work. The problem is that plugins can set
g.app.gui, but plugins need settings so the leoSettings.leo files must be parsed
before g.app.gui.guiName() is known.
#@+node:ekr.20060328171518.249: *6* Removed autocompletion for self
It's not ready for prime time.
#@+node:ekr.20060414071350.1: *6* Rewrote g.importExtension to simplify startup logic
#@+node:ekr.20060414071350.8: *6* Removed calls to lstrip and rstrip for compatibility with Python 2.2.1
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3671350

Change aString.lstrip and aString.rstrip to the aString.replace.
@color
#@+node:ekr.20060414071350.39: *6* Fixed crash in string.startswith and string.endswith
leoID = ekr (in c:\Documents and Settings\Ed)
reading settings in C:\prog\leoCVS\leo\config\leoSettings.leo
reading settings in C:\prog\leoCVS\leo\src\LeoPy.leo
rst3 plugin: SilverCity not loaded
AttributeError Exception in Tk callback
  Function: <function bindKeyCallback at 0x016F2E70> (type: <type 'function'>)
  Args: (<Tkinter.Event instance at 0x03510288>,)
  Event type: KeyPress (type num: 2)
Traceback (innermost last):
  File "C:\prog\leoCVS\leo\extensions\Pmw\Pmw_1_2\lib\PmwBase.py", line 1752, in __call__
    return apply(self.func, args)
  File "C:\prog\leoCVS\leo\src\leoKeys.py", line 2002, in bindKeyCallback
    return k.masterKeyHandler(event,stroke=stroke)
  File "C:\prog\leoCVS\leo\src\leoKeys.py", line 2928, in masterKeyHandler
    val = self.masterKeyHandlerHelper(event,stroke)
  File "C:\prog\leoCVS\leo\src\leoKeys.py", line 2992, in masterKeyHandlerHelper
    val = k.callStateFunction(event) # Calls end-command.
  File "C:\prog\leoCVS\leo\src\leoKeys.py", line 2219, in callStateFunction
    val = k.state.handler(event)
  File "C:\prog\leoCVS\leo\src\leoKeys.py", line 348, in autoCompleterStateHandler
    self.insertNormalChar(ch,keysym)
  File "C:\prog\leoCVS\leo\src\leoKeys.py", line 856, in insertNormalChar
    self.calltip(obj)
  File "C:\prog\leoCVS\leo\src\leoKeys.py", line 455, in calltip
    obj = getattr(string,obj.__name__)
AttributeError: 'module' object has no attribute 'startswith'
#@+node:ekr.20060414071350.47: *6* Fixed Crash after undoing clearRecentFiles command
exception executing command
Traceback (most recent call last):
  File "C:\prog\leoCVS\leo\src\leoCommands.py", line 264, in doCommand
    val = command(event)
  File "C:\prog\leoCVS\leo\src\leoCommands.py", line 884, in clearRecentFiles
    u.afterClearRecentFiles(bunch)
  File "C:\prog\leoCVS\leo\src\leoUndo.py", line 621, in afterClearRecentFiles
    u.pushBead(bunch)
  File "C:\prog\leoCVS\leo\src\leoUndo.py", line 192, in pushBead
    u.setUndoTypes()
  File "C:\prog\leoCVS\leo\src\leoUndo.py", line 341, in setUndoTypes
    u.cutStack()
  File "C:\prog\leoCVS\leo\src\leoUndo.py", line 136, in cutStack
    if bunch.kind == 'beforeGroup':
AttributeError: 'Bunch' object has no attribute 'kind'
#@+node:ekr.20060414071350.58: *6* Fixed minor problems reported by Pychecker
# No change for now
C:\prog\tigris-cvs\leo\src\leoKeys.py:1050: Parameter (thread) not used

# Fixed
C:\prog\tigris-cvs\leo\src\leoTkinterFrame.py:1428: Function returns a value and also implicitly returns None
C:\prog\tigris-cvs\leo\src\leoTkinterTree.py:1222: Local variable (delta) not used
C:\prog\tigris-cvs\leo\src\leoKeys.py:1931: Local variable (f) not used
C:\prog\tigris-cvs\leo\src\leoGlobals.py:5246: Local variable (buttonList) not used
C:\prog\tigris-cvs\leo\src\leoCommands.py:493: No global (enableIdleTimeHook) found
#@+node:ekr.20060328171518.191: *5* Plugins
#@+node:ekr.20060328171518.238: *6* Changed path to stylesheet in the rst3 plugin
http://sourceforge.net/forum/message.php?msg_id=3637393

I'm trying to set up a default stylesheet for a project and want this to be
held relative to the project directory (where the .leo file is). The default
is to place it in the same directory as the output, which is a couple of levels
down.

http://sourceforge.net/forum/message.php?msg_id=3639216

g.os_path_dirname(self.outputFileName) with self.c.frame.openDirectory. This
makes the path relative to the project. Not 100% as the stylesheet filename
would need a path embedded in it to move the location down the tree. However,
it is consistent with the way the output file is named.
#@+node:ekr.20060328171518.240: *6* Fixed problems with chapters plugin
See the chapters2 in leoPlugins.leo.

See also:

http://sourceforge.net/forum/message.php?msg_id=3626542

https://sourceforge.net/forum/message.php?msg_id=3629055

http://sourceforge.net/forum/message.php?msg_id=3632004
#@+node:ekr.20060328171518.244: *6* Improved groupoperations plugin
Cleaned up the code and added support minibuffer commands:

group-operations-clear-marked       = Alt-Ctrl-Shift-l
group-operations-mark-for-copy      = Alt-Ctrl-Shift-c
group-operations-mark-for-move      = Alt-Ctrl-Shift-m
group-operations-mark-for-clone     = Alt-Ctrl-`
group-operations-mark-target        = Alt-Ctrl-Shift-t
group-operations-operate-on-marked  = Alt-Ctrl-Shift-o
group-operations-transfer           = Alt-Ctrl-Shift-d

This code has not been tested with the chapters2 plugin.
#@+node:ekr.20060328171518.245: *6* Fixed crasher in Word (and other) plugins
http://sourceforge.net/forum/message.php?msg_id=3617936

The fix was to plugins_menu.py: the cmd_callback must have an event argument.
#@+node:ekr.20060328171518.246: *6* Fixed problem with labels plugin
The fix: all menu commands now have event=None in their argument list.
#@+node:ekr.20060417092536: *4* 4.4 b4
Leo 4.4 beta 4                                             April 21, 2006

This version fixes a long-standing MacOS bug.  It is likely to be the last
beta release before 4.4 final.  This release also adds several new commands
and contains a script for updating leoSettings.leo.

Warning: The previous beta was not widely distributed. Please do some testing in
your environment before recommending this version of Leo to others, (such as
your students).

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Autocompletion and calltips.  Autocompletion works much like tab completion.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://sourceforge.net/cvs/?group_id=3458
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060421070409.1: *5* Bugs
#@+node:ekr.20060421070602: *6* Fixed rename-buffer command
#@+node:ekr.20060421070409.2: *6* Investigated problems with legacy bindings
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3688804
By: paulpaterson

It seems that copying and pasting nodes with CTRL-SHIFT-C, V is not working.
- (legacy bindings)
- select a node
- CTRL-SHIFT-C
- CTRL-SHIFT-V
- Vim opens up! I expect to paste the node. The clipboard doesn't seem to contain
any XML
- The menu items show that these keys are bound to the copy and paste node
commands

*** Also on legacy bindings the arrow keys don't seem to move the cursor in the
body.
#@+node:ekr.20060421070409.3: *6* Fixed bug when cutting text in headline
#@+node:ekr.20060421070409.4: *7* Report
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3692247
By: vpe

After cutting selection in the headline, headline area shrinks too much.  Example:
headline is 'NewHeadline', select last 'e', ctrl-x, it shrinks to 'Ne'

To fix by hand: add

s=g.app.gui.getAllText(w)

Just before

w.configure(width=f.tree.headWidth(s=s))

in cutText in leoTkFrame.py
#@+node:ekr.20060421070409.9: *6* Fixed crasher in open-find-dialog
#@+node:ekr.20060421070409.10: *7* Report
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3692247

Find panel cannot be re-opened. Run open-find-dialog. Close it. Run open-find-dialog
again -- crash.

The fix was to move the line:

self.top.protocol("WM_DELETE_WINDOW", self.onCloseWindow)

from createBindings to createFrame in the leoTkinterFind class.
#@+node:ekr.20060421070409.11: *7* Traceback
TclError Exception in Tk callback
  Function: <function bindKeyCallback at 0x0169B170> (type: <type 'function'>)
  Args: (<Tkinter.Event instance at 0x01865EB8>,)
  Event type: KeyPress (type num: 2)
Traceback (innermost last):
  File "C:\prog\tigris-cvs\leo\extensions\Pmw\Pmw_1_2\lib\PmwBase.py", line 1752, in __call__
    return apply(self.func, args)
  File "c:\prog\tigris-cvs\leo\src\leoKeys.py", line 1991, in bindKeyCallback
    return k.masterKeyHandler(event,stroke=stroke)
  File "c:\prog\tigris-cvs\leo\src\leoKeys.py", line 2931, in masterKeyHandler
    val = self.masterKeyHandlerHelper(event,stroke)
  File "c:\prog\tigris-cvs\leo\src\leoKeys.py", line 2990, in masterKeyHandlerHelper
    val = k.callStateFunction(event) # Calls end-command.
  File "c:\prog\tigris-cvs\leo\src\leoKeys.py", line 2208, in callStateFunction
    val = k.state.handler(event)
  File "c:\prog\tigris-cvs\leo\src\leoKeys.py", line 2289, in fullCommand
    k.callAltXFunction(k.mb_event)
  File "c:\prog\tigris-cvs\leo\src\leoKeys.py", line 2327, in callAltXFunction
    func(event)
  File "C:\prog\tigris-cvs\leo\src\leoCommands.py", line 2801, in showFindPanel
    c.frame.findPanel.bringToFront()
  File "C:\prog\tigris-cvs\leo\src\leoTkinterFind.py", line 469, in bringToFront
    self.top.withdraw() # Helps bring the window to the front.
  File "c:\python24\lib\lib-tk\Tkinter.py", line 1562, in wm_withdraw
    return self.tk.call('wm', 'withdraw', self._w)
TclError: bad window path name ".25637872"

================================================
  Event contents:
    char:
    delta: 13
    height: ??
    keycode: 13
    keysym: Return
    keysym_num: 65293
    num: ??
    serial: 1486
    state: 0
    time: 1717970
    type: 2
    widget: .17570752.17571352.19882152.minibuffer
    width: ??
    x: 183
    x_root: 576
    y: -62
    y_root: 859

#@+node:ekr.20060421070409.33: *6* Don't do typing completion for numbers
# getLeadinWord must clear self.membersList to disable completion.
#@+node:ekr.20060421070409.36: *6* Fixed crash in undo
leoID = ekr (in c:\Documents and Settings\Ed)
reading settings in C:\prog\tigris-cvs\leo\config\leoSettings.leo
reading settings in C:\Documents and Settings\Ed\My Documents\ekr.leo
rst3 plugin: SilverCity not loaded
exception executing command
Traceback (most recent call last):

  File "C:\prog\tigris-cvs\leo\src\leoCommands.py", line 264, in doCommand
    val = command(event)

  File "C:\prog\tigris-cvs\leo\src\leoCommands.py", line 2969, in pasteOutline
    u.afterInsertNode(pasted,undoType,undoData)

  File "C:\prog\tigris-cvs\leo\src\leoUndo.py", line 750, in afterInsertNode
    u.pushBead(bunch)

  File "C:\prog\tigris-cvs\leo\src\leoUndo.py", line 182, in pushBead
    if bunch2 and bunch2.kind == 'beforeGroup':

AttributeError: 'Bunch' object has no attribute 'kind'
#@+node:ekr.20060421070409.37: *5* New features
#@+node:ekr.20060417092825.1: *6* Added script to update new copies of leoSettting.leo from previous copies
See the (presently disabled) script button in scripts.leo at:

Buttons-->@@button updateSettings

From the docstring:

Here is a **preliminary** script that updates a new leoSettings.leo file
(path2) from the settings in a previous leoSettings.leo file (path1).
Presumably, the path2 file is the leoSettings.leo file from a new distribution,
and the path1 file a leoSettings.leo file containing settings that you have
modified.  You must specify the full path of both files in the top-level @button node.

**Warning**: This script modifies the path2 file. Make sure that you don't mind
modifying this file.

**Warning**: This script is unsophisticated in its update algorithm. If if finds
corresponding nodes (node with the same settings name) in both outlines it simply
replaces the node in the path2 file with the node in the path1 file. In
particular, it does not keep track of individual shortcuts: it replaces the body
of one @shortcuts node with the body of the corresponding @shortcuts node.

**Note**: If the path1 file contains a settings node not in the path2 file it
attempts to create a new node in the corresponding place in the path2 file. If
this is not possible, say because the structures of the files are different, the
script places the new node as the last child of the @settings node in the path2
file.
#@+node:ekr.20060421070409.41: *6* Added new commands
New commands:

add-space-to-lines,
add-tab-to-lines
clean-lines
clear-selected-text
goto-global-line
help-for-command
open-outline-by-name (filename completion)
remove-space-from-lines
remove-tab-from-lines
#@+node:ekr.20060421070409.40: *6* Made all edit command undoable
#@+node:ekr.20060428084553: *4* 4.4 rc1
Leo 4.4 release candidate 1                                 April 28, 2006

This version fixes a few minor bug reported in 4.4b4 and adds 9 new commands.
The open-outline-by-name command supports filename completion.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Autocompletion and calltips.  Autocompletion works much like tab completion.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060428084553.2: *5* Bugs
#@+node:ekr.20060428084957: *6* Fixed rename-buffer command
#@+node:ekr.20060428084553.4: *6* Fixed bug when cutting text in headline
http://sourceforge.net/forum/message.php?msg_id=3692247

After cutting selection in the headline, headline area shrank too much.  
#@+node:ekr.20060428084553.10: *6* Fixed crasher in open-find-dialog
http://sourceforge.net/forum/message.php?msg_id=3692247

Find panel cannot be re-opened. Run open-find-dialog. Close it. Run open-find-dialog
again -- crash.
#@+node:ekr.20060428084553.34: *6* Suppressed typing completion for numbers
# getLeadinWord must clear self.membersList to disable completion.
#@+node:ekr.20060428084553.37: *6* Fixed crash in undo
Traceback (most recent call last):

  File "C:\prog\tigris-cvs\leo\src\leoCommands.py", line 264, in doCommand
    val = command(event)

  File "C:\prog\tigris-cvs\leo\src\leoCommands.py", line 2969, in pasteOutline
    u.afterInsertNode(pasted,undoType,undoData)

  File "C:\prog\tigris-cvs\leo\src\leoUndo.py", line 750, in afterInsertNode
    u.pushBead(bunch)

  File "C:\prog\tigris-cvs\leo\src\leoUndo.py", line 182, in pushBead
    if bunch2 and bunch2.kind == 'beforeGroup':

AttributeError: 'Bunch' object has no attribute 'kind'
#@+node:ekr.20060428084711: *6* Fixed crash in datenodes plugin
https://sourceforge.net/forum/message.php?msg_id=3699799
#@+node:ekr.20060428084553.38: *5* New features
#@+node:ekr.20060428084553.39: *6* Added clear-selection command
Useful, e.g., after a find.
#@+node:ekr.20060428084553.41: *6* Made all edit command undoable
self.beginCommand(undoType='xxx')
...
self.endCommand(changed=True,setLabel=True)
#@+node:ekr.20060428084553.42: *6* Added new commands
New commands:

add-space-to-lines
add-tab-to-lines
clean-lines
clear-selected-text
goto-global-line
help-for-command
remove-space-from-lines
remove-tab-from-lines
#@+node:ekr.20060428084553.273: *6* Added filename completion
At present, only the open-outline-by-name command supports filename completion.
#@+node:ekr.20060511074853: *4* 4.4 final
Leo 4.4 Final                                                     May 11, 2006

Leo 4.4 Final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4:
--------------------------
- An Emacs-like mini-buffer: you can now execute any command by typing its long
name, with tab completion.

- Many new commands, including cursor and screen movement, basic character, word
and paragraph manipulation, and commands to manipulate buffers, the kill ring,
regions and rectangles. You can use Leo without using a mouse.

- Flexible key bindings and input modes. You can emulate the operation of Emacs,
Vim, or any other editor.

- A tabbed log pane. The Find and Spell Check commands now use tabs instead of
dialogs, making those commands much easier to use. Plugins or scripts can easily
create new tabs. The Completion tab shows possible typing completions.

- Autocompletion and calltips.  Autocompletion works much like tab completion.
  To enable autocompletion, bind a key to the auto-complete command.

- Dozens of other new features and bug fixes since Leo 4.3.3.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080311060457.214: *3* 4.4.x
#@+node:ekr.20060822140418: *4* 4.4.1...new colorizer, slideshow, multiple editors
#@+node:ekr.20060830141224: *5* 4.4.1 final
Leo 4.4.1 final                                            August 30, 2006

Leo 4.4.1 final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.1:
----------------------------
- Leo outputs decorators correctly, provided that the decorator is not a Leo directive.
- A new colorizer plugin controlled by jEdit language description files.
- A new shadow files plugin that allows external files not to have sentinel lines.
- Multiple editors in Leo's body pane.
- Search commands now support regex replace patterns: \1, \2, etc.
- Support for external debuggers: see http://webpages.charter.net/edreamleo/debuggers.html
- The scripting plugin now creates a Debug Script button.
- Several new commands including run-unit-test, python-help, toggle-invisibles,
  and scroll-outline-left/right.
- The help-for-command commands now contains information for almost all commands.
- A new shortcut_button plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060830141224.2: *6* Removed warning about changed nodes
# Possibly a less intrusive warning should be used.
#@+node:ekr.20060830141224.13: *6* Bugs fixed
#@+node:ekr.20060830141224.14: *7* Fixed serious bug in Paste Node as Clone
#@+node:ekr.20060830141224.15: *8* Report
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3885494
By: mikecrowe

OK, I found out how to duplicate this one.  This caused me a lot of grief until
I found out what is causing it.

NodeA:
...Child1
...Child2
...Child3

NodeB:
...CloneChild1
...CloneChild2
...CloneChild3

Now, put cursor on NodaA.  Ctrl-Shift-C (copy node).
Next, put cursor on CloneChild3.  Paste Node as Clone
You should get an invalid paste clone message.

Now, first cursor move (for me) puts NodeB as top node, ERASING all other nodes.
Warning:  DO NOT SAVE NOW.  It will erase all other nodes.
#@+node:ekr.20060830141224.16: *8* What I did
@nocolor

- Created getLeoOutlineHelper.  This simplifies the code.
- Init self.checking in getLeoFile and getLeoOutline.
- Use self.checking in getVnodes, getVnode and createVnode.
  Using self.checking in getVnode complicates an already way-too-complex method, but it can't be helped.
#@+node:ekr.20060830141224.37: *7* Fixed minor .leoID.txt bug
#@+node:ekr.20060830141224.38: *8* Report
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3886250
By: znafets

A .leoID.txt with a \n behind the idstring creates a problem. 
It will be read in g.app.leoID and being used as is when writing the Leo file.

The fix is in app.setLeoID -> << return if we can set leoID from "leoID.txt" >>
#@+node:ekr.20060830141224.45: *7* Improved speed of unmark-all and corresponding undo/redo
#@+node:ekr.20060830141224.46: *8* Report
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3890031
By: terry_n_brown

I have a tree of some 2500 nodes, run a script that marks
probably 1500-2000 of them, and that's quick (2-3 seconds max.).

I can clear all the marks with:

for p in c.all_positions():
    p.v.clearMarked()

and that also is quick (2-3 seconds max.).  But when I use the menu option Unmark
All, that takes forever (1-2 minutes :-) running 100% CPU all the while.
#@+node:ekr.20060822140418.1: *5* 4.4.1 b4
Leo 4.4.1 beta 4                                            August 24, 2006

Leo 4.4.1 beta 4 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.1:
----------------------------
- Leo outputs decorators correctly, provided that the decorator is not a Leo directive.
- A new colorizer plugin controlled by jEdit language description files.
- A new shadow files plugin that allows external files not to have sentinel lines.
- Multiple editors in Leo's body pane.
- Search commands now support regex replace patterns: \1, \2, etc.
- Support for external debuggers: see http://webpages.charter.net/edreamleo/debuggers.html
- The scripting plugin now creates a Debug Script button.
- Several new commands including run-unit-test, python-help, toggle-invisibles,
  and scroll-outline-left/right.
- The help-for-command commands now contains information for almost all commands.
- A new shortcut_button plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060822140418.3: *6* Bugs fixed
#@+node:ekr.20060822140418.4: *7* Added bindings to text panes for show-font command
http://sourceforge.net/forum/forum.php?thread_id=1542384&forum_id=10228
#@+node:ekr.20060822140418.26: *7* Fixed kill-line, kill-word, kill-sentence, etc
http://sourceforge.net/forum/message.php?msg_id=3839322
#@+node:ekr.20060822140418.29: *7* Fixed minor scrolling problem
http://sourceforge.net/forum/message.php?msg_id=3805745
#@+node:ekr.20060822140418.36: *7* Fixed bug in backward-kill-word
http://sourceforge.net/forum/message.php?msg_id=3841115

There is still some doubt about what the best operation of this command should be.
#@+node:ekr.20060822140418.39: *7* Fixed unicode bug in forward-word and backward-word commands
http://leo.zwiki.org/9RussianUnicodeWordsAreNotDetectedProperlyInBodyPane
#@+node:ekr.20060822140418.41: *7* Fixed problem setting body background color
http://sourceforge.net/forum/message.php?msg_id=3874380

Setting a value for background color in the body pane had no effect.

There were several problems, among which conflicting and confusing settings.
In particular, the insert_mode_bg_color setting overrides the body_text_background_color setting.

I changed the code so that insert_mode_bg_color defaults to
body_text_background_color, and put all the settings for the body text in one
place.
#@+node:ekr.20060822140418.49: *7* Disabled incremental colorizing in new colorizer when there are multiple editors
#@+node:ekr.20060822140418.97: *7* Removed component classes
These were overly complicated an not useful.
#@+node:ekr.20060822140418.69: *6* New features
#@+node:ekr.20060822140418.76: *7* Added scroll-outline-left/right commands
http://sourceforge.net/forum/message.php?msg_id=3834645
#@+node:ekr.20060822140418.77: *7* Generalized bracket flasher
http://sourceforge.net/forum/message.php?msg_id=3802513

Added these settings:

@string open_flash_brackets = ([{
@string close_flash_brackets = )]}
#@+node:ekr.20060822140418.88: *7* Leo *already* supports Python decorators
Leo *already* outputs decorators correctly, assuming the decorator does not conflict with a Leo directive.
#@+node:ekr.20060822140418.92: *7* Wrote script to convert g.es to g.et where appropriate
http://sourceforge.net/forum/message.php?msg_id=3858363
#@+node:ekr.20060822140418.70: *7* Created menu font settings
http://sourceforge.net/forum/message.php?msg_id=3802624

Added @font menu font setting
#@+node:ekr.20060601101643: *5* 4.4.1 b1
Leo 4.4.1 beta 1                                            June 3, 2006

Leo 4.4.1 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.1:
----------------------------
- A new colorizer plugin controlled by jEdit language description files.
  At present this plugin only reliably colors @language python code.
- Multiple editors in Leo's body pane.
- Search commands now support regex replace patterns: \1, \2, etc.
- Support for external debuggers: see http://webpages.charter.net/edreamleo/debuggers.html
- The scripting plugin now creates a Debug Script button.
- Several new commands including run-unit-test, python-help and toggle-invisibles.
- The help-for-command commands now contains information for almost all commands.
- A new shortcut_button plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060601101958.1: *6* Fixed bugs
#@+node:ekr.20060601101958.56: *7* The Open Python Window command runs Idle in a separate process
This fixes all conflicts between Leo and Idle.
#@+node:ekr.20060601101958.2: *7* Fixed crasher in searchbox plugin
http://sourceforge.net/forum/message.php?msg_id=3729858

Fixed crasher in Leo 4.4 by initing self.p in Quickfind ctor.
#@+node:ekr.20060601101958.6: *7* Fixed binding problems in leoSettings.leo reported by Check bindings script.
http://sourceforge.net/forum/message.php?msg_id=3737879
#@+node:ekr.20060601101958.13: *7* Fixed crasher in macros plugin
http://sourceforge.net/forum/message.php?msg_id=3737745

- Added event keyword argument to parameterize function.
#@+node:ekr.20060601101958.14: *7* Fixed crasher in  UNL plugin
http://sourceforge.net/forum/message.php?msg_id=3737745

The fix was to add a c argument to g.findTopLevelNode and g.findNodeInTree.
#@+node:ekr.20060601101958.16: *7* Suppressed traceback in g.callers when the call stack isn't deep enough
#@+node:ekr.20060603082009: *7* Fixed long-standing bug involving @comment and @language
http://sourceforge.net/forum/message.php?msg_id=3761285

There were actually two bugs:

- parseLeoSentinel was not recognizing the closing comment delim (!!)

- putDirective was incorrectly setting delims for @language and @comment delims.
  This is wrong: the init code calls scanAllDirectives, and the comment delims
  **must not change** in the file (except as the result of @delims.)
#@+node:ekr.20060601102802: *6* New features, commands & plugins
#@+node:ekr.20060601101958.245: *7* Support for multiple editors in the body pane
The add-editor command adds a new editor, the delete-editor command deletes the
presently selected editor, and the cycle-editor-focus command cycles focus
between editors in the body text.
#@+node:ekr.20060601101958.70: *7* Improved searches
- Allow \1, \2, etc. replacements in re searches.

- Allow \n and \t in plain searches.

- The shortcut for the replace-string command now changes from the find command
to the replace command.
#@+node:ekr.20060601101958.52: *7* Added debug command
This runs the winpdb debugger in a separate process.

The winpdb debugger must be installed for this command to work.

For more details, see: http://webpages.charter.net/edreamleo/debuggers.html
#@+node:ekr.20060601101958.58: *7* Added Debug button to scripting plugin
#@+node:ekr.20060603072938: *7* Added python-help command
This prompts for a string s, then puts the result of help(s) in Leo's log pane.
#@+node:ekr.20060601101958.277: *7* Added toggle-invisibles and hide-invisibles commands
#@+node:ekr.20060601101958.172: *7* Added run-unit-test command
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3575014

Actually, the run-unit-tests command first appeared in Leo 4.4, but it never got
properly announced.
#@+node:ekr.20060601101958.234: *7* The help-for-command command now works for almost all commands
#@+node:ekr.20060603081537: *7* Added shortcut_button plugin
This plugin creates a 'Shortcut' button in the icon area. Pressing the Shortcut
button creates *another* button which when pressed will select the presently
selected node at the time the button was created.
#@+node:ekr.20060601102802.2: *6* New and improved settings
#@+node:ekr.20060601101958.174: *7* Added @bool idle_redraw setting
http://sourceforge.net/forum/message.php?msg_id=3729823

This is intended to help with redraw problems on Linux.
#@+node:ekr.20060601101958.264: *7* Added autoindent_in_nocolor_mode setting
@nocolor

leoSettings.leo now contains the following setting, with default as shown:

@bool autoindent_in_nocolor_mode = True


True:  auto-indent regardless of how text is colored.
False: disable auto-indenting if in range @nocolor or @kill.

This will make the default action work as Roger Erens requested, and will allow
you to make Leo work exactly as before if you want.
#@+node:ekr.20060601101958.244: *7* Added warnings about the expanded_click_area setting
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3737745

Added warnings in various places that the setting:

@bool expanded_click_area = True

interferes with the  Universal Scrolling plugin.
#@+node:ekr.20060601101958.276: *7* Removed support for @shortcut (@shortcuts remains)
@shortcut nodes never worked and apparently nobody ever used them.
#@+node:ekr.20060601101958.28: *6* Minor improvements
#@+node:ekr.20060601101958.218: *7* Finished Cmds menu
#@+node:ekr.20060601101958.235: *7* Improved show-fonts command
It is now clearer what the selected values are.
#@+node:ekr.20060601101958.238: *7* Strip quotes from color, font settings.
#@+node:ekr.20060601101958.239: *7* Warn about invalid Enter and Leave key bindings
#@+node:ekr.20060620094645: *5* 4.4.1 b2
Leo 4.4.1 beta 2                                            June 23, 2006

Leo 4.4.1 beta 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.1:
----------------------------
- A new colorizer plugin controlled by jEdit language description files.
  At present this plugin only reliably colors @language python code.
- Multiple editors in Leo's body pane.
- Search commands now support regex replace patterns: \1, \2, etc.
- Support for external debuggers: see http://webpages.charter.net/edreamleo/debuggers.html
- The scripting plugin now creates a Debug Script button.
- Several new commands including run-unit-test, python-help and toggle-invisibles.
- The help-for-command commands now contains information for almost all commands.
- A new shortcut_button plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060620094645.34: *6* Bugs fixed
#@+node:ekr.20060620094645.35: *7* Made sure calltip always adds '('
#@+node:ekr.20060620094645.43: *7* word matches now succeed if first character of the pattern is not in word-chars.
#@+node:ekr.20060620094645.44: *7* Dialogs now bring the Leo window back to the front
Called c.bringToFront() after open/save/import dialogs.
#@+node:ekr.20060620094645.45: *7* Fixed unit test: ensure that body gets focus after ending editing
FAIL: @test return ends editing of headline

----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\prog\tigris-cvs\leo\src\leoTest.py", line 155, in runTest
    exec script + '\n' in {'c':c,'g':g,'p':p}
  File "<string>", line 14, in ?
AssertionError: oops2

----------------------------------------------------------------------
Ran 438 tests in 193.628s

FAILED (failures=1)
>>>
#@+node:ekr.20060620094645.46: *7* Remember scrolling postion, insert point and selection range in multiple editors
http://sourceforge.net/forum/message.php?msg_id=3764077
#@+node:ekr.20060620094645.50: *7* Fix crasher in kill-region command
#@+node:ekr.20060620094645.52: *7* Fixed bug: cycle-editor hung Leo
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3771032
By: paulpaterson

The cycle-editor-focus command causes Leo to lock up  on my machine (WinXP,
Python 2.4).

@color
#@+node:ekr.20060620094645.64: *7* Fixed crasher in init code
http://sourceforge.net/forum/message.php?msg_id=3771014
#@+node:ekr.20060620094645.68: *7* use g.stripBrackets instead of lstrip and rstrip
lstrip and rstrip do not exist in Python 2.2.1.
#@+node:ekr.20060620094645.76: *7* Restore cursor when changing focus in editors
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3778764
By: davidmcnab

When I hit my 'change-editor-focus' binding, the cursor jumps
to unpredictable places within the next editor pane.
#@+node:ekr.20060620094645.77: *7* Undo restores focus again
#@+node:ekr.20060622130815: *7* Updated row/col indicators when using arrow keys
http://sourceforge.net/forum/message.php?msg_id=3790857
#@+node:ekr.20060622130815.3: *7* Fixed show-invisibles crasher
http://sourceforge.net/forum/message.php?msg_id=3790814
#@+node:ekr.20060620094645.78: *6* Code level
#@+node:ekr.20060620094645.79: *7* Simplified gui bindings
Added makeMasterGuiBinding.
#@+node:ekr.20060622130815.9: *7* Created g.app.gui.makeScriptButton
#@+node:ekr.20060620094645.85: *6* New & improved features
#@+node:ekr.20060620094645.86: *7* Improved filename completion
#@+node:ekr.20060620094645.96: *7* Added support for --> command-name in @mode nodes
#@+node:ekr.20060620094645.97: *7* Better listings for print-commands and print-bindings & mode-help commands
#@+node:ekr.20060620094645.103: *7* Fixed find-character & find-word commands
#@+node:ekr.20060620094645.106: *7* Better printing of bindings (period -> .) etc
#@+node:ekr.20060620094645.107: *7* Added support for !command, !insert and !overwrite bindings
Leo now supports bindings of the form:

command-name !command = shortcut

You will find examples in leoSettings.leo in the node

@keys EKR bindings: vim mode bindings-->Shortcuts-->@shortcuts top-level keys

Such bindings are essential for all plain key bindings that are *only* to be executed in command mode.  Most, but *not* all plain key bindings should be bound in the !command 'pane'.  The two exceptions presently are '.' which *always* invokes the autocompleter code and '(' which *always* invokes the calltips code.

It is now possible to have a *single* set of key bindings be 'Emacs-like' and
'Vim-like' at the same time. See the node EKR bindings: vim mode bindings in
leoSettings.leo.

One setting switches between emacs-like operation and vim-like operation:

For emacs, use:
@strings  [ignore,insert,overwrite] top_level_unbound_key_action = insert

For vim, use:
@strings  [ignore,insert,overwrite] top_level_unbound_key_action = ignore

Vim-like modes are made possible by two new features:

1. Entry commands in @mode nodes. In the body of @mode nodes, lines of the form

--> command-name

tell Leo to execute the command when entering the mode. More than one such lines
may exist; Leo executes them in the order they appear. Entry commands are
potentially a very powerful feature. To avoid chaos, entry commands should not
alter the minibuffer :-)

2. Silent modes. In order to keep the selected text visible, Leo must *not* move
focus into the minibuffer for editing commands. The set-silent-mode command
tells Leo to treat the mode described in the @mode node as a silent mode. A true
mode is created, but it only affects key bindings and the minibuffer never
becomes active.

Thus, all @mode nodes for vim-like modes contain the following line:

--> set-silent-mode.
#@+node:ekr.20060620094645.108: *7* Improved check bindings script in leoSettings.leo
All sets of key bindings in leoSettings.leo now start with @keys in the headline
of the root node. The @keys convention is used *only* by the Check Bindings
script. So now, instead of having a static list of key bindings sets (which is
guaranteed to get out-of-date), the Check Bindings script can scan all of
leoSettings.leo for sets of key bindings.

Another improvement to the Check Bindings script. Besides doing a better job of
checking, you may now specify optional commands, such as commands defined in
plugins. The Check Bindings will not complain if the commands don't presently
exists in k.commandsDict. You specify such commands by adding items to the
following lists in the root node of the Check Bindings script, i.e., the node
Buttons-->@button Check Bindings.

optionalCommandPrefixes = ['group-operations']
optionalCommandNames = []
#@+node:ekr.20060620094645.109: *7* Improved isearch & added isearch-with-present-options command
- added isearch-with-present-options.
- many small improvements to isearch code.
- regex searches now highlighted properly.
- isearches are (and should be) confined to a single body text.
- Backspace now handled properly.

A small glitch. Starting a regexp pattern with '.' will cause the entire pattern
to turn red initially, which is technically correct but perhaps a bit
confusing.
#@+node:ekr.20060620094645.194: *7* Use last shortcut defined
http://sourceforge.net/forum/message.php?msg_id=3767016
#@+node:ekr.20060620094645.225: *7* selfInsertCommand sets the column used by up/down arrows
#@+node:ekr.20060620094645.231: *7* Added toggle-autocompleter and toggle-calltips commands
The commands that enable and disable calltips now update the status line.
#@+node:ekr.20060620094645.232: *7* Script buttons now create press-xxx-button commands
Creating a script button creates the press-xxx-button command,
and you can specify settings for such commands using @shortcuts nodes.
#@+node:ekr.20060620094645.233: *7* print-bindings command now properly sorts bindings
#@+node:ekr.20060620094645.234: *7* Allow @shortcuts bindings to apply to press-xxx-commands
@nocolor

The scripting plugin now creates a press-x-button command for each scripting button named x.
You can bind shortcuts to such commands by placing @shortcuts nodes in an @setting tree in the outline containing the @button nodes.  test.leo shows an example.

What I did:

- The scripting plugin now defines button bindings with the 'button' pane specifier.
  This takes precedence over all other specifiers.

- k.bindKeyToDict now does a better job of detecting and warning about redefinitions.

- k.printBindings now properly sorts entries.
  This was causing me a great deal of confusion.

- k.registerCommand now properly gets shortcuts from settings if possible,
  and makes bindings in the new 'button' pane specifier.

- masterKeyHandlerHelper now supports the 'button' pane specifier,
  which overrides all others.

@color
#@+node:ekr.20060620094645.242: *7* Added support for @abbrev nodes in leoSettings.leo
#@+node:ekr.20060620094645.243: *7* Created open-users-guide command
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3772475

Maybe put a link to the html TOC into the Help Menu,
"%leodir%/doc/html/leo_TOC.html".

This is more intuitive (to newbies) than the LeoDocs.leo link.  I found this
very confusing in the beginning.

What I did:

- Created open-users-guide command.
- Created Open Users Guide menu item.
- Removed Open Offline Tutorial menu item.

@color
#@+node:ekr.20060620094645.252: *7* scroll-up/down commands now scroll the outline if focus is in outline pane
# Important: this can be done better using per-pane bindings as in the default leoSettings.leo.
#@+node:ekr.20060620094645.258: *7* Cycle-focus command cycles through tabs and editors
#@+node:ekr.20060620094645.286: *7* Allow @mode outside of leoSettings.leo
#@+node:ekr.20060622130553: *7* Added section about upgrading settings

http://sourceforge.net/forum/message.php?msg_id=3784292

http://webpages.charter.net/edreamleo/installing.html#updating-settings-from-previous-versions-of-leo
#@+node:ekr.20060622130553.2: *7* Documented how to turn @buttons into plugins
http://sourceforge.net/forum/message.php?msg_id=3778946

http://webpages.charter.net/edreamleo/writingPlugins.html#turning-script-buttons-into-plugins
#@+node:ekr.20060620094645.302: *6* Plugins
#@+node:ekr.20060620094645.303: *7* Added doc-only option to rst3
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3767601
http://sourceforge.net/forum/message.php?msg_id=3768413
Craig

I have an @thin file with @Doc and @Code sections scattered though out the tree,
where each node has one or more doc and code sections.

I would like to be able to use the rst3 plugin to produce an html file containing
only info from the doc sections, ignoring the code sections.

I added the 
#@+node:ekr.20060620094645.304: *7* Fixed bug in rst doc_only_mode
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3770732
By: ktenney

In << Theory of operation of find/change >> 
the opening paragraph does not appear in the html,
#@+node:ekr.20060620094645.305: *7* Support show_headlines options in doc-only mode in rst3 plugin
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3780216
Craig

In Doc_Only_Mode the rst3 plugin outputs headlines irrespective of the show_headlines
setting.  The other modes do honor this setting.

I scratched around and managed to fix this by changing the node: rst3.py-->class
rstClass-->write methods-->writeBody & helpers-->handleDocOnlyMode

In Line 25 I added a new statement:
     if showHeadlines:
and indented the following 3 lines to make them conditional on this if:
        if result or showThisHeadline or showOrganizers or p == self.topNode:
            # g.trace(len(result),p.headString())
            self.writeHeadlineHelper(p)
#@+node:ekr.20060620094645.306: *7* Fixed bug in UNL plugin
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3785400
By: craigj3


I have a @url node pointing to a Leo file which has a filename with %20 in it.
When I double-click this node I get:

"can not open: \\\Documents%20and%20Settings\tftcj1.EDCON\My%20Documents\Proj\RI
CAA\PcasCellLink.leo"

Taking a look with a debugger, I see that Plugins-->Enhancing the icon and status
areas-->@thin UNL.py-->onUrl1 line 29ish does not covert %20 to spaces before
calling openWithFileName.
#@+node:ekr.20060620094645.307: *7* Improved image plugin
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3783225
Craig

I am looking at the image plugin for organizing photos, and discovered that
it is limited to gif files only.  I found this a bit silly as installing the
ImageTk module from the Python Imaging Library and making a two line change
to the plugin enables it to be used on practically any image type.

The two line are:
1.  a new import:-
import ImageTk

2. In <<select image>> line 9 change 
photo = Tk.PhotoImage(master=a.root, file=filename)

to

photo = ImageTk.PhotoImage(master=a.root, file=filename)
#@+node:ekr.20060620094645.308: *7* Fixed path problem with rst3 plugin
@nocolor
http://sourceforge.net/forum/message.php?msg_id=3779706
By: mstarzyk

My point was not about not found CSS, but that .html files are written to
default_path directory, but .txt files are not written to default_path
directory.
#@+node:ekr.20060620094645.309: *7* Fixed crashers in scheduler plugin
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3784636
By: craigj3

I note that the scheduler plugin is currently broken.

The problem was that all commands now get an event arg.

The Begin Recording and End Recording commands do not seem to work...
#@+node:ekr.20060622132524: *6* Settings
#@+node:ekr.20060620094645.299: *7* Added editor_orientation setting
http://sourceforge.net/forum/message.php?msg_id=3778744

Added editor_orientation setting: valid values are vertical and horizontal.
#@+node:ekr.20060629083400.1: *5* 4.4.1 b3
Leo 4.4.1 beta 3                                            June 29, 2006

Leo 4.4.1 beta 3 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.1:
----------------------------
- A new colorizer plugin controlled by jEdit language description files.
  At present this plugin only reliably colors @language python code.
- Multiple editors in Leo's body pane.
- Search commands now support regex replace patterns: \1, \2, etc.
- Support for external debuggers: see http://webpages.charter.net/edreamleo/debuggers.html
- The scripting plugin now creates a Debug Script button.
- Several new commands including run-unit-test, python-help and toggle-invisibles.
- The help-for-command commands now contains information for almost all commands.
- A new shortcut_button plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060629083935.2: *6* Bugs fixed
#@+node:ekr.20060629083935.3: *7* Fixed recent bug: Ctrl-g does not work in @mode nodes
#@+node:ekr.20060629083935.8: *7* Update column display when typing
http://sourceforge.net/forum/message.php?msg_id=3795258

The column display doesn't change while typing.

#@+node:ekr.20060629083935.15: *7* Fixed long-standing problem reporting indentation errors
http://sourceforge.net/forum/message.php?msg_id=3510448

The fix was to getLastTracebackFileAndLineNumber.

I also created handleScriptException.
#@+node:ekr.20060629083935.25: *7* Fixed long-standing bug in Remove Sentinels command
http://sourceforge.net/forum/message.php?msg_id=3413805
#@+node:ekr.20060629083935.32: *7* Fixed long-standing bugs in import code
- Underindented comments do not end the scan of Python classes or methods.
- Handles continued signature lines properly.
#@+node:ekr.20060629083935.61: *7* Overwrite mode now works in headllines
Note: Editing headline text will happen in insert mode unless

@strings top_level_unbound_key_action = overwrite
#@+node:ekr.20060629083935.70: *7* Fixed crasher in masterCommand
After executing a command we must be careful to test c.exists.
#@+node:ekr.20060629083935.71: *7* Improved view-lossage command
- A better trace, and the trace goes to the log pane.

- Eliminated k.keysymHistory: Tk keysyms are pretty useless.
#@+node:ekr.20060629083935.74: *6* New features
#@+node:ekr.20060629083935.75: *7* Finished repeat-complex-command
@nocolor

- Improved prompt.
- Added message if no previous complex command.
- Added mode entries.
#@+node:ekr.20060629083935.76: *7* Read leoSettings.leo from the directory containing the .leo file
http://sourceforge.net/forum/message.php?msg_id=3794854
#@+node:ekr.20060629083935.93: *7* Flash matching parens & corresponding settings
@killcolor

Here are the relevant settings:

@bool flash_matching_brackets: True: flash matching bracket when typing (, ), [, ], { or }.

@color flash_brackets_background_color and @color flash_brackets_foreground_color.

@int flash_brackets_count: The number of times to flash matching brackets.

@int flash-brackets-delay: One half the total cycle time of bracket flashes, in milliseconds.
#@+node:ekr.20060629083935.96: *6* New settings
#@+node:ekr.20060629083935.97: *7* Added standard bindings for Ctrl-y (yank) and Ctrl-k (kill-line)
# Ctrl-k is no longer needed by the match-brackets command now that brackets flash automatically.
#@+node:ekr.20060629083935.98: *7* Added @bool warn_about_redefined_shortcuts setting
#@+node:ekr.20060629083935.99: *7* Added @bool trace_bind_key_exceptions setting
When True, this provides a full traceback for all exceptions taken when binding keyboard shortcuts.
#@+node:ekr.20060629083935.100: *7* Added bracket flash settings
@killcolor

@bool flash_matching_brackets: True: flash matching bracket when typing (, ), [, ], { or }.

@color flash_brackets_background_color and @color flash_brackets_foreground_color.

@int flash_brackets_count: The number of times to flash matching brackets.

@int flash-brackets-delay: One half the total cycle time of bracket flashes, in milliseconds.
#@+node:ekr.20060903102158: *5* 4.4.1.1 final
Leo 4.4.1.1 final                                       September 3, 2006

Leo 4.4.1.1 final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.4.1.1 corrects a serious last-minute unicode bug in Leo 4.4.1.
This version also adds the new slideshow plugin.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.1:
----------------------------
- Leo outputs decorators correctly, provided that the decorator is not a Leo directive.
- A new colorizer plugin controlled by jEdit language description files.
- A new shadow files plugin that allows external files not to have sentinel lines.
- A new slide show plugin allows you to use Leo outlines as slide shows.
- Multiple editors in Leo's body pane.
- Search commands now support regex replace patterns: \1, \2, etc.
- Support for external debuggers: see http://webpages.charter.net/edreamleo/debuggers.html
- The scripting plugin now creates a Debug Script button.
- Several new commands including run-unit-test, python-help, toggle-invisibles,
  and scroll-outline-left/right.
- The help-for-command commands now contains information for almost all commands.
- A new shortcut_button plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20061008190905: *4* 4.4.2... opml, zodb, sax, myLeoSettings, leoPymacs, autocontract, outline nav
#@+node:ekr.20060928172040: *5* 4.4.2 beta 1
Leo 4.4.2 beta 1                                  September 29, 2006

Leo 4.4.2 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.2:
----------------------------
- You can now store settings in myLeoSettings.leo without fear of those settings
  being changed by cvs updates or in future versions of Leo.
- Leo's vnode and tnode classes are now completely independent of the rest of Leo.
  Some api's have been changed.  This 'big reorg' and may affect scripts and plugins.
- Leo's vnode and tnode classes can optionally be compatible with ZODB databases,
  i.e., they can optionally derive from ZODB.Persistence.Persistent.
  See Chapter 17: Using ZODB with Leo for details.
- The leoOPML plugin defines commands to read and write OPML files.
- The slideshow plugin allows Leo to run slideshows defined by @slideshow and @slide nodes.
- The leo_to_rtf and leo_to_html plugins create rtf and html files from Leo outlines.
- Much faster navigation through the outline using Alt-arrow keys.
- When focus is in the outline pane, you can move to headlines by typing the first letter of headlines.
- The find command now closes nodes not needed to show the node containing the present match.
- Numerous changes that make Leo easier to use without using a mouse.
- Many new minibuffer commands now appear in the Cmds menu.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20060928172525.81: *6* The 'big reorg':  vnode, tnode and position classes are independent of the rest of Leo
What I did:

- Removed c argument from t, v and p ctors.
- Removed c argument from most position methods.
    - In particular, p.link, p.unlink, v.link and v.unlink no longer update c.currentPosition()
    - Moved all position methods that still had a c argument to the Commands class.
- Removed p.all_positions.
- Added c.findRootPosition and c.findRootVnode.
- c.rootPosition now returns c.findRootPosition(c.currentPosition())

As a result:

- The tnode, vnode and position classes are *completely* independent of Leo.
  In particular, no tnode, vnode or position method gets a c argument.
- The p.link, p.unlink, v.link and v.unlink are significantly simpler.
- The machinery for keeping the root position up-to-date is
  simple and confined to one place in the Commands class.
#@+node:ekr.20060928195040: *6* New features
#@+node:ekr.20060928194633.1: *7* myLeoSettings.leo
The myLeoSettings.leo file is a way of ensuring that your customized settings are not altered when updating Leo from cvs or while installing a new version of Leo.  The myLeoSettings.leo acts much like Python's site-customize.py file.  The myLeoSettings.leo file will never be part of any Leo distribution, and it will never exist in Leo's cvs repository.  This solution is *much* better than trying to update leoSettings.leo with scripts.

Leo loads settings from myLeoSettings.leo *after* loading settings from leoSettings.leo files but *before* loading settings from the .leo file being opened.
#@+node:ekr.20060928172525.195: *7* Created simple support for ZODB databases
@nocolor

My present thinking is that scripts should be able to store/retrieve persistent
objects to/from the zodb. That is, the zodb plugin is likely to be retired.

Leo's vnode and tnode classes now derive from ZODB.Persistence.Persistent if
leoNodes.use_zodb is True. It remains to be seen whether having use_zodb = True
will cause any serious problems.

See the posting below (Scripting using zodb) for latest details.

See the node 'zodb get/put buttons' in test.leo for examples of how scripts can access zodb easily.

Created g.init_zodb and v.detach.
#@+node:ekr.20060928172525.197: *8* Scripting using zodb
> Do you see zodb as persisting Leo files or Leo nodes?

Interesting question.  I now see the zodb plugin as a proof-of-concept for *user-defined* scripts.  The zodb plugin is probably going to go away.

Let us suppose that db is a ZODB.DB instance. (To see how to create such an instance, see the init_zodb method in the zodb plugin.  Perhaps I'll defines something like g.openZodb to make this easier.)  Then the statements:

connection = db.open()
root = connection.root()
root[aKey] = v
get_transaction().commit()
connection.close()

will write all of v's data (all vnodes and tnodes) to the zodb.  This is true whatever v is: it can be the root of an entire outline, or any suboutline.  If you want to write a single node, you would have to 'detach' that node from the outline.  You can do this by copying the node and then unlinking the node from its descendants. Perhaps I could add a convenience method to the vnode class to make this easier.

>Do you see zodb work as providing enhanced access to nodes across multiple files?

Scripts could do so easily.  Happily, the distinction between 'long-lived' and 'short-lived' connections is not important for scripts: a script should hold a connection open only for as long as needed.  So it would be easy to write any number of vnode trees to the zodb.  Later, another script could access any of the data in the zodb by zodb key.  Like this:

connection = db.open()
root = connection.root()
v = root.get(aKey)
p = leoNodes.position(v,[])

After running this script, p is a position representing the root of the tree of 'imported' vnodes.  The script above does not 'connect' the imported trees to an outline, nor should it do so.  As I write this, I realize that the position ctor should make the second argument optional, so that leoNodes.position(v) would be equivalent to leoNodes.position(v,[]).

Each script should open at most connection at a time and be sure to close any zodb connection it creates.  The proper way to do this is in a finally statement, like this:

try:
....connection = db.open()
....root = connection.root()
....v = root.get(aKey)
....p = leoNodes.position(v,[])
....<< do something with the nodes in p's tree>>
finally:
....get_transaction().commit()
....connection.close()

In short, the recent changes to Leo's vnode and tnode classes give scripts the ability to save/retrieve Leo data to/from the zodb in any way a script wants, without any further support from Leo, or from me.

I shall spend an hour or two more with the zodb plugin, but it looks to me that the plugin has served its purpose.  Rather than trying to guess how people will want to use the zodb, it will be simpler and more general to have people write scripts that do exactly what they want.  In particular, such scripts can easily sidestep the problems with multiple open connections.

Edward

P.S. Please note that the scripts shown above could not have been written without all the recent work with the zodb plugin and the big code reorg.

P.P.S. A couple of unit tests involving the new v/t.__hash__ methods just failed, so it may be just a little bit longer before the code on cvs is truly zodb ready.  I'll also be working on example scripts and the convenience methods described above.

EKR
#@+node:ekr.20060928172525.172: *7* Improved help-for-command
It now prints the binding for the command.
#@+node:ekr.20060928172525.180: *7* Improved  quick-find commands
Rewrote moveWordHelper. It now avoids Tk and regexes.  *Much* simpler.
#@+node:ekr.20060928172525.198: *7* Improved how Leo works w/o the mousre
- Removed all modes except Alt-C mode.
- Use Shift-arrows for outline moves when focus is in outline pane.
- Put help / apropos commands in help menu.
- Put focus commands in Cmds menu.
- When focus is in outline, normal character navigates like Windows explorer.
- Put Scrolling commands in Cmds menu.
- Screened out(some) unwanted characters from affecting outline navigation.More work is needed.
- Esc character is never inserted into text.
- Replaced @button clones-tab with @command clones-tab.
- Scripting plugins now sets verbose=True so @commands get shown.
* Alt keys (outline move commands) should set focus to outline even if nothing else happens.
- Closing a window no longer puts focus in limbo: added force argument to c.set_focus.
- New gui bindings: (I should actually be able to remember these).
    cycle-all-focus                     = Alt-Y
    contract-pane                       = Alt+Ctrl+-
    expand-pane                         = Alt+Ctrl-=
    focus-to-tree                       = Alt-space
    scroll-outline-down-page            = Alt-PageDn
    scroll-outline-down-page            ! tree = PageDn
    scroll-outline-up-page              = Alt-PageUp
    scroll-outline-up-page              ! tree = PageUp
    scroll-outline-left                 = Alt+Ctrl+LtArrow
    scroll-outline-right                = Alt+Ctrl+RtArrow
- Put find-character and back-find-character in Edit:Find menu.
- Use Alt-S,Alt-R for incremental searches.
- Created find-character-extend-selection and back-find-character-extend-selection.
- Added binding (Ctrl-W) and entry in Cmds menu for select-word-at-cursor.
- Added binding (Ctrl-P) for repeat-complex-command.
- Added binding (Ctrl-B) for execute-script.
* Fixed bug in extend mode.
- Added binding (Ctrl-space) for toggle extend mode.
- Removed most cursor move bindings involving ctrl keys. Exception: ctrl-a and ctrl-e.
    ** The idea is that I'll use extend mode instead.
- Stay in outline mode: added @bool stayInTreeAfterEditHeadline setting.
- Added Cmds:Toggle Settings submenu.
- Use emacs names in Cmds menu (and in some other places): allow single item in menu tables.
#@+node:ekr.20060928172525.237: *7* Increased speed of arrow keys
http://sourceforge.net/forum/message.php?msg_id=3935368
#@+node:ekr.20060928172525.240: *7* Find command now collapses nodes during searches
http://sourceforge.net/forum/message.php?msg_id=3935780

This greatly speeds searches that used to open many nodes.
#@+node:ekr.20060928172525.252: *7* Added support  -- comments in @url nodes
http://sourceforge.net/forum/message.php?msg_id=3935981

@url nodes of the form::

    @url -- aComment

now get the actual url from the entire first line of body text.
Such url's need not be quoted if they contain spaces.

#@+node:ekr.20060928172525.167: *7* Added many new commands to Cmds menu
#@+node:ekr.20060928195040.1: *6* New plugins
The following plugins are new in Leo 4.4.2 b2:

leo_to_rtf
leo_to_html
leoOPML  (At present, contained in leoOPML.leo instead of leoPlugins.leo)
paste_as_headlines
slideshow
word_count

The __saxRead__.py plugin is an **experimental** for use by EKR.
It will be folded into Leo's core in the near future.
#@+node:ekr.20061008190655: *5* 4.4.2 beta 2
Leo 4.4.2 beta 2                                  October 9, 2006

Leo 4.4.2 beta 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.2:
----------------------------
- You can now store settings in myLeoSettings.leo without fear of those settings
  being changed by cvs updates or in future versions of Leo.
- Leo's vnode and tnode classes are now completely independent of the rest of Leo.
  Some api's have been changed.  This 'big reorg' and may affect scripts and plugins.
- Leo's vnode and tnode classes can optionally be compatible with ZODB databases,
  i.e., they can optionally derive from ZODB.Persistence.Persistent.
  See Chapter 17: Using ZODB with Leo for details.
- The leoOPML plugin defines commands to read and write OPML files.
- The slideshow plugin allows Leo to run slideshows defined by @slideshow and @slide nodes.
- The leo_to_rtf and leo_to_html plugins create rtf and html files from Leo outlines.
- Much faster navigation through the outline.
- When focus is in the outline pane, you can move to headlines by typing the first letter of headlines.
- The find command now optionally closes nodes not needed to show the node containing the present match.
- Numerous changes that make Leo easier to use without using a mouse, including new commands and options.
- Many new minibuffer commands now appear in the Cmds menu.
- A sax parser can now optionally read .leo files.
- Fixed numerous bugs.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20061008190633.248: *6* Bugs
#@+node:ekr.20061008190633.249: *7* Fixed rst3 problem
http://sourceforge.net/forum/message.php?msg_id=3932641

LEO *always* outputs the first line of a node without indentation even if it is indented in the node.
#@+node:ekr.20061008190633.250: *7* Fixed apparent bug in pmw
This was a very weird one.  It's not clear why it wasn't biting before.

Traceback (most recent call last):
  File "c:\prog\tigris-cvs\leo\src\leo.py", line 321, in <module>
    run(fileName)
  File "c:\prog\tigris-cvs\leo\src\leo.py", line 151, in run
    g.app.gui.runMainLoop()
  File "c:\prog\tigris-cvs\leo\src\leoTkinterGui.py", line 182, in runMainLoop
    self.root.mainloop()
  File "c:\python25\lib\lib-tk\Tkinter.py", line 1023, in mainloop
    self.tk.mainloop(n)
  File "C:\prog\tigris-cvs\leo\extensions\Pmw\Pmw_1_2\lib\PmwBase.py", line 1756, in __call__
    _reporterror(self.func, args)
  File "C:\prog\tigris-cvs\leo\extensions\Pmw\Pmw_1_2\lib\PmwBase.py", line 1782, in _reporterror
    msg = exc_type + ' Exception in Tk callback\n'
TypeError: unsupported operand type(s) for +: 'type' and 'str'
#@+node:ekr.20061008190633.257: *7* Fixed various unicode word-select problems
- created g.isWordChar.  It does proper test for letters and numbers.
- Used g.isWordChar in extendToWord and moveWordHelper.
- OnBodyDoubleClick now just calls c.editCommands.extendToWord.

So Russian characters, e.g., no longer 'interrupt' words.

Another fix: extend-to-word now works properly at the very end of a word.
#@+node:ekr.20061008190633.261: *7* Installed installer patch
Installer does not complain about missing Python and does not install anything
either. Here is a fix to this behavior. In most user-friendly way it would be
better to provide a clickable link to Python site and a way to specify the path
manually, but for now it is just that - a fix.
#@+node:ekr.20061008190633.262: *7* Use letter accellerators for recent files after 9
#@+node:ekr.20061008190633.264: *7* Made yank work in minibuffer
w was set to self.w, rather than event.widget.
#@+node:ekr.20061008190633.265: *7* Mass change to edit commands: made sure w is a text widget
Added self.editWidget.  This sets self.w and makes sure w is a text widget.
#@+node:ekr.20061008190633.283: *7* Do full recolor after cut/paste/yank
This fixes a long-standing, annoying bug.
#@+node:ekr.20061008190633.294: *7* Fixed crash when pasting a node
The solution was to call setTimestamp if needed in getNewIndex.

#@+node:ekr.20061008192040: *6* Settings
#@+node:ekr.20061008190633.298: *7* Completed support for myLeoSettings.leo
New in beta 2: Leo looks for myLeoSettings.leo files in the same place Leo looks for leoSettings.leo files.
#@+node:ekr.20061008190633.306: *7* Added settings for all mod_scripting switches
#@+node:ekr.20061008190633.307: *7* Added @bool collapse_nodes_during_finds
http://sourceforge.net/forum/message.php?msg_id=3935780

This greatly speeds searches that used to open many nodes.

Added support for @bool collapse_nodes_during_finds setting.
#@+node:ekr.20061008190633.325: *7* Added @bool outline_pane_has_initial_focus
#@+node:ekr.20061008190633.362: *7* Added @bool sparse_move_outline_left





#@+node:ekr.20061008190633.360: *7* Added bindings for Alt-Shift-Arrow keys to force an outline move
#@+node:ekr.20061009112808: *7* Added @bool use_sax_based_read
True:  Use a sax-based parser to read .leo files.
       This is slower than using Leo's legacy xml parser, but may solve some unicode problems.

False: Use Leo's legacy xml parser code.
#@+node:ekr.20061008192040.1: *6* New commands
#@+node:ekr.20061008190633.354: *7* Added extend-to-line command
#@+node:ekr.20061008190633.356: *7* Improved print-bindings command
The bindings are sorted by prefix: this is a big help in understanding bindings.
For each prefix, first print items with only a single character after the prefix.
#@+node:ekr.20061008190633.364: *7* Created extend-to-sentence and extend-to-paragraph commands
Possibly define kill-sentence and kill-paragraph in terms of these.
#@+node:ekr.20061008190633.371: *7* Created runEditCommandTest
#@+node:ekr.20061008190633.295: *6* Features
#@+node:ekr.20070622180342: *7* Added chapters
- Added support for chapters to Leo's core

  Chapters are regions of a Leo outline whose root is an @chapter node. @chapter
  nodes may appear anywhere in an outline, but the create-chapter command (see
  below) creates @chapter nodes as children of a single @chapters node.

  Selecting a chapter shows only then nodes in the selected chapter; in this
  respect, chapters are like hoists. The main chapter represents the entire
  outline and can not be deleted by name. When chapters are in effect, Leo
  creates a hidden @chapters node containing one @chapter node for every chapter
  except the 'main' chapter.

  Associated settings:

  - The @bool use_chapters setting determines whether chapters are enabled.
  - The @bool use_chapter_tabs setting determines whether the chapters
    pop-up menu appears in the icon area. Choosing a chapter name from this list selects a chapter.

  When chapters are enabled, the Cmds:Chapters menu shows all available chapter commands:

  - The create-chapter command creates an @chapter node and with a single node.
  - The delete-chapter command deletes the presently selected chapter.
  - The select-chapter command makes only the nodes of the selected chapter visible.
  - The move-node-to-chapter, clone-node-to-chapter and copy-node-to-chapter commands
    add a node (and its descendants) to another chapter.
#@+node:ekr.20061008190633.296: *7* Improved the mod_scripting plugin
- Make showing the Run Script button optional.
- The Script Button button now creates the press-script-button-button command.
- A new utility method does a much better job of massaging button and command names.
#@+node:ekr.20061008190633.297: *7* rst3 plugin now registers the rst3-process-tree command
#@+node:ekr.20061008190633.311: *7* Made writing .leo files faster
The code that writes .leo files is now almost exactly twice as fast as the old code.
#@+node:ekr.20061008190633.347: *7* Generalized navigation in outline pane to ignore @file, @thin, etc prefixes
#@+node:ekr.20061008190633.351: *7* Made outline navigation cumulative
http://sourceforge.net/forum/message.php?msg_id=3941670

The code on cvs now supports the 'extended' character search. When keystrokes
(in the outline pane) are typed 'close' together in time Leo first tries to look
for prefix + ch, where ch is the character just typed and prefix is the previous
match.

By 'close together' I mean the time interval specified by the new setting:

@float outline_nav_extend_delay = 2.0

The unit of time is seconds.

The outline nav search revers to a single-character if the extended search
fails, so in fact the delay is not too significant. In practice everything works
well without me thinking at all about what is happening.
#@+node:ekr.20061008190633.353: *7* added p.archivedPosition
#@+node:ekr.20061008190633.382: *7* (Integrated sax with read logic)
#@+node:ekr.20061009074305: *6* Leap 204. "New" positions allow Leo outlines to represent arbitrary directed graphs
See: http://sourceforge.net/forum/forum.php?thread_id=1587064&forum_id=10226

Leo's theory of relativity

1. We can archive any position p by saving the list [p.childIndex() for p in
   p.self_and_parents_iter()]. Let us call the *reverse* of this list the
   **parents index list**. Clearly, this list provides an unambiguous way of
   reaching position p from the root node. Archived positions, like all other
   positions, become invalid when the outline changes. 

2. Leo's position class can be based on parents index lists. Let us call such
   positions **new positions**. Replacing legacy positions with new position
   will have important benefits: 

- The only structure information in vnodes will be a v.links field. Two
  interpretations of v.links are possible. When Leo's data is a DAG (the clone
  world), v.links is a lists of v's children. This is the legacy world we all
  know and love. When Leo's data is an arbitrary graph, v.links is simply the
  list of all vnodes to which v points, with *no* necessary restrictions on what
  nodes may be contained in v.links. 

- New positions provide a self contained way of traversing an arbitrary graphs
  **largely independently** of the data. This is Leo's theory of relativity. The
  notions of 'parent' and 'sibling' have meaning *only* in the context of a
  particular position. The v.links field appears to be the absolute minimum
  amount of structure information that vnodes must contain. v.links defines the
  children or linked-to nodes in a general graph. 

- Leo's data can be considered an unrooted tree: *any* node could be considered
  the root. New positions provide enough information to traverse an arbitrary
  graph starting at any node. 

- The fundamental p.moveToX methods should be significantly faster. All of Leo's
  iterators use p.moveToX methods. 

3. The changeover to new positions can be done easily. Initially, the api of the
   new position class will be identical to the api of the present position
   class. Later, the api for the new position class might be extended in an
   upward compatible manner. The api's for the vnode and tnode class will remain
   strictly unchanged. 

4. These changes imply no change to the separation of data into vnodes and
   tnodes. This separation is required to handle clones. Furthermore, the format
   of .leo files is a separate issue from the internal representation of Leo's
   data, as proved by the opml plugin. Thus, the transition to new positions
   will have *no* effect on file formats, and no effect of scripts. All scripts
   will continue to work *exactly* as they have before, *except* scripts, e.g.
   unit tests, that probe Leo's internals. 

Summary 

Leo's theory of relativity is this: the position class provides a 'frame of
reference' for traversing data. **Only in a particular frame of reference** do
the notions of 'parent' and 'siblings' have meaning. Leo's theory of relatively
is the ultimate expression of LeoUser's notion of a 'sea of nodes'. It provides
a solid context on which to base traversals of either outlines with clones
(DAG's) or general directed graphs. 

Leo's position class, far from being just a technical tool, is important
theoretically. The position class (old or new) provides the essential tool
needed to separate data from traversals of the data. The re-visioning of the
position and vnode classes brings that potential into reality. 
#@+node:ekr.20061020155306: *5* 4.4.2 beta 3
Leo 4.4.2 beta 3                                  October 20, 2006

Leo 4.4.2 beta 3 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

The beta release fixed dozens of bugs and smoothed many rough edges.  There
are no known major bugs in Leo.  This will be the last beta release before
Leo 4.4.2 final.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.2:
----------------------------
- You can now store settings in myLeoSettings.leo without fear of those settings
  being changed by cvs updates or in future versions of Leo.
- Leo's vnode and tnode classes are now completely independent of the rest of Leo.
  Some api's have been changed.  This 'big reorg' and may affect scripts and plugins.
- Leo's vnode and tnode classes can optionally be compatible with ZODB databases,
  i.e., they can optionally derive from ZODB.Persistence.Persistent.
  See Chapter 17: Using ZODB with Leo for details.
- The leoOPML plugin defines commands to read and write OPML files.
- The slideshow plugin allows Leo to run slideshows defined by @slideshow and @slide nodes.
- The leo_to_rtf and leo_to_html plugins create rtf and html files from Leo outlines.
- Much faster navigation through the outline.
- When focus is in the outline pane, you can move to headlines by typing the first letter of headlines.
- The find command now optionally closes nodes not needed to show the node containing the present match.
- Numerous changes that make Leo easier to use without using a mouse, including new commands and options.
- Many new minibuffer commands now appear in the Cmds menu.
- A sax parser can now optionally read .leo files.
- Fixed numerous bugs.

Links:
------
Leo:        http://webpages.charter.net/edreamleo/front.html
What's new: http://webpages.charter.net/edreamleo/new-4-4-2.html
Home:       http://sourceforge.net/projects/leo/
Download:   http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:        http://leo.tigris.org/source/browse/leo/
Quotes:     http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20061020155235.1: *6* Bugs
#@+node:ekr.20061020155235.2: *7* Fixed crash when searching for headllines containing unicode chars
#@+node:ekr.20061020155235.9: *7* Fixed bugs in cycle-all-focus command
#@+node:ekr.20061020155235.27: *7* Fixed bug with Alt-n keys
@command whatever @key Alt-1 didn't work
Actually, no Alt-n keys worked for n in (1,2,3,4,5) in any context.
#@+node:ekr.20061020155235.36: *7* Fix bug: closing a window after removing a script button can crash
#@+node:ekr.20061020155235.37: *7* The end-of-script message no longer yanks focus from tabs
#@+node:ekr.20061020155235.41: *7* Fixed  warning if minibuffer command does not exist when making menus
The warning was disabled due to a programming error (not not)
Enabling this found two errors: view-lossage (missing comma) and
find-with-present-options --> search-with-present-options.
#@+node:ekr.20061020155235.47: *7* Fixed new unicode bug
https://sourceforge.net/forum/message.php?msg_id=3957980

This was a major effort.  What I did:

- Defined g.isWordChar in terms of ch.isalnum()

- Replace almost all instances of string.letters and string.digits by calls to
  ch.isalnum(), ch.isalpha(), ch.isdigit(), etc.

- Similarly, replaced word_chars.

- The new code uses string literals only for

a) small constants like '+-' and
b) constants in a very limited context, as in the input to regexp.
#@+node:ekr.20061020155235.123: *7* Made 'About Plugin' dialog scrollable
http://sourceforge.net/forum/message.php?msg_id=3960993
#@+node:ekr.20061020155235.124: *7* Removed unwanted key-state message
https://sourceforge.net/forum/message.php?msg_id=3961623
#@+node:ekr.20061020155235.126: *7* Made sure all kill commands do a full recolor
#@+node:ekr.20061020155235.149: *7* Fixed bug in new colorizer
Did not restore selection after indent/undent commands.
#@+node:ekr.20061020155235.180: *7* Removed set-mark-command and all calls to removeRKeys
The 'hang' was due to removeRKeys, which removes the bindings create by
setRegion (set-mark-command) by *also* cleared all the other bindings!
For now I have simply disabled the set-mark-command and commented out all
calls to removeRKeys.

Note that toggle-extend-mode (Alt-3) is a good way to define regions.
#@+node:ekr.20061020155235.185: *7* Fixed body editor problems
onFocusIn and its associated binding were a very bad idea.  It is not needed:
k.masterClickHandler simply calls the new onClick method.

What I did:

- Eliminating onFocusIn and its associated binding.
  Hurray: this also fixed the Find problem.
- Fixed problem with deleting nodes when multiple editors are present.
- Fixed minor problem with cycle-all-focus.
- Removed title bar when penultimate editor is deleted.
#@+node:ekr.20061020155235.254: *7* Moved @import to top of doc/default.css
#@+node:ekr.20061020155235.255: *7* Fixed focus problem when double-clicking @url nodes
Double-clicking  @url <leo-file> did not bring Leo file to top.
#@+node:ekr.20061020155235.263: *6* Features
#@+node:ekr.20061020155235.271: *7* Added minibuffer and Settings menus
http://sourceforge.net/forum/message.php?msg_id=3588148

One way to make Leo more newbie friendly is to add menu items for key features
that are likely to cause confusion in the beginning.
#@+node:ekr.20061020155235.292: *7* Toggling autocompleter and calltips now write to log (in red) instead of the statusLine
This is much more visible.
#@+node:ekr.20061020155235.294: *7* Finished collapse-on-move-left
Added support for @bool sparse_move_outline_left

When True, Leo collapses the (former) parent of a node when moving that node left.
Takes getting used to, but I like it.

Note that the move-outline-up/down commands can have the effect of moving an outline left.
#@+node:ekr.20061020155235.304: *7* Properly create Help menu on the Mac
At long last Leo creates a proper help menu on the Mac.
#@+node:ekr.20061020155235.307: *7* '*command-name' in headline means convert '-' to blanks
This would greatly simplify menu entries.
#@+node:ekr.20061020155235.308: *7* Removed all references to commands from menu tables
This is an important step towards making all menus configurable.
#@+node:ekr.20061020155235.335: *7* Add Open scripts.leo to help menu
The open-scripts-leo command.
#@+node:ekr.20061020155235.337: *7* The spell tab now uses ctypes for Python 2.5
#@+node:ekr.20061020155235.385: *7* Simulated x-windows middle-button paste
#@+node:ekr.20061020155235.393: *6* Plugins
#@+node:ekr.20061020155235.394: *7* Fixed keyBindings plugin
http://sourceforge.net/forum/message.php?msg_id=3958380
#@+node:ekr.20061020155235.395: *7* The scripting plugin now creates a delete-x-script-button command for each script button
http://sourceforge.net/forum/message.php?msg_id=3423121
#@+node:ekr.20061020155235.396: *7* Fixed the nodenavigator plugin
http://sourceforge.net/forum/message.php?msg_id=3959003
#@+node:ekr.20061020155235.397: *7* Rewrote the multifile plugin for the 4.x code base.
#@+node:ekr.20061020155235.398: *7* Replaced __name__ with __plugin_name__ in four plugins
http://sourceforge.net/forum/message.php?msg_id=3962632
#@+node:ekr.20061020155235.399: *7* Improved the scripting plugin
- Every button created by the plugin creates a corresponding command. The
command name is the 'cleaned' version of the button name.

- Every button created by the plugin also creates a delete-x-button command,
where x is the command name as just discussed. So now you can delete script
buttons without right-clicking.

- I took the time to revise, refactor, clean up, reorganize and better document
the code. This was overdue: the previous code had grown difficult to understand
through multiple small accretions. I can actually understand the new code.
#@+node:ekr.20061020155235.400: *7* Fixed bugs in multi-file plugin
#@+node:ekr.20061020155235.402: *7* Fix bug in shortcut_button plugin
http://sourceforge.net/forum/message.php?msg_id=3963657
#@+node:ekr.20061020155235.125: *7* Removed datenodes.ini from cvs
No longer needed now that the datenodes plugins gets settings from cvs.
#@+node:ekr.20061020155235.34: *7* Fix bug in ops plugin
http://sourceforge.net/forum/message.php?msg_id=3956836
#@+node:ekr.20061020155235.35: *7* Fixed crasher on script button balloons
http://sourceforge.net/forum/message.php?msg_id=3958333
#@+node:ekr.20061020155235.403: *6* Settings
#@+node:ekr.20061020155235.404: *7* Made unlimited undo the default
As always, you can set max_undo_stack_size in myLeoSettings.leo.
#@+node:ekr.20061020155235.405: *7* Added @bool select_all_text_when_editing_headlines
A highly useful option.
However, creating a new node always selects the entire text, regardless of this option.
#@+node:ekr.20061020155235.410: *7* Added bindings to toggle-autocompleter and toggle-calltips
- Added bindings for toggle-autocompleter (Alt-1) and toggle-calltips (Alt-2)

- Ctrl-. and ctrl-( do not seem to do anything.

** Mystery solved: there was a trace in the calltip logic!

Disabled these binding:

auto-complete-force         = None # This command needs work before it is useful. Ctrl-period
show-calltips-force         = None # This command needs work before it is useful. Alt-parenleft

The problem is that autocompletion depends on state: self.leadinWord,
prevObjects, etc. Thus, it's not presently possible to start the process
anywhere. Similar remarks apply to calltips, which relies on autocompleter
state.

This is a complex problem, and not very serious now that there is an easy way of
toggling autocompleter and calltips on and off. It's been added to a 'later'
section of the to-do list.
#@+node:ekr.20061020155235.411: *7* Added 'Candidates for myLeoSettings.leo' to leoSettings.leo
Added the node: Candidates for settings in myLeoSettings.leo. This lists the
most 'controversial' settings in leoSetting.leo, and is a quick-start to
creating myLeoSettings.leo."
#@+node:ekr.20061020155235.412: *7* Recent changes to settings
- Added shift-ctrl keys to extend the selection.
focus-to-body = Alt-D
focus-to-tree = Alt-T
toggle-extend-mode = Alt-3
#@+node:ekr.20061020155235.413: *7* Added @bool insert_new_nodes_at_end
#@+node:ekr.20061020155235.264: *7* Removed .leoRecentFiles.txt from distribution and cvs
What I did

- @bool write_recent_files_as_needed = True

People who don't want Leo to update .leoRecentFiles.txt can set this to False.

- Remove .leoRecentFiles from cvs
- Remove .leoRecentFiles from distribution list.
#@+node:ekr.20061026095728: *5* 4.4.2 final and 4.4.2.1 final
Leo 4.4.2.1 final                                October 29, 2006

Leo 4.4.2.1 final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.4.2.1 final fixes a recent bug that caused Leo not to create the
.leoRecentFiles.txt file properly in some situations. There are no known
significant bugs in this version of Leo.

Leo 4.4.2 final fixes a few bugs and adds support for pymacs. 

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.2:
----------------------------
- You can now store settings in myLeoSettings.leo without fear of those settings
  being changed by cvs updates or in future versions of Leo.
- Leo's vnode and tnode classes are now completely independent of the rest of Leo.
  Some api's have been changed.  This 'big reorg' and may affect scripts and plugins.
- Leo's vnode and tnode classes can optionally be compatible with ZODB databases,
  i.e., they can optionally derive from ZODB.Persistence.Persistent.
  See Chapter 17: Using ZODB with Leo for details.
- The leoOPML plugin defines commands to read and write OPML files.
- The slideshow plugin allows Leo to run slideshows defined by @slideshow and @slide nodes.
- The leo_to_rtf and leo_to_html plugins create rtf and html files from Leo outlines.
- Much faster navigation through the outline.
- When focus is in the outline pane, you can move to headlines by typing the first letter of headlines.
- The find command now optionally closes nodes not needed to show the node containing the present match.
- Numerous changes that make Leo easier to use without using a mouse, including new commands and options.
- Many new minibuffer commands now appear in the Cmds menu.
- A sax parser can now optionally read .leo files.
- Fixed numerous bugs.

Links:
------
Leo:        http://webpages.charter.net/edreamleo/front.html
What's new: http://webpages.charter.net/edreamleo/new-4-4-2.html
Home:       http://sourceforge.net/projects/leo/
Download:   http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:        http://leo.tigris.org/source/browse/leo/
Quotes:     http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20061026095922.1: *6* Bugs
#@+node:ekr.20061026095922.2: *7* Changed leo_rst.css to pass the w3 validator
#@+node:ekr.20061026095922.3: *7* Fixed 'Run on string' message when typing
#@+node:ekr.20061026095922.15: *7* Fixed problem with c++ extensions
http://sourceforge.net/forum/message.php?msg_id=3971242
#@+node:ekr.20061026095922.17: *7* Move on if regexp matches an empty string
#@+node:ekr.20061026095922.19: *7* Fixed several bugs related to multiple body panes
#@+node:ekr.20061026095922.25: *7* Fixed multipath plugin so it works with new colorizier
The new colorizer was innocent: the problem is that at.directiveKind4 uses leoColor.leoKeywords,
so multipath must add entries to leoColor.leoColors.
#@+node:ekr.20061026095922.32: *7* Fixed bug in new colorizer
It required a space after the '@'
#@+node:ekr.20061026095922.33: *7* Fixed config bug
http://sourceforge.net/forum/message.php?msg_id=3975898
#@+node:ekr.20061026095922.35: *6* New features
#@+node:ekr.20061026095922.51: *7* Added forward-end-word/-extend-selection commands
http://sourceforge.net/forum/message.php?msg_id=3980193

#@+node:ekr.20061026095922.36: *7* Created leoPymacs.py for interaction with pymacs
For full details, see Chapter 18 of Leo's Users Guide: Emacs and Leo.
#@+node:ekr.20070316182323: *4* 4.4.3... winpdb, leoBridge, gui reorg, chapters
#@+node:ekr.20070122070619: *5* 4.4.3 alpha 1
Leo 4.4.3 alpha 1                                  January 26, 2006

Leo 4.4.3 alpha 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Important: the wxGui plugin is still alpha-quality code at present.

The highlights of Leo 4.4.3:
----------------------------
- A functional wxWidgets plugin.
- Removed all gui-dependent code from Leo's core.
- Better support for the winpdb debugger.
- Many minor improvements, new settings and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070122070634.1: *6* Bugs
#@+node:ekr.20070122070634.2: *7* Fixed an escape bug in new colorizer
Example:

print "\\" + " this is a test"

The escape mechanism must treat an even number of trailing escapes as not an escape.
#@+node:ekr.20070122070634.4: *7* Treat escaped characters in find patterns as a single character
#@+node:ekr.20070122070634.13: *7* Fixed undo problems with yank/kill
http://sourceforge.net/forum/message.php?msg_id=3924236

Added unit tests for yank and all kill commands.
#@+node:ekr.20070122070634.40: *7* Fixed clone-drag problem
http://sourceforge.net/forum/message.php?msg_id=3991369

The bindings to f.f.OnControlKeyDown/Up were mistakenly deleted in createOuterFrames.
#@+node:ekr.20070122070634.51: *7* Made sure all ancestors expanded when select a body editor with multiple body editors
#@+node:ekr.20070122070634.54: *7* Fixed bug in CheckVersion
http://sourceforge.net/forum/message.php?msg_id=4112347
#@+node:ekr.20070122070634.305: *6* Code reorg for wxGui plugin
Leo's core is now largely free of gui-dependent code, and should be completely
free of such code by the time Leo 4.4.3 final is released.
#@+node:ekr.20070122070634.58: *6* Features
#@+node:ekr.20070122070634.59: *7* Added handleUrlInUrlNode helper for OnIconDoubleClick
#@+node:ekr.20070122070634.66: *7* Only do one message re writing recent files
#@+node:ekr.20070122070634.69: *7* Made escape in the minibuffer work like ctrl-g
#@+node:ekr.20070122070634.81: *7* Clear status line in repeat-complex-command
This is much less confusing.
#@+node:ekr.20070122070634.82: *7* Added shortcuts for goto-first/last-sibling
#@+node:ekr.20070122070634.83: *7* Made copied nodes valid Leo files
http://sourceforge.net/forum/message.php?msg_id=4014079
#@+node:ekr.20070122070634.89: *7* Added support for chdir_to_relative_path setting
http://sourceforge.net/forum/message.php?msg_id=4005750

I like the option @string relative_path_base_directory = .

which puts @file nodes in the same directory as the current Leo file.

I would like it if 
open('file.txt','w').close()

put file.txt in the same directory as the current Leo file.
#@+node:ekr.20070122070634.91: *7* changeAll now works like findAll
#@+node:ekr.20070122070634.209: *7* Added Find & Spell tabs to log pane on startup

#@+node:ekr.20070122070634.220: *7* Created standard pluginsManager.txt only if it does not exist
http://sourceforge.net/forum/message.php?msg_id=3987635
#@+node:ekr.20070122070634.223: *7* Improved support for the winpdb debugger
New settings

The following two new settings now control whether the execute-script and debug commands write the script to an external file.

- @bool write_script_file = True

True: The execute script command writes the script to be executed to a file, then executes the script using Python's execFile function. The script_file_path setting specifies the path to this file.

False (legacy): The execute script command uses Python's exec command to execute the script. 

- @string script_file_path = ../test/scriptFile.py

The path to the file to be written by the execute-script command.

Notes:

- This setting has effect only if the write_script_file setting is True.
- Use / to as the path delimiter, regardless of platform.
- The default path is ../test/scriptFile.py if no path is given.
- The path starts at g.app.loadDir, so for example ../test/scriptFile.py is equivalent to leo/test/scriptFile.py
- The filename should end in .py.

From here on, let us assume the settings are as shown above.  There are at least three ways of debugging scripts, depending on your preferences and whether the script contains leo-specific code (g, c or p) or not.

First way:  The debug command

The debug command now works almost exactly like Kent's original @button node. This way of debugging can only be used for general scripts, not leo-specific scripts.  

The debug command writes the script to scriptFile.py and invokes the debugger as specified by the existing @string debugger_kind option.  winpdb opens and is already 'attached' to the script to be debugged.  You can single-step as you like.  Leo continues to run, but killing the debugger will also kill Leo.  When started this way, winpdb is really 'attached' to *all* of Leo, which means you can single step past the end of the script into Leo's executeScript code and from there into all of Leo(!)

As I write this I realize that the code uses arguments specific to winpdb.  That may have to be generalized, though I am not sure why anyone would want to use another debugger...

Second way: @button winpdb

This is almost exactly equivalent to the debug command, except that the script file must be *different* from the script file specified by the  script_file_path setting (The @button code *itself* uses the execute-script command, so we have to pass the script code, not the @button code to the debugger).

Third way: The execute-script command with explicit debugger breaks

The third way of debugging scripts allows winpdb to debug scripts that use c, g and p.  I'm actually not sure of exactly how and why it works, but it certainly does work.

In contrast to the previous two ways, a little more work is needed because winpdb does not start automatically.  But I am getting ahead of myself.

To use this way, insert the following two lines of code at the start of the script to be debugged::

import rpdb2
rpdb2.start_embedded_debugger('go',fAllowUnencrypted=True)

Now just execute the execute-script command (*not* the debug command)  Leo will appear to hang.  Indeed, the  start_embedded_debugger command is waiting for *another* copy of winpdb to 'attach' to the script's process.  This process is all of Leo!  The default timeout is 5 minutes: I'm not sure what happens when the timeout happens: probably an exception gets thrown.

So you must start winpdb explicitly.  On XP just do something like

python c:\python25\Scripts\_winpdb.py -t

The -t option tells winpdb that no encoding of password is necessary.  The password is specified in the call to rpdb2.start_embedded_debugger in your script.  In this example, the password is 'go'.  Use the File:Attach command in winpdb to attach winpdb to Leo.  Specify the password as 'go' and you will see the scriptFile.py containing your entire script.  You can execute or single-step through the script. 

To repeat, the big difference is that c, g and p are defined, so you can debug any script this way.  As before, killing winpdb also kills Leo.

P.S.  winpdb and its documentation has been improved recently.  See

http://www.digitalpeers.com/pythondebugger/  and especially

http://www.digitalpeers.com/pythondebugger/embedded.htm

The discussion of embedded debugging may have been written specifically with Leo in mind.  It certainly could have been.
#@+node:ekr.20070122104240: *7* Added \runAskOkCancelStringDialog
http://sourceforge.net/forum/message.php?msg_id=4113315
#@+node:ekr.20070122070634.298: *6* Plugins
#@+node:ekr.20070122072110: *7* The wxGui plugin is now functional
#@+node:ekr.20070122070634.299: *7* Changed bindings in UniversalScrolling pluing
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3991223

I assigned both Control and Shift modifiers to do scrolling: this is so my
finger can hit a key in the lower left corner of the keyboard, and I don't have
to worry too much about my aim (I have LARGE fingers). Also, I stop the
scrolling on the JUST button release -- less worry about my finger slipping off
the key.
#@+node:ekr.20070122070634.300: *7* Registered write-restructured-text command in rst3 plugin
#@+node:ekr.20070122070634.301: *6* Settings
#@+node:ekr.20070122070634.302: *7* Added @bool center_selected_tree_node
@nocolor

http://sourceforge.net/forum/message.php?msg_id=3916155

When a node is among several other nodes at the same level of hierarchy, which
are all children of a node, and the "MOVE LEFT" command is executed, the node
does move left in the outline hierarchy, but it also move down to just before
the next node at the higher hierarchy level - the level to which it is moving
left.

EKR: I love this new option: how did we ever live without it?

@color
#@+node:ekr.20070122070634.303: *7* Added @bool invisible_outline_navigation = False
@nocolor

This option tells how to treat an uppercase letter typed when the outline pane
is active but no headline is being edited. In such situations Leo searches for an
node whose headline starts with the present prefix, ignoring case The prefix
starts with the first letter typed and other letters are added if they are typed
within a 'short' period of time, as specified by the outline_nav_extend_delay

True: Look in invisible nodes.
False: Look only in visible nodes.

I set this option to False because it is too easy form me to type Shift-whatever
when I meant Ctrl-whatever.

@color
#@+node:ekr.20070122070634.304: *7* Added @bool show_full_tracebacks_in_scripts
http://sourceforge.net/forum/message.php?msg_id=3985382

#@+node:ekr.20070316182323.1: *5* 4.4.3 alpha 2
Leo 4.4.3 alpha 2                                  March 17, 2006

Leo 4.4.3 alpha 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version of Leo should be safe enough for production use. It is an alpha
distribution because not all plugins have been tested on the reorganized code
base.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.3:
----------------------------
- A leoBridge module that allows full access to all of Leo's capabilities
  from programs running outside of Leo.
- Added support for @enabled-plugins nodes in settings files.
- The__wx_gui plugin is now functional.
- Removed all gui-dependent code from Leo's core.
- Better support for the winpdb debugger.
- Many minor improvements, new settings and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070316182341.1: *6* Fixed Bugs
#@+node:ekr.20070316182341.2: *7* Fixed bugs in undo/redoNodeContents
#@+node:ekr.20070316182341.6: *7* Fixed minor xml problem
@nocolor
http://sourceforge.net/forum/message.php?msg_id=4132529

I'm generating Leo files with ElementTree and ran into a minor issue.

ElementTree generates an empty tag with a space before the closing slash:

<globals />

in Leo's code for dummy elements to allow copied nodes to be valid Leo files,
the empty tags are generated without the space

leoFileCommands.py 2917
        self.put('<globals/>\n')
        self.put('<preferences/>\n')
        self.put('<find_panel_settings/>\n')

it then checks for these tags in getDummyElements() leoFileCommands.py 1298

Since ElementTree has the space before the slash, 
it's XML is considered invalid by Leo according to
this test.

I would like it if the space could be added in Leo's
self.put(...) and the check in getDummyElements()

The XML specs show the space as optional.

@color
#@+node:ekr.20070316182341.10: *7* Fixed C++ import bug
http://sourceforge.net/forum/message.php?msg_id=4134384
#@+node:ekr.20070316182341.39: *7* Fixed recent bug in next-line command
Down arrow wasn't handled properly.
#@+node:ekr.20070316182341.41: *7* Made standalone plugins manager work again
#@+node:ekr.20070316182341.42: *7* Fixed wiki markup bug
http://sourceforge.net/forum/message.php?msg_id=3994218
#@+node:ekr.20070316182341.43: *7* Fixed bugs in regular expressions
#@+node:ekr.20070316182341.54: *7* Fixed memory error in leoBridge
#@+node:ekr.20070316182341.56: *7* Fixed backspace in headline bug
# The buggy code only happens when there is no binding for backward-delete-char.
# http://sourceforge.net/forum/forum.php?thread_id=1681392&forum_id=10227
#@+node:ekr.20070316182341.66: *7* Made sure alt-arrow keys honor focus settings
#@+node:ekr.20070316182341.112: *7* Fixed bug in nav button plugin
It's about Nav_buttons v1.5 (cvs version from last Saturday) 

Pressing the green back button causes 

Error: 1 
AttributeError Exception in Tk callback 
Function: <bound method Commands.goPrevVisitedNode of Commander 39717104: u'F:\\D\\PIM\\PIM_main.leo'> (type: <type 'instancemethod'>) 
Args: () 
Traceback (innermost last): 
File "F:\C\Programs\Leo_cvs\extensions\Pmw\Pmw_1_2\lib\PmwBase.py", line 1752, in __call__ 
return apply(self.func, args) 
File "F:\C\Programs\Leo_cvs\src\leoCommands.py", line 4435, in goPrevVisitedNode 
c.treeCommandHelper(v) 
AttributeError: Commands instance has no attribute 'treeCommandHelper' 
#@+node:ekr.20070316182341.113: *7* Fixed yet another cursor down bug
http://sourceforge.net/forum/message.php?msg_id=4201463
#@+node:ekr.20070316182341.137: *7* Improved special case in moveOutlineUp
http://sourceforge.net/forum/message.php?msg_id=4205072
#@+node:ekr.20070316182341.138: *7* Fixed crasher in rclicker plugin
Traceback (most recent call last):

  File "c:\prog\tigris-cvs\leo\src\leoGlobals.py", line 2474, in doHook
    return f(tag,keywords)

  File "c:\prog\tigris-cvs\leo\src\leoPlugins.py", line 92, in doPlugins
    return doHandlersForTag(tag,keywords)

  File "c:\prog\tigris-cvs\leo\src\leoPlugins.py", line 70, in doHandlersForTag
    val = callTagHandler(bunch,tag,keywords)

  File "c:\prog\tigris-cvs\leo\src\leoPlugins.py", line 49, in callTagHandler
    result = handler(tag,keywords)

  File "C:\prog\tigris-cvs\leo\plugins\rClick.py", line 156, in rClicker
    n0,p0=ind0.split('.',2)

AttributeError: 'int' object has no attribute 'split'
#@+node:ekr.20070316182341.139: *7* Fixed recent problem with settings report
Leo did not write to the log pane that settings, either present
in myLeoSettings.leo or the current file, were read.
#@+node:ekr.20070316182341.437: *6* New Features
#@+node:ekr.20070316182341.440: *7* Added leoBridge module
The leoBridge module allows complete access to all aspects of Leo from programs
running independently of Leo. Let us call such a program a **host** program.
Using the leoBridge module, foreign programs can get access to:

- all of Leo's source code,
- the contents of any .leo file,
- the commander of any .leo file.

Host programs use the leoBridge module as follows::

    import leoBridge
    controller = leoBridge.controller(gui='nullGui')
    g = controller.globals()
    c = controller.openLeoFile(path)

Let us look at these statements in detail.  The statements::

    import leoBridge
    controller = leoBridge.controller(gui='nullGui')

import the leoBridge module and create a **bridge controller**. In effect, these
statements embed an 'invisible' copy Leo into the host program. This embedded
copy of Leo uses a 'null' gui, which simulates all aspects of Leo's normal gui
code without creating any screen objects.

The statement::

    g = controller.globals()

provides access to Leo's leoGlobals module, and properly inits globals such as g.app, g.app.gui, etc.  Host programs **should not** import leoGlobals directly, because doing so would not init the g.app object properly.

The statement::

    c = controller.openLeoFile(path)

invisibly opens the .leo file given by the path argument. This call returns a
completely standard Leo commander, properly inited. This is the big payoff from
the leoBridge module: the host program gets instant access to c.config.getBool,
etc. Do you see how sweet this is?

The following script runs leo/test/leoBridgeTest.py outside of Leo.
leoBridgeTest.py uses the leoBridge module to run all unit tests in leo/test/unitTest.leo.
Try it::

    import os,sys

    path = g.os_path_abspath(
        g.os_path_join(
            g.app.loadDir,'..','test','leoBridgeTest.py'))

    os.system('%s %s' % (sys.executable,path))
#@+node:ekr.20070316182341.723: *7* Added support for @enabled-plugins in settings files
Any .leo file may now contain an @enabled-plugins node as a child of an
@settings node.

Notes:

A) Leo attempts to load all plugins every time an @enabled-plugins node is seen.
   If the plugin has already been loaded, Leo silently ignores the
   request to re-enable the plugin.
   Leo never attempts to disable a plugin while processing enabled plugin
   strings. Thus, plugins enabled in an @enabled-plugins node in leoSettings.leo
   *will* be enabled regardless of the contents of any other @enabled-plugins node.

B) The default plugins will be enabled in an @enabled-plugins
   node in leoSettings.leo.

C) g.app.gui.getEnabledPlugins contains the last value last processed @enabled-plugins node.
#@+node:ekr.20070316182341.718: *7* Added new search path for pluginsManager.txt
http://sourceforge.net/forum/message.php?msg_id=4169720
#@+node:ekr.20070316182341.155: *7* Made Leo's core gui-indenpendent
#@+node:ekr.20070316182341.438: *7* Warn on dubious section brackets
http://sourceforge.net/forum/message.php?msg_id=4162357
#@+node:ekr.20070317044545: *6* Plugins
The __wx_gui.py plugin is now minimally functional. All significant unit tests
pass with this plugin in effect. However, problems remain. See the bug list in
the plugin for details.
#@+node:ekr.20070513111132: *5* 4.4.3 beta 1
Leo 4.4.3 beta 1                                May 18, 2006

Leo 4.4.3 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.3:
----------------------------
- Added support for chapters in Leo's core.
  Chapters are disabled by default.  To enable, set @bool use_chapters = True.
- Added support for zipped .leo files.
- Added a leoBridge module that allows full access to all of Leo's capabilities
  from programs running outside of Leo.
- Removed all gui-dependent code from Leo's core.
- Better support for the winpdb debugger.
- Added support for @enabled-plugins nodes in settings files.
- Added support for @open-with nodes in settings files.
- The__wx_gui plugin is now functional.
- Many minor improvements, new settings, commands and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070513111526.1: *6* New features
#@+node:ekr.20070513112414: *7* Added support for chapters to Leo's core
- Added support for chapters to Leo's core

  Chapters are regions of a Leo outline whose root is an @chapter node. @chapter
  nodes may appear anywhere in an outline, but the create-chapter command (see
  below) creates @chapter nodes as children of a single @chapters node.

  Selecting a chapter shows only then nodes in the selected chapter; in this
  respect, chapters are like hoists. The main chapter represents the entire
  outline and can not be deleted by name. When chapters are in effect, Leo
  creates a hidden @chapters node containing one @chapter node for every chapter
  except the 'main' chapter.

  Associated settings:

  - The @bool use_chapters setting determines whether chapters are enabled.
  - The @bool use_chapter_tabs setting determines whether the chapters
    pop-up menu appears in the icon area. Choosing a chapter name from this list selects a chapter.

  When chapters are enabled, the Cmds:Chapters menu shows all available chapter commands:

  - The create-chapter command creates an @chapter node and with a single node.
  - The delete-chapter command deletes the presently selected chapter.
  - The select-chapter command makes only the nodes of the selected chapter visible.
  - The move-node-to-chapter, clone-node-to-chapter and copy-node-to-chapter commands
    add a node (and its descendants) to another chapter.
#@+node:ekr.20070513111526.2: *7* Added @bool force_newlines_in_at_nosent_bodies setting
It is True by default. In effect, this setting was False in previous versions
of Leo, which might be considered a bug.
#@+node:ekr.20070513111526.7: *7* Added apropos-debugging-commands command
#@+node:ekr.20070513111526.8: *7* Added print-plugins & print-plugin-handlers commands
#@+node:ekr.20070513111526.10: *7* Added print-settings command
#@+node:ekr.20070513111526.14: *7* Added support for @openwith nodes in leoSettings.leo
http://sourceforge.net/forum/message.php?msg_id=3737745

http://sourceforge.net/forum/message.php?msg_id=3785897

Would it be possible to have the table of "Open With" editors to be part of
the config system? I find myself patching the list every time I D/L a new Leo
version to add the editor I use. This would also help isolate the user from
the "guts" of Leo, thereby being less intimidating.
#@+node:ekr.20070513111526.39: *7* Created clean-all-lines command
#@+node:ekr.20070513111526.42: *7* Support for compressed .leo files
Leo now supports zipped .leo files:

- Leo now has save-file-as-zipped and save-file-as-unzipped commands, and
corresponding Save File As Zipped and Save File as Unzipped items in the File
menu. These are exactly the same as Leo's Save As commands except that they
temporarily force Leo to write the file in either zipped or unzipped format.

- Leo remembers whether a file was originally zipped. The read logic handles
either zipped or unzipped .leo files automatically. The write logic will zip the
file if it was originally zipped or if the save-file-as-zipped command is being
executed.

- Leo writes files with .leo extension, regardless of whether the file is zipped
or not. Zipped .leo files contain a single archive, whose name is the same as
the .leo file itself.

Notes:

- The new save commands suffice to compress and expand .leo files on a
file-by-file basis. In particular, there is no need for any user settings.

- Outside of Leo you can change the extension to .leo.zip and use stuffit or
other program to expand the .leo file contained within. I've only tested this on
XP, but it should work everywhere...

- At present the code uses Python's zipfile module to read and write zipped files.
In turn, the zipfile module uses the zlib module to do the compression.
Conceivably somebody might want Leo to use some other compression technique, say
Python's tarfile module. However, I think the present way should suffice for
most people.
#@+node:ekr.20070513111526.77: *6* Fixed bugs
#@+node:ekr.20070513111526.78: *7* Fixed bug: new-file doesn't allow edit of initial headline
# Found via unit test.  Happens regardless of chapters.
#@+node:ekr.20070513111526.80: *7* Removed all returns from finally clauses
# Returns in finally clauses prevent the re-raising of the saved exception(!!)
#@+node:ekr.20070513111526.105: *7* Fixed repeatComplexCommand weirdness
#@+node:ekr.20070513111526.198: *7* Fixed minor chapter hoist bug
http://sourceforge.net/forum/message.php?msg_id=4215654

There was a bug with ordinary hoisting: in the "Outline" menu the "Delete Node"
menu item was not disabled when the local root is selected.
#@+node:ekr.20070513111526.200: *7* Fixed crasher in plugins_menu.py
#@+node:ekr.20070610063456: *5* 4.4.3 beta 2
Leo 4.4.3 beta 2                                June 12, 2006

Leo 4.4.3 beta 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.3:
----------------------------
- Added support for chapters in Leo's core.
  Chapters are disabled by default.  To enable, set @bool use_chapters = True.
- Added support for zipped .leo files.
- Added a leoBridge module that allows full access to all of Leo's capabilities
  from programs running outside of Leo.
- Removed all gui-dependent code from Leo's core.
- Better support for the winpdb debugger.
- Added support for @enabled-plugins nodes in settings files.
- Added support for @open-with nodes in settings files.
- Added support for @bool write_strips_blank_lines setting.
- The__wx_gui plugin is now functional.
- Leo can use aspell on Linux when using Python 2.5 or later.
- Many minor improvements, new settings, commands and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070610063538.1: *6* Fixed bugs
#@+node:ekr.20070610063538.2: *7* Fixed noweb hangs
http://sourceforge.net/forum/message.php?msg_id=4315027

The fix was to g.skip_to_end_of_line (!)

All such functions now return len(s) as a boundary condition.
This is a major change.  All unit tests pass.
#@+node:ekr.20070610063538.151: *7* Alt-4 did not work in tree pane in unitTest.leo
#@+node:ekr.20070610063538.163: *7* Investigated problem with subprocess (works for me)
http://sourceforge.net/forum/message.php?msg_id=4320971
#@+node:ekr.20070610063538.164: *7* Fixed crashers in leoupate plugin
@nocolor

http://sourceforge.net/forum/message.php?msg_id=4309448

Still to do: update urls for tigris.
#@+node:ekr.20070610063538.165: *7* Fixed automatic directory creation
http://sourceforge.net/forum/message.php?msg_id=4301021
#@+node:ekr.20070610063538.168: *7* Fixed bug: shift-arrow keys not bound properly when node is clicked
- Select a node by clicking on it.
- The node is selected, but shift-arrow does not work.

However, clicking the canvas does work.

The fix was to give the canvas, not the headline focus when clicking on a headline.
This results in canvas bindings, not text bindings, having priority.
This is not a kludge: the text widget isn't active, so text bindings should not be in effect.
#@+node:ekr.20070610063538.171: *7* Made sure the new outlines aren't marked dirty
#@+node:ekr.20070610063538.175: *7* Fix crasher in maximizeNewWindows
http://sourceforge.net/forum/message.php?msg_id=4340244
#@+node:ekr.20070610063538.209: *7* Don't change focus in the save command
http://sourceforge.net/forum/message.php?msg_id=4341644
#@+node:ekr.20070610063538.212: *7* downcase-region and upcase-region didn't color body text.
#@+node:ekr.20070611161859: *7* Fixed *major* demote bug
http://sourceforge.net/forum/message.php?msg_id=4356197
#@+node:ekr.20070610063538.280: *6* Features
#@+node:ekr.20070610063538.281: *7* Supported write_strips_blank_lines option
#@+node:ekr.20070610063538.334: *7* Completed chapters
The following chapter commands now exist:

clone-node-to-chapter
convert-node-to-chapter
copy-node-to-chapter
create-chapter
create-chapter-from-node
move-node-to-chapter
remove-chapter
rename-chapter
select-chapter
#@+node:ekr.20070610063538.366: *7* Improved dynamic abbreviations
http://sourceforge.net/forum/message.php?msg_id=4255709

Added globalDynamicAbbrevs setting.
Added tab completion for dabbrev-expand.
#@+node:ekr.20070610063538.377: *7* Created the hoist-changed hook
This for the use of the hoist plugin.
#@+node:ekr.20070610173300: *7* Enabled more plugins by default
@nocolor

http://sourceforge.net/forum/message.php?msg_id=4134565

The following are now enabled by default:

# Plugin_manager.py needs plugins_menu.py
plugins_menu.py
plugin_manager.py
open_with.py
mod_scripting.py
rst3.py
UNL.py

# Enabled by default in Leo 4.4.3. (order is important)
nav_buttons.py
hoist.py
image.py
leo_to_html.py

I left out cleo because it has been reported not to be fully functional with Leo 4.4.3.
#@+node:ekr.20070622090350: *5* 4.4.3 beta 3
Leo 4.4.3 beta 3                                June 23, 2006

Leo 4.4.3 beta 3 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This release fixes all known bugs and adds several new features.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.3:
----------------------------
- Added support for chapters in Leo's core.
- Added support for zipped .leo files.
- Added a leoBridge module that allows full access to all of Leo's capabilities
  from programs running outside of Leo.
- Removed all gui-dependent code from Leo's core.
- Better support for the winpdb debugger.
- Added support for @enabled-plugins nodes in settings files.
- Added support for @open-with nodes in settings files.
- Added support for @bool write_strips_blank_lines setting.
- The__wx_gui plugin is now functional.
- Leo can use aspell on Linux when using Python 2.5 or later.
- @test nodes can now be run from any .leo file.
- Many minor improvements, new settings, commands and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070622090350.1: *6* Fixed bugs
#@+node:ekr.20070622090350.8: *7* Fixed a bug that disabled icon button colors on Linux
#@+node:ekr.20070622090350.22: *7* Switch chapters if new position isn't in current chapter
http://sourceforge.net/forum/message.php?msg_id=4362825
#@+node:ekr.20070622090350.42: *7* Improved goto-next/prev-node commands
Selecting a node now never truncates the beadList.
#@+node:ekr.20070622090350.57: *7* Fixed failing bridge unit test
CleanLines was adding a trailing newline.
The fix was to suppress this during unit tests.
#@+node:ekr.20070622090350.59: *6* New features & settings
#@+node:ekr.20070622090350.60: *7* Added @bool contractVisitedNodes setting
#@+node:ekr.20070622090350.61: *7* Added goto-first-visible-node command
#@+node:ekr.20070622090350.62: *7* Changed binding of Alt-Home
Alt-home is now bound to goto-first-visible rather than goto-first.
#@+node:ekr.20070622090350.65: *7* Added @button dynamic-tests.
This script runs all @test nodes as follows:

- Copies all @suite and @tests nodes to dynamicUnitTests.leo.

- Runs leoDynamicTest.py in a separate process. In turn, leoDynamicTest.py
  use the leoBridge module to run dynamicUnitTests.leo.
  (test.leo contains the source code for leoDynamicTest.py.)

Thus, all unit tests will be run with the latest Leo sources.

Allowing @test nodes in leoPy.leo is important: unit tests can be placed near
the code they are intended to test.
#@+node:ekr.20070622090350.66: *7* created g.unitTesting and g.getTestVars
The test 'if g.unitTesting:' is a shorter replacement for the test 'if g.app and g.app.unitTesting:'.

Using g.getTestVars eliminates pychecker warnings about undefined c and p variables.
#@+node:ekr.20070622090350.9: *7* Made alt menu keys work
# Created menu-command-key command that just returns 'continue'.
#@+node:ekr.20070626082732: *5* 4.4.3 final
Leo 4.4.3 final                                  June 26, 2006

Leo 4.4.3 final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.3:
----------------------------
- Added support for chapters in Leo's core.
- Added support for zipped .leo files.
- Added a leoBridge module that allows full access to all of Leo's capabilities
  from programs running outside of Leo.
- Removed all gui-dependent code from Leo's core.
- Better support for the winpdb debugger.
- Added support for @enabled-plugins nodes in settings files.
- Added support for @open-with nodes in settings files.
- Added support for @bool write_strips_blank_lines setting.
- The__wx_gui plugin is now functional.
- Leo can use aspell on Linux when using Python 2.5 or later.
- @test nodes can now be run from any .leo file.
- Many minor improvements, new settings, commands and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070702162421: *5* 4.4.3.1
Leo 4.4.3.1                                 July 3, 2006

Leo 4.4.3.1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.3.1:
----------------------------
- Fixed a few minor bugs reported since Leo 4.4.3 was released.
- Added better support for unit testing in Leo.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070703095207.1: *6* Bugs
#@+node:ekr.20070703095207.2: *7* Fixed improper can not open myLeoSettings message
#@+node:ekr.20070703095207.5: *7* Fixed import problem in leoDynamicTest.py
It's a bit tricky to ensure that leo/src is in sys.path
The code now changes the working directory to leo/src,
and leoDynamicTest.py adds os.getcwd() to sys.path if it is not there.

#@+node:ekr.20070703095207.34: *7* Fixed cleo crasher
https://sourceforge.net/forum/message.php?msg_id=4385604
#@+node:ekr.20070703095207.35: *7* Fixed spell-check bug
Misspelled words were not selected properly on Linux.
#@+node:ekr.20070703095207.40: *7* Fixed several crashers in the group operations plugin
http://sourceforge.net/forum/message.php?msg_id=4385699
#@+node:ekr.20070703095207.41: *7* Fixed chapters bug
Moving into a chapters node from the main chapter did an automatic hoist.
#@+node:ekr.20070703095207.43: *7* Fixed problems in groupOperations plugin
- Made inter-outline moves & copies work again.
- Also, warn that inter-outline clones transfer have no effect.
- Note: none of these operations are presently undoable.

In short, this code is no worse than it has ever been.
#@+node:ekr.20070703095207.50: *7* Fixed pychecker complaints
# Added calls to c,p = g.getTestVars()

(fixed) leoNodes.py:2801: No global (p) found
(fixed) leoNodes.py:2804: No global (c) found

(fixed) leoConfig.py:1739: No global (c) found

(fixed) leoKeys.py:4446: No global (c) found

(fixed) leoEditCommands.py:7823: No global (c) found
(fixed) leoEditCommands.py:8508: No global (e) found
#@+node:ekr.20070703095207.51: *7* Fixed editor bug: deleting an editor did not always select the proper body pane
#@+node:ekr.20070703095207.55: *6* Features
#@+node:ekr.20070703095207.56: *7* g.es and g.es_print print only to console during unit tests
#@+node:ekr.20070703095207.61: *7* Run unit tests in a separate process
For full details, see Chapter 20: Unit testing with Leo.
#@+node:ekr.20070703095207.72: *7* Move most unit tests into external files
It is essential to protect them with::

     if g.unitTesting:

A new unit test ensures that this is so.
#@+node:ekr.20070806090235: *4* 4.4.4 @auto, @menus, threading syntax colorer, the Great Graph Aha
#@+node:ekr.20070806090235.1: *5* 4.4.4 b1
Leo 4.4.4 beta 1                                August 10, 2007

Leo 4.4.4 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.4:
----------------------------

- A threading_colorizer plugin replaces the __jEdit_colorizer__ plugin.
  This plugin features much better performance.

- Support for @auto nodes.  Such nodes allow people to collaborate using Leo
  without inserting Leo sentinels in the files Leo generates.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070806090226.1: *6* Added support for @mark-for-unit-tests node
The run-unit-tests command now includes *all* @mark-for-unit-test trees.
#@+node:ekr.20070806090226.14: *6* Created threading_colorizer
The old __jEdit_colorizer__.py plugin has been retired.
#@+node:ekr.20070806090226.15: *6* Added support for @auto files
#@+node:ekr.20070806095535.1: *7* What @auto does
@auto trees allows people to use Leo in collaborative environments without using
sentinels in the files Leo generates. In contrast to @nosent, @auto trees can
change when the corresponding file changes outside of Leo.

Leo will automatically recreate (import) all @auto trees when reading a .leo
file, and will write all dirty @auto trees when saving a .leo file. There are
two exceptions to this statement:

1. Leo will never read (import) or write an @auto tree if
the root @auto tree is under the influence of an @ignore directive.

2. Saving a .leo file does not save @auto nodes if a) they haven't been changed
or b) they do not contain a **significant** amount of information. An @auto tree
contains a significant amount of information if it has  children or if the
root node contains more than 10 characters.

Leo creates @auto trees by parsing the corresponding external file. Parsers
create descendant nodes of the @auto tree: one node for each class, method and
function in the external file.

Parsers presently exist for C, elisp, Java, Pascal, PHP and Python. Leo
determines the language using the file's extension. If no parser exists for a
language, the entire body of an @auto tree contains a significant amount of
information if it has any children or if the root node contains more than 10
non-blank lines. the external file is copied to the body of the @auto node.

Leo does not write the contents of @auto trees to .leo files. In this respect,
@auto trees work much like @file trees. @auto trees whose root node is under the
scope of an @ignore directive *will* be written to the .leo, just like @file
trees.
#@+node:ekr.20070809141529: *7* Perfect import checks
Leo performs several checks to ensure that the result of importing an external
file will be equivalent to the file that writing the @auto tree would produce.

These checks can produces **errors** or **warnings**. Errors indicate a
potentially serious problem. Leo inserts an @ignore directive in the @auto tree
if any error is found. This @ignore directive prevents the @auto tree from
modifying the external file. If you @ignore directive, a later write of the
@auto tree will attempt to fix the problems that gave rise to the errors. There
are no guarantees however.

**Strict languages** are languages like Python for which leading whitespace is
especially significant. Before importing a file for a strict language, Leo
**regularizes** the leading whitespace of all lines of the original source file.
That is, Leo converts blanks to tabs or tabs to blanks depending on the value of
the @tabwidth directive in effect for the @auto node. Leo cannot guarantee to
reproduce the original source file exactly if problems are discovered while
regularizing leading whitespace.

After importing a file, Leo verifies that writing the @auto node would create
the same file as the original file. For strict languages, the comparison must be
exact, or nearly so. For non-strict languages, differences in leading whitespace
generate warnings, not errors.

File comparison mismatches can arise for several reasons:

1. Bugs in the import parsers. Please report any suspected bugs immediately.

2. Underindented lines in classes, methods or functions in strict languages. An
   **underindented line** is a line that is indented less then the starting line
   of the class, method or function in which it appears. Leo outlines can not
   represent such lines exactly: every line of node implicitly has at least the
   indentation of any unindented line of the node.

Leo will issue a warning (not an error) for underindented Python comment lines.
Such lines can not change the meaning of Python programs.
#@+node:ekr.20070806101412: *7* Commands related to @auto
Three new commands in the File:Read/Write menu allow you to manually read and
write @auto nodes from the presently selected outline. As always, an @ignore
directive in the @auto node or its ancestors will suppress any of these
commands:

- The Read @auto Nodes (read-at-auto-nodes) command reads all @auto nodes in the
  presently selected outline. An @ignore directive will suppress this import.

- The Write @auto Nodes (write-at-auto-nodes) command writes all @auto nodes. An
  @ignore directive will suppress this import. Caution: the write will occur even
  if Leo has not previously read the @auto node.

- The Write Dirty @auto Nodes (write-dirty-at-auto-nodes) is the same as the
  write-at-auto-nodes command, except that only changed @auto trees are written.

Most users will rarely use these explicit commands, because reading and writing
.leo files handles @auto nodes well enough. However, you can use the
read-at-auto-nodes command to update @auto nodes without having to reload the
.leo file.
#@+node:ekr.20070806100055: *7* Extending the code: adding new parsers
All present parsers are short overrides of a powerful base parser class. Thus,
it would be simple to add support for other languages. See the node::

    @file leoImport.py-->Import-->Scanners for createOutline

in leoPy.leo to see how easy it is to create new parsers.

#@+node:ekr.20070915101216: *5* 4.4.4 b2
Leo 4.4.4 beta 2                                September 19, 2007

Leo 4.4.4 beta 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.4:
----------------------------

- A threading_colorizer plugin replaces the __jEdit_colorizer__ plugin.
  This plugin features much better performance.

- Support for @auto nodes.  Such nodes allow people to collaborate using Leo
  without inserting Leo sentinels in the files Leo generates.

- New commands for resolving cvs conflicts.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20070915101157.1: *6* Bug fixes
#@+node:ekr.20070915101157.3: *7* Fixed UNL bug1
Email from Terry Brown

A softish bug, but the use of findNodeInTree() in the UNL code can 
take you to the wrong place if more than one node in the tree has 
the same headString.  Patch below - can still go wrong if more than 
one sibling has the same name, but the UNL system doesn't have a 
solution for that.

An observation - the UNL jumping code will drop you as far down the 
path as it gets, i.e. you're moved to the last node that was one the 
path, even if the path ends before the last part of the UNL is 
reached.  This is ok, i.e. "this is as far as I could follow the 
UNL", the alternative would be to not move at all if the whole UNL 
can't be followed.

Cheers -Terry

anon_cvs> cvs diff leo/plugins/UNL.py
Index: leo/plugins/UNL.py
===================================================================
RCS file: /cvs/leo/plugins/UNL.py,v
retrieving revision 1.14
diff -r1.14 UNL.py
183c183,186
<                             p = g.findNodeInTree(c2,p,headline)
---
>                             for tmpp in p.copy().children_iter():
>                                 if tmpp.headString() == headline:
>                                     p = tmpp
>                                     break
206c209,212
<                             p = g.findNodeInTree(c,p,headline)
---
>                             for tmpp in p.copy().children_iter():
>                                 if tmpp.headString() == headline:
>                                     p = tmpp
>                                     break

#@+node:ekr.20070915101157.5: *7* Fixed how @auto handles paths
http://sourceforge.net/forum/message.php?msg_id=4444579
#@+node:ekr.20070915101157.14: *7* Fixed another path bug
http://sourceforge.net/forum/message.php?msg_id=4445685
#@+node:ekr.20070915101157.16: *7* fixed c parser so it handles non-ascii declaratsions
http://sourceforge.net/forum/message.php?msg_id=4446937
#@+node:ekr.20070915101157.17: *7* Fixed colorizing bug and moved calls to w.toGuiIndex out of some loops
# The code that was removing tags was not working properly.
#@+node:ekr.20070915101157.18: *7* Fixed unicode bug in http plugin
http://sourceforge.net/forum/message.php?msg_id=4437415
#@+node:ekr.20070915101157.19: *7* Fixed new @path problem
http://sourceforge.net/forum/message.php?msg_id=4462693
#@+node:ekr.20070915101157.40: *7* Fixed @auto path bug
http://sourceforge.net/forum/message.php?msg_id=4464980
#@+node:ekr.20070915101157.45: *7* Improved messages on @import failure
@nocolor

http://sourceforge.net/forum/message.php?msg_id=4465132
By: terry_n_brown

So I changed all my indentation to multiples of four, having decided I like
the extra line space this buys over aligning with the opening (.

leo said this when it read the file:

@auto did not import the file perfectly

but never mentioned @ignore or anything.  I made a trivial change and saved
and diff could find no difference except my trivial change... which seems perfect
to me...?

@color
#@+node:ekr.20070915101157.48: *7* Fixed problem with space in path names in runLeoDynamicTest
https://sourceforge.net/forum/message.php?msg_id=4459798
#@+node:ekr.20070915101157.50: *7* Fixed bad drag & drop bug
http://sourceforge.net/forum/message.php?msg_id=4509897
#@+node:ekr.20070915101157.70: *7* Fixed bug 'node note selected' bug
http://sourceforge.net/forum/message.php?msg_id=4514130
#@+node:ekr.20070915101157.81: *7* Retain dirty bit after write @auto fails
http://sourceforge.net/forum/message.php?msg_id=4468174
#@+node:ekr.20070915101157.82: *6* Features
#@+node:ekr.20070915101157.168: *7* Read @auto nodes during saves if the node has not been read previously
When saving a .leo file, Leo now *reads* an @auto node if

1) the external file exists,
2) an 'insignificant' amount of data exists in the @auto tree, and
3)the @auto node has not been read previously.

This promises to fix some quite awkward use cases.

The 'perfect import' code now is a bit more relaxed, especially for 'non-strict'
languages (all languages except Python):

- Leo leaves leading whitespace alone for non-strict languages.

- Leo complains about intermixed tabs and blanks in leading whitespace only for
strict languages.

- Leo ignores leading whitespace in the perfect import tests for non-strict
languages.

These changes mean that Leo might change a external file if such a change occurs
only in leading whitespace in a non-strict language.
#@+node:ekr.20070920092716: *7* New commands for resolving cvs conflicts
The so-called resolve-cvs-conflict project has resolved itself into small,
easily understood commands.

The **read-file-into-node** command prompts for a filename, and creates an node
whose headline is @read-file-into-node <filename> and whose body text is the
entire contents of the file.

The **write-file-from-node** command writes the body text of the selected not to a file.
If the headline of the presently selected node starts with @read-file-into-node
the command use the filename that follows in the headline. Otherwise, the
command prompts for a filename.

When a cvs conflict occurs, the user will:

- read the file into a node using the read-file-into-node command,

- fix the conflict, as with any other editor, and

- write the file with the write-file-from-node command.

Any file can be fixed in this way, including external files and .leo files. The
only complication is that the user must not change sentinel lines. Two new
commands check the contents of a node: The **check-derived-file** and
**check-leo-file** commands tell whether a trial read of the presently selected
node can be done successfully. The check-derived-file command assumes the body
text is a external file; the check-leo-file command assumes the body text is an
entire .leo file.

The **compare-leo-outlines** command prompts for another (presumably similar)
.leo file that will be compared with the presently selected outline file (main
window). It then creates clones of all inserted, deleted and changed nodes.
#@+node:ekr.20071004101349: *5* 4.4.4 b3
Leo 4.4.4 beta 3                            October 23, 2007

Leo 4.4.4 beta 3 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.4.4 contains many important features originally planned for later releases.
It's been a good month :-)

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.4:
----------------------------

- The Great Graph Aha (tm): simple scripts allow Leo outlines to represent
  arbitrary directed graphs. There is no need for a separate 'graph world'. The
  graphed.py plugin is a direct result of this Aha. The graphed.py plugin allows
  you to create general graphs from Leo outlines.

- @menus trees in settings files create all of Leo's menus.  It is now dead
  easy to make Leo's menus look the way you want.

- @buttons trees in settings files create common @button nodes created in all
  Leo outlines.

- @auto nodes eliminate sentinels in external files, thereby allowing people to
  collaborate using Leo more easily.

- New commands for resolving cvs conflicts.

- A threading_colorizer plugin replaces the __jEdit_colorizer__ plugin.
  This plugin features much better performance and a new, elegant algorithm.

- Leo is now compatible with jython.

- The usual assortment of bug fixes and other minor improvements.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20071004101443.1: *6* Bugs fixed
#@+node:ekr.20071004101443.18: *7* Greatly improved speed of unmark-all
#@+node:ekr.20071004101443.26: *7* Made sure dirty bits get updated in xemacs plugin
http://sourceforge.net/forum/message.php?msg_id=4543844
#@+node:ekr.20071021111856.20: *7* Fixed backward find bug
In some cases the find-previous command did not work.

After much investigation, the cause of the bug was found to be a blunder in backwardsHelper.  Changed:

pattern.lower()

to:

pattern = pattern.lower()
#@+node:ekr.20071021111856.83: *7* Fixed cursor up/down problem
There were at least 3 bugs:

At least three bugs.

- Place cursor on last (blank) line.  Cursor up goes one line too far.
- Place cursor at end of line 1.  Second cursor down does nothing.
- Place cursor at end of xxxx line.  Second cursor down goes one line too far.

xxxxxxxxx
line 1
line 2

The fix was to g.getLine--potentially a major change.
#@+node:ekr.20071021111856.124: *7* Fixed unicode bug in trace
This should have been done long ago.
#@+node:ekr.20071021111856.127: *7* Fixed chapter crasher
http://sourceforge.net/forum/message.php?msg_id=4573990
#@+node:ekr.20071021111856.252: *7* Installed patch to fix Fedora Tk.Text bug
https://sourceforge.net/forum/message.php?msg_id=4576436
#@+node:ekr.20071021111856.437: *7* Fixed bug in rst3 plugin
Suppressed doc-part-delims when show_doc_parts_as_paragraphs is True.
#@+node:ekr.20071021111856.461: *7* Allow unicode characters in Leo file names
#@+node:ekr.20071023080957: *7* Fixed bugs when running unit tests externally
The run-unit-tests command runs tests using the bridge, which uses a nullGui and a stringTextWidget.

Added a hack to g.getScript so it always gets the script from p.bodyString when
g.app.gui.inBridge is True.
#@+node:ekr.20071004101443.29: *6* New Features
#@+node:ekr.20071004103659: *7* The Great Graph Aha
The Great Graph Aha is:

A Leo outline doesn't have to *be* an arbitrary graph in order to *represent* an arbitrary graph.

So the graph world is unnecessary because we can use Leo nodes and trees as data
to other graphing packages.** That is, Python scripts can build arbitrary graphs
using Leo's existing nodes and trees. And Python scripts can manipulate those
graphs. And Python scripts could do the reverse: manipulate the Leo outline by
traversing general graphs. So there is no need to complicate Leo's fundamental
data structures. Hurray! Instead, we build on the strengths of already existing
graphing packages.

The Great Graph Aha created the opportunity for immediate action:

1. test.leo contains the essential scripts to implement graphs in Leo files.
   These short, simple, self-contained, easily modifiable scripts make possible
   everything ever envisaged by the (now-defunct) graph world project::

    leo2graph: convert a normal Leo tree to a NetworkX graph. 
    at-graph2graph: convert an @graph tree to a NetworkX graph. 
    at-networkx2graph: convert an @networkx tree to a NetworkX graph 
    at-networkx2at-graph: create an @graph tree from an @networkx tree.

2. The graphed plugin allows users to manipulate parts of Leo outlines as if
they were general graphs. It is still early days for this exciting plugin.
#@+node:ekr.20071021111856.441: *7* Rewrote threading colorizer
The new code is simple and elegant.  Almost all flash is gone.
#@+node:ekr.20070806090226.15: *7* Added support for @auto files
#@+node:ekr.20070806095535.1: *8* What @auto does
@auto trees allows people to use Leo in collaborative environments without using
sentinels in the files Leo generates. In contrast to @nosent, @auto trees can
change when the corresponding file changes outside of Leo.

Leo will automatically recreate (import) all @auto trees when reading a .leo
file, and will write all dirty @auto trees when saving a .leo file. There are
two exceptions to this statement:

1. Leo will never read (import) or write an @auto tree if
the root @auto tree is under the influence of an @ignore directive.

2. Saving a .leo file does not save @auto nodes if a) they haven't been changed
or b) they do not contain a **significant** amount of information. An @auto tree
contains a significant amount of information if it has  children or if the
root node contains more than 10 characters.

Leo creates @auto trees by parsing the corresponding external file. Parsers
create descendant nodes of the @auto tree: one node for each class, method and
function in the external file.

Parsers presently exist for C, elisp, Java, Pascal, PHP and Python. Leo
determines the language using the file's extension. If no parser exists for a
language, the entire body of an @auto tree contains a significant amount of
information if it has any children or if the root node contains more than 10
non-blank lines. the external file is copied to the body of the @auto node.

Leo does not write the contents of @auto trees to .leo files. In this respect,
@auto trees work much like @file trees. @auto trees whose root node is under the
scope of an @ignore directive *will* be written to the .leo, just like @file
trees.
#@+node:ekr.20070809141529: *8* Perfect import checks
Leo performs several checks to ensure that the result of importing an external
file will be equivalent to the file that writing the @auto tree would produce.

These checks can produces **errors** or **warnings**. Errors indicate a
potentially serious problem. Leo inserts an @ignore directive in the @auto tree
if any error is found. This @ignore directive prevents the @auto tree from
modifying the external file. If you @ignore directive, a later write of the
@auto tree will attempt to fix the problems that gave rise to the errors. There
are no guarantees however.

**Strict languages** are languages like Python for which leading whitespace is
especially significant. Before importing a file for a strict language, Leo
**regularizes** the leading whitespace of all lines of the original source file.
That is, Leo converts blanks to tabs or tabs to blanks depending on the value of
the @tabwidth directive in effect for the @auto node. Leo cannot guarantee to
reproduce the original source file exactly if problems are discovered while
regularizing leading whitespace.

After importing a file, Leo verifies that writing the @auto node would create
the same file as the original file. For strict languages, the comparison must be
exact, or nearly so. For non-strict languages, differences in leading whitespace
generate warnings, not errors.

File comparison mismatches can arise for several reasons:

1. Bugs in the import parsers. Please report any suspected bugs immediately.

2. Underindented lines in classes, methods or functions in strict languages. An
   **underindented line** is a line that is indented less then the starting line
   of the class, method or function in which it appears. Leo outlines can not
   represent such lines exactly: every line of node implicitly has at least the
   indentation of any unindented line of the node.

Leo will issue a warning (not an error) for underindented Python comment lines.
Such lines can not change the meaning of Python programs.
#@+node:ekr.20070806101412: *8* Commands related to @auto
Three new commands in the File:Read/Write menu allow you to manually read and
write @auto nodes from the presently selected outline. As always, an @ignore
directive in the @auto node or its ancestors will suppress any of these
commands:

- The Read @auto Nodes (read-at-auto-nodes) command reads all @auto nodes in the
  presently selected outline. An @ignore directive will suppress this import.

- The Write @auto Nodes (write-at-auto-nodes) command writes all @auto nodes. An
  @ignore directive will suppress this import. Caution: the write will occur even
  if Leo has not previously read the @auto node.

- The Write Dirty @auto Nodes (write-dirty-at-auto-nodes) is the same as the
  write-at-auto-nodes command, except that only changed @auto trees are written.

Most users will rarely use these explicit commands, because reading and writing
.leo files handles @auto nodes well enough. However, you can use the
read-at-auto-nodes command to update @auto nodes without having to reload the
.leo file.
#@+node:ekr.20070806100055: *8* Extending the code: adding new parsers
All present parsers are short overrides of a powerful base parser class. Thus,
it would be simple to add support for other languages. See the node::

    @file leoImport.py-->Import-->Scanners for createOutline

in leoPy.leo to see how easy it is to create new parsers.

#@+node:ekr.20071004101443.52: *7* Added @buttons trees in @settings trees
@button nodes in the @buttons tree in settings file define **global buttons** that appear in all Leo outlines.
#@+node:ekr.20071004101443.105: *7* Added @menus trees in @settings trees
Leo creates its menus using @menus trees. Within @menus trees,
@menu nodes create menus and @item nodes create menu items.

Notes:

- The menu name always follows @menu. If the menu name is 'Plugins', Leo will
  create the Plugins menu and populate the menu by calling the
  'create-optional-menus' hook. This creates the Plugins menu as usual.

- Nested @menu nodes contain submenus.

- The command name follows @item. If the body text of an @item node exists, this
  body text is the menu name. Otherwise, the menu name is the command name.
  However, if the command name starts with a '*', hyphens are removed from the
  menu name.

- Menu names and command names may contain a single ampersand (&). If present,
  the following character is underlined in the name.

- If the command name in an @item node is just a hyphen (-), the item represents
  a menu separator.

- Unicode characters, e.g., Chinese characters *are* allowed.
#@+node:ekr.20070920092716: *7* New commands for resolving cvs conflicts
The so-called resolve-cvs-conflict project has resolved itself into small,
easily understood commands.

The **read-file-into-node** command prompts for a filename, and creates an node
whose headline is @read-file-into-node <filename> and whose body text is the
entire contents of the file.

The **write-file-from-node** command writes the body text of the selected not to a file.
If the headline of the presently selected node starts with @read-file-into-node
the command use the filename that follows in the headline. Otherwise, the
command prompts for a filename.

When a cvs conflict occurs, the user will:

- read the file into a node using the read-file-into-node command,

- fix the conflict, as with any other editor, and

- write the file with the write-file-from-node command.

Any file can be fixed in this way, including external files and .leo files. The
only complication is that the user must not change sentinel lines. Two new
commands check the contents of a node: The **check-derived-file** and
**check-leo-file** commands tell whether a trial read of the presently selected
node can be done successfully. The check-derived-file command assumes the body
text is a external file; the check-leo-file command assumes the body text is an
entire .leo file.

The **compare-leo-outlines** command prompts for another (presumably similar)
.leo file that will be compared with the presently selected outline file (main
window). It then creates clones of all inserted, deleted and changed nodes.
#@+node:ekr.20071004105000: *7* Added the graphed plugin
The graphed plugin allows users to manipulate parts of Leo outlines as if
they were general graphs. It is still early days for this exciting plugin.
#@+node:ekr.20071004101443.178: *7* New convenience methods
The c.frame.logcreateCanvas convenience method create a canvas tab in the log pane.
Here is a sample script:

log = c.frame.log ; tag = 'my-canvas'

w = log.canvasDict.get(tag)
if not w:
..w = log.createCanvas(tag)
..w.configure(bg='yellow')

log.selectTab(tag)
#@+node:ekr.20071004101443.30: *7* Added button font settings
See the node:

@settings-->Fonts-->@font button font

in leoSettings.leo.
#@+node:ekr.20071005095907: *7* Leo's core is now compatible with jython
- Replaced all 'yield' statements with iterators.

- Added 'jyLeo' keyword to leo.run.

- All of Leo's startup code works with the swing gui enabled (jyLeo = True in leo.run).
#@+node:ekr.20071006093614: *7* Added the insert-child command
This inserts a child node.
#@+node:ekr.20071006155647: *7* @bool add_ws_to_kill_ring setting
#@+node:ekr.20071021111856.412: *7* Improved yank and yank-pop commands
Optimized yank, by using yanked leading whitespace if it exists

New default bindings: Alt-Y: yank-pop.  Alt-Ctrl-Y: cycle-all-focus.

New option: add-ws-to-kill-ring (or kill-ws-adds-to-kill-ring)
#@+node:ekr.20071021111856.458: *7* Improved debug command
http://sourceforge.net/forum/message.php?msg_id=4568499
#@+node:ekr.20071021111856.459: *7* Added the @bool rst3 strip_at_file_prefixes setting
From the documentation at: http://webpages.charter.net/edreamleo/rstplugin3.html#options

strip_at_file_prefixes (default: True)

True: remove @auto, @file, @nosent and @thin from the start of headlines.
#@+node:ekr.20071021111856.476: *7* Added g.app.inBridge ivar
This is used, at present, by g.getScript.  It is a natural status ivar in any case.
#@+node:ekr.20071021111856.477: *7* Improved the scripting and plugins chapters of Leo's Users Guide
- Use the term 'event handler' for hook.  This is much better terminology.

- Move the discussion of event handlers to the scripting chapter.

- Removed the discussion of all menu convenience routines: they are not needed now that Leo supports @menus nodes.

- The 'writing plugins' chapter is now very simple.
#@+node:ekr.20071026053825: *5* 4.4.4 b4
Leo 4.4.4 beta 4                            October 27, 2007

Leo 4.4.4 beta 4 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This beta 4 version fixes all bugs reported against Leo 4.4.4 beta 3.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Leo 4.4.4 contains many important features originally planned for later releases.

The highlights of Leo 4.4.4:
----------------------------

- The Great Graph Aha (tm): simple scripts allow Leo outlines to represent
  arbitrary directed graphs. There is no need for a separate 'graph world'. The
  graphed.py plugin is a direct result of this Aha. The graphed.py plugin allows
  you to create general graphs from Leo outlines.

- @menus trees in settings files create all of Leo's menus.  It is now dead
  easy to make Leo's menus look the way you want.

- @buttons trees in settings files create common @button nodes created in all
  Leo outlines.

- @auto nodes eliminate sentinels in external files, thereby allowing people to
  collaborate using Leo more easily. **Warning**: for now, please make backup
  copies of files imported with @auto.

- New commands for resolving cvs conflicts.

- A threading_colorizer plugin replaces the __jEdit_colorizer__ plugin.
  This plugin features much better performance and a new, elegant algorithm.

- Leo is now compatible with jython.

- Better support for icons in headlines.

- The usual assortment of bug fixes and other minor improvements.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20071026053931.1: *6* Fixed bugs
#@+node:ekr.20071026053931.13: *7* Fixed bug: utf-8 files now get imported properly
http://sourceforge.net/forum/message.php?msg_id=4574271
#@+node:ekr.20071026053931.156: *7* Replaced c.frame.body with c.frame.body.bodyCtrl
This should have been done a long time ago.
#@+node:ekr.20071026053931.157: *7* Fixed (maybe) multi-editor bug
http://sourceforge.net/forum/message.php?msg_id=4585396

The threading colorizer must be run with interruptible=False when there are multiple body editors.
#@+node:ekr.20071026053931.219: *7* Made sure proper node is visible when deleting a body editor
#@+node:ekr.20071026053931.220: *7* Fixed colorizer end-of-text bug
#@+node:ekr.20071026075016: *7* Added support for fastGotoNode plugin to leoKeyEvent classes
This fixes a fairly old crasher in the fastGotoNode plugin.
#@+node:ekr.20071026092552: *7* Fixed bug that disabled multiple occurances of the same user icon
#@+node:ekr.20071026182824: *6* Added features
#@+node:ekr.20071026053931.221: *7* Added @bool big_outline_pane setting
False (legacy): Top pane contains outline and log panes.
True: Top pane contains only the outline pane.  Bottom pane contains body and log panes.
#@+node:ekr.20071026053931.234: *7* Can print *can* handle unicode
To allow Python's print statement to print unicode characters properly, you must
change Python's default encoding to something other than 'ascii'. To do this,
put the following in your sitecustomize.py file in Python's Lib folder::

    import sys 
    sys.setdefaultencoding('utf-8') # 'iso-8859-1' is another choice.

You must restart Python after doing this: sys.setdefaultencoding can not be
called after Python starts up.

Leo's g.es_print function attempts to convert incoming arguments to unicode
using the default encoding. For example, the following Leo script always prints
La Peña::

    @first # -*- coding: utf-8 -*-
    # The line above is required for Python 2.5

    for s in (u'La Pe\xf1a','La Peña',u'La Peña'): 
        g.es_print(s)

For still more details, see:

http://www.diveintopython.org/xml_processing/unicode.html 
#@+node:ekr.20071026180804.1: *7* Improved the prototype of icon handling
The prototype in test.leo now uses PIL (Python Imaging Library) if available,
so many more kinds of icons can be used.

Buttons now exist to add icons to do the following:

- Add any icon to any node.
- Delete all icons from a single node or the entire tree.
- Print the icon files associated with a node.
- Print the sizes of icons in a directory.

In addition, fixed a bug in the icon handling in the outline widget that caused
duplicate icons not to be drawn properly.
#@+node:ekr.20071101162646: *5* 4.4.4 Final
Leo 4.4.4 Final                           November 2, 2007

Leo 4.4.4 Final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Leo 4.4.4 contains many important features originally planned for later releases.

The highlights of Leo 4.4.4:
----------------------------

- The Great Graph Aha (tm): simple scripts allow Leo outlines to represent
  arbitrary directed graphs. There is no need for a separate 'graph world'. The
  graphed.py plugin is a direct result of this Aha. The graphed.py plugin allows
  you to create general graphs from Leo outlines.

- @menus trees in settings files create all of Leo's menus.  It is now dead
  easy to make Leo's menus look the way you want.

- @buttons trees in settings files create common @button nodes created in all
  Leo outlines.

- @auto nodes eliminate sentinels in external files, thereby allowing people to
  collaborate using Leo more easily. **Warning**: for now, please make backup
  copies of files imported with @auto.

- New commands for resolving cvs conflicts.

- A threading_colorizer plugin replaces the __jEdit_colorizer__ plugin.
  This plugin features much better performance and a new, elegant algorithm.

- Leo is now compatible with jython.

- Better support for icons in headlines.

- Many bug fixes and other minor improvements.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20071101162751: *6* Fixed bugs
#@+node:ekr.20071101162751.2: *7* Fixed bug that caused rClick plugin to crash
http://sourceforge.net/forum/message.php?msg_id=4591494
#@+node:ekr.20071101162751.4: *7* Fixed scrolling problem with chapters
#@+node:ekr.20071101162751.19: *7* Fixed bug: select a chapter containing the initially selected node
The fix doesn't actually remember which chapter was previously selected; it
picks some chapter containing the initially selected node. This works exactly
for non-cloned nodes, but can select the 'wrong' chapter for cloned nodes.
Still, this is a big improvement over the previous code, which would not select
any node if the selected node was not in the main chapters.
#@+node:ekr.20071101162751.28: *7* Fixed Apple help menu reversion
#@+node:ekr.20071101162751.32: *7* Disabled the plugins manage plugin
It is too confusing at present, because it doesn't support @enabled-plugins nodes.
#@+node:ekr.20071101162751.33: *7* Made sure plugins work if frame.iconFrame is None
#@+node:ekr.20071101162751.34: *7* Fixed @auto java bug
#@+node:ekr.20071101162751.97: *7* Fixed spell-check problem on Linux
http://sourceforge.net/forum/forum.php?thread_id=1853660&forum_id=10228
#@+node:ekr.20071101162751.149: *7* Use the default spell tab
The spell tab now uses the same font as the find tab.
#@+node:ekr.20071101162751.150: *7* Fixed long-standing and important body editor bug
http://sourceforge.net/forum/message.php?msg_id=4596477
#@+node:ekr.20071101162751.178: *7* Non-ignored @auto trees do not get saved to the .leo file
#@+node:ekr.20071101162751.184: *7* Fixed bug that cause the import of PyParse.py to fail
#@+node:ekr.20071101163257: *7* Improved error reporting in rst3 plugins for code_block directive
#@+node:ekr.20071115102421: *4* 4.4.5 bug fixes
#@+node:ekr.20071115102156: *5* Leo 4.4.5 b1
Leo 4.4.5 beta 1                          November 16, 2007

Leo 4.4.5 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Leo 4.4.5 fixes several long-delayed bug fixes and adds several new features.

The highlights of Leo 4.4.5:
----------------------------

- Fixes all known bugs.
- Leo now recognizes directives in headlines.
- Adds 3 new sort-lines commands.
- Adds commands to insert and delete icons from headlines.
- Adds all the Tango 16x16 icons to Leo's icon library.
- Adds support for @rst-preformat nodes to the rst3 plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20071115102156.5: *6* Fixed bugs
#@+node:ekr.20071115102156.2: *7* Removed all references to pluginsManager.txt
#@+node:ekr.20071115102156.6: *7* Fixed hung windows
@nocolor

https://sourceforge.net/forum/message.php?msg_id=3768494
By: ktenney

I'm using current CVS, W2k

1 open a Leo file (I'm using a batch file / console)

2 click Edit->Open   <-- Having this dialog open is the problem.

3 return focus to the Leo window

4 click Help->Open leoDocs.leo

Zombie!

@color
#@+node:ekr.20071115102156.11: *7* Warn on resurrected (vampire) nodes
http://sourceforge.net/forum/message.php?msg_id=3525277

The atFile read logic only **adds** nodes, it never deletes nodes. Thus,
the 'changed2' node 'survived' the atFile read logic. The 'changed2' node became
a 'vampire' node that couldn't be killed.

The fix will require some care. The present atFile.read logic is robust because
it *doesn't* delete nodes. I suspect the solutions will be as follows:

A. The atFile.read code can not delete the subtree of @thin nodes initially,
because it doesn't know whether there will be read errors later. If there are
read errors absolutely nothing must change. This ensures that read errors never
destroy information.

B. A new post-pass will look for vampire nodes: nodes that were not actually
read from the external file. I think (but haven't proven) that all descendants of
vampire nodes are also vampire nodes. If that is so the post-pass will simply
delete vampire nodes without worrying about whether they have descendants.
#@+node:ekr.20071115102156.21: *7* Fixed new @auto bug (python)
@nocolor

From: Terry Brown <terry_n_brown@yahoo.com>

** Also, no ignore inserted.

Current CVS, ubuntu

From the code below I get:

reading: /mnt/removable/bkup_proj/Mammals/mammaldb/mammaldb.leo
*** first mismatch at line 119
original line:      def provide(self, what):
generated line: def provide(self, what):
@auto did not import the file perfectly
first mismatched line: 119
u'def provide(self, what):\n'
inserting @ignore
Errors inhibited read
@auto /mnt/removable/bkup_proj/Mammals/mammaldb/mammalShow.py

In the code below line 119 is not the first "def provide(self, what):"
but the second, the one in class mainPages - I've included the preceding
class def because context seems to be important.

@color
#@+node:ekr.20071115102156.78: *7* Fixed new @auto bug: c++
@nocolor

In the following code:

extern  "C"
{
#include "stuff.h"
void    init(void);
#include "that.h"
}

produces the following in the log window:

Leo Log Window...
Leo 4.4.4 final, build  1.216 , November 2, 2007
Python 2.5.1, Tk 8.4.14, Pmw 1.2
Windows 5, 1, 2600, 2, Service Pack 2

leoID = rshanley (in C:\)
global config dir: C:\Program Files\Leo\config
home dir: C:\
reading settings in C:\Program Files\Leo\config\leoSettings.leo
*** first mismatch at line 2
original line:  {
generated line:
import command did not import the file perfectly
first mismatched line: 2
u'\n'
input...
  0 extern  "C"
  1 {
  2 #include "stuff.h"
  3 void    init(void);
  4 #include "that.h"
  5 }
output...
  0 extern  "C"
  1
inserting @ignore
imported C:/test/aa.cc

@color
#@+node:ekr.20071115102156.79: *7* Fixed various @auto comparison problems
@nocolor

http://sourceforge.net/forum/forum.php?thread_id=1865290&forum_id=10226

@bool at_auto_warns_about_leading_whitespace

@color
#@+node:ekr.20071115102156.81: *7* Retain relative paths in recent files menu
http://sourceforge.net/forum/message.php?msg_id=4464649
By: terry_n_brown

An argument I'm always having with leo has to do with its conversion of file
paths to 'absolute' forms.

In the file browser I select '/home/tbrown/misc/foo.leo'.
Leo reinterprets this as '/media/hda2/usr1/home/tbrown/misc/foo.leo'

Then I switch machines, and while
'/home/tbrown/misc/foo.leo' would still be valid,
'/media/hda2/usr1/home/tbrown/misc/foo.leo' isn't - on the other machine it
would be '/media/hdb1/home/tbrown/misc/foo.leo'.

I end up with the two entries in recent files, having to identify the right one.

If the Tk dialog is returning '/home/tbrown/misc/foo.leo', which I assume it is
because that's what it's displaying, I wish leo would use and store that.
#@+node:ekr.20071115102156.123: *7* Fixed windows registry problem
http://sourceforge.net/forum/message.php?msg_id=4615931
#@+node:ekr.20071115102156.124: *7* Fixed paste node as clone crasher
http://sourceforge.net/forum/message.php?msg_id=4618014
#@+node:ekr.20071115102156.141: *7* Fixed hoist crasher
http://sourceforge.net/forum/message.php?msg_id=4620890
#@+node:ekr.20071115102156.146: *7* Ignore unpickling problems in getUa
From email from Terry Brown

python /home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leo.py /home/tbrown/.tnb.leo

(should be all on one line, i.e. run and open /home/tbrown/.tnb.leo)

gives the traceback below.  Opening the file from within Leo works fine.

Bah - I just now looked at it closely enough to realize it's the evil
pickled Tk classes in cleo uAs.  So I don't know whether you want to
fix that or not, it makes sense Leo would read the file specified on
the command line before Tk is initialized - if it's just scanning for
settings maybe it could catch and ignore failed uA reads at that time?

At some point I want to take pickled Tk vars out of cleo, I was
thinking when that guy was working on the wx gui would be a good time,
too bad he got sick.

reading settings in /mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/config/leoSettings.leo
reading settings in /home/tbrown/leoSettings.leo
reading settings in /home/tbrown/myLeoSettings.leo
reading settings in /home/tbrown/.tnb.leo
Traceback (most recent call last):
  File "/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leo.py", line 398, in <module>
    run(fileName)
  File "/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leo.py", line 118, in run
    g.app.config.readSettingsFiles(fileName,verbose)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoConfig.py", line 1649, in readSettingsFiles
    c = self.openSettingsFile(path)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoConfig.py", line 1674, in openSettingsFile
    theFile,path,readAtFileNodesFlag=False,silent=True) # closes theFile.
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 892, in open
    silent=silent)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 779, in getLeoFile
    self.getAllLeoElements(fileName,silent)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1317, in getAllLeoElements
    self.getVnodes()
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1898, in getVnodes
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1781, in getVnode
    appendToCurrentStack=append1,appendToTopStack=append2)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1738, in getVnode
    attr,val = self.getUa("vnode")
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/src/leoFileCommands.py", line 1658, in getUa
    val2 = pickle.loads(binString)
  File "/usr/lib/python2.5/pickle.py", line 1374, in loads
    return Unpickler(file).load()
  File "/usr/lib/python2.5/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib/python2.5/pickle.py", line 1217, in load_build
    setstate(state)
  File "/mnt/removable/bkup_usr1/home/tbrown/.gnome-desktop/Package/leo/cvs/leo/plugins/cleo.py", line 130, in __setstate__
    Tk.Variable.__init__(self)
  File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 188, in __init__
    self._tk = master.tk
AttributeError: 'NoneType' object has no attribute 'tk'
Exception exceptions.AttributeError: "TkPickleVar instance has no attribute '_tk'" in <bound method TkPickleVar.__del__ of <cleo.TkPickleVar instance at 0xb73a876c>> ignored
#@+node:ekr.20071116081521: *6* New commaneds
#@+node:ekr.20071115102156.238: *7* toggle-collapse_nodes_during_finds
#@+node:ekr.20071115102156.256: *7* 3 new sort-lines commands
Added sort-lines-ignoring-case, reverse-sort-lines and reverse-sort-lines-ignoring-case.
#@+node:ekr.20071115102156.303: *7* Added Cmd:Icons menu and commands
The code now remembers the relative file name as well as the full path name.
This allows Leo to find the icon when multiple machines are involved.
#@+node:ekr.20071115102156.148: *6* New features
#@+node:ekr.20071115102156.149: *7* Leo now recognizes directives in headlines
#@+node:ekr.20071115102156.301: *7* Moved all unit tests to unitTest.leo
And reorganized the unit tests by Leo source file.
#@+node:ekr.20071115102156.320: *7* Added @rst-preformat
http://sourceforge.net/forum/message.php?msg_id=4614081
#@+node:ekr.20071115102156.321: *7* Installed small icon set from Tango library
http://tango.freedesktop.org/Tango_Icon_Library

These icons are now part of Leo's distribution.
#@+node:ekr.20071116081521.1: *6* New settings
#@+node:ekr.20071115102156.237: *7* @bool at_auto_warns_about_leading_whitespace
This option has effect only when importing so-called non-strict languages,
for which leading whitespace is not terribly significant.

True: @auto warns about mismatches that occur solely in leading whitespace.
#@+node:ekr.20071115102156.302: *7* @bool vim_plugin_opens_url_nodes
http://sourceforge.net/forum/message.php?msg_id=4622384

vim.py does not open url nodes if the new setting: 

@bool vim_plugin_opens_url_nodes 

is False (or does not exist). 
#@+node:ekr.20071115102156.289: *7* @bool warn_when_plugins_fail_to_load
There is also an @bool trace_plugins setting.
#@+node:ekr.20071206093346: *5* Leo 4.4.5 b2
Leo 4.4.5 beta 2                          December 7, 2007

Leo 4.4.5 beta 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This beta 2 release fixes several recently reported bugs.  A final release
is due in about a week.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Leo 4.4.5 fixes several long-delayed bug fixes and adds several new features.

The highlights of Leo 4.4.5:
----------------------------

- Fixes all known bugs.
- Leo now recognizes directives in headlines.
- Adds 3 new sort-lines commands.
- Adds commands to insert and delete icons from headlines.
- Adds all the Tango 16x16 icons to Leo's icon library.
- Adds support for @rst-preformat nodes to the rst3 plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20071206093323.1: *6* Fixed bugs
#@+node:ekr.20071206093323.2: *7* Fixed two crashers in the @noref logic
pylint reported the following errors:

E1101:1877:atFile.readEndNode: Instance of 'atFile' has no 'correctedLines' member
E1101:2725:atFile.norefWrite:  Instance of 'atFile' has no 'putBuffered' member
#@+node:ekr.20071206093323.3: *7* Fixed crasher in regularizeWhitespace
#@+node:ekr.20071206093323.4: *7* Fixed paste-node-as-clone
http://sourceforge.net/forum/message.php?msg_id=4632695
#@+node:ekr.20071206093323.29: *7* Fixed threading colorizer hang with perl
http://sourceforge.net/forum/message.php?msg_id=4646055
#@+node:ekr.20071206093323.30: *7* Fixed C++ importer crash
https://sourceforge.net/forum/message.php?msg_id=4643992
#@+node:ekr.20071206093323.31: *7* Reorganized leoImport.py
The init base classes can now be inited in a more standard way.
#@+node:ekr.20071206093323.59: *7* Fixed command lockout problem
http://sourceforge.net/forum/message.php?msg_id=4639872
#@+node:ekr.20071206093323.72: *7* Improved @auto code
Several problems still remain:

- Files that contain what look like section references.

- Underindented docstrings.
#@+node:ekr.20071206093323.76: *7* Simplified perl colorizer and added progress checks
#@+node:ekr.20071206093323.80: *7* Fixed problem with decorators
http://sourceforge.net/forum/message.php?msg_id=4652514
#@+node:ekr.20071206093323.87: *7* Fixed @auto bug
http://sourceforge.net/forum/message.php?msg_id=4654762
#@+node:ekr.20071206093323.96: *7* Fixed  focus problem with goto-next clone command
@nocolor

I have clones that traverse chapters.

Given the following Chapters:

> Main
> Big Picture
> Smaller Chunk

I have in Main, my organization, with my group in it.  It's also cloned around
all the other views (really, everything starts in the Big Picture).

This is the layout of my clone:

1:  Chapter:Main > me
2:  Chapter:Main > MyOrg > me
3:  Chapter:Big Picture > CEO > Some Big Honcho > MyOrg > me
4:  Chapter:Smaller Chunk > Some Big Honcho > MyOrg > me

If I Go-To-Next-Clone  (ALT-N) from (1), focus will move to the selected node
in Chapter:Main, namely (2).

So here's the issue: 

Let each successive line below represent a starting focus, and the next line
the node that ALT-N selects.  If focus changes in the Outline pane (including
Chapter pane change) to match the Node, that case is marked with [f] - a successful
focus transition.

The issue are the lines w/o [f];  Here's a couple of test runs.

1: [f] (starting node / focus)
2: [f]
3:
4:
1: [f]

Next test:

3: [f]
1: [f]
1: [f]
4:
3:
1: [f]

Next test:

4: [f]
3:
1: [f]
2: [f]
4:
3:
1: [f]
2: [f]
... and so on...

In cases with NO [f], the outline pane seems moved to the "end", but no node
selected.

Not a show stopper, but a bug nonetheless.

@color
#@+node:ekr.20071211083251: *5* Leo 4.4.5 final
Leo 4.4.5 final                               December 11, 2007

Leo 4.4.5 final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.4.5 fixes several long-delayed bug fixes and adds several new features.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.5:
----------------------------

- Fixes all known bugs.
- Leo now recognizes directives in headlines.
- Adds 3 new sort-lines commands.
- Adds commands to insert and delete icons from headlines.
- Adds all the Tango 16x16 icons to Leo's icon library.
- Adds support for @rst-preformat nodes to the rst3 plugin.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080106114331: *4* 4.4.6 bug fixes
#@+node:ekr.20071217092250: *5* leo 4.4.6 b1
Leo 4.4.6 beta 1                           December 17, 2007

Leo 4.4.6 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.4.6 fixes several recently reported bugs, all minor.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.6:
----------------------------
- Fixes all known bugs.
- Added @auto importers for javascript and xml files.
- Added find-next-clone and toggle-sparse-move commands.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20071217092203.1: *6* Bugs fixed
#@+node:ekr.20071217092203.2: *7* Fixed undo (dirty bit) problem)
http://sourceforge.net/forum/message.php?msg_id=4668960

It seems in external files you can delete some text and save, causing the derived
file to be written and all dirty flags cleared.  But then undo makes the text
come back, as expected, but save only saves the outline, because the dirty flag
wasn't set on the node in which the text was restored by undo.
#@+node:ekr.20071217092203.30: *7* Fixed cursesGui  plugin
#@+node:ekr.20071217092203.31: *7* Fixed script_io_to_body plugin
Added k.overrideCommand.
#@+node:ekr.20071217092203.45: *7* Make Import to @file create @file nodes
http://sourceforge.net/forum/message.php?msg_id=4671771
#@+node:ekr.20071217092203.51: *7* Fixed bug: rst3 plugin now finds default.css file correctly
http://sourceforge.net/forum/message.php?msg_id=4667105
#@+node:ekr.20071217092203.52: *7* Fixed bug with clear-recent-files
The command now clears all .leoRecentFiles.txt files and write a message.
#@+node:ekr.20071217092203.64: *7* Fixed bug: replace didn't always start in the correct place
This was a very long-standing bug: the most annoying in all of Leo.
#@+node:ekr.20071217092203.127: *7* fixed colorizer bug
The last char was not colored in the following doc part:

@

<tag />
#@+node:ekr.20071217092203.128: *7* Fixed clone focus bug
http://sourceforge.net/forum/message.php?msg_id=4676037
#@+node:ekr.20071217092203.130: *7* Removed call to printLine in change-all logic
This prevents over-long traces.
#@+node:ekr.20071217092203.131: *7* Fixed crash when copying or cloning to non-exisitent chapter
#@+node:ekr.20071217092203.161: *7* Added text bindings to status area
This fixes a focus problem.
#@+node:ekr.20071217092203.136: *7* Repaired damaged minusnode.gif icon
#@+node:ekr.20071217092203.137: *6* New features
#@+node:ekr.20071217092203.138: *7* Applied Terry Brown's config patch
The patch attached against leoConfig.py (current CVS) adds a machine
specific config file to the config files Leo loads.

I synchronize files between multiple (3) machines. This means I can't
use different myLeoSettings files on each.

Tk fonts are screen dpi sensitive.  But (in Linux at least)
Tk's attempts to switch a font you picked to something equivalent at a
different dpi always result in a font that looks terrible.

So every time I switch machines I edit ~/myLeoSettings.leo to move the
font defs I picked for the current machine to the bottom of the body
text for the appropriate settings node, and then restart Leo.

This patch means I don't have to do that any more.  I'm sure there are
other uses for it.  Python doesn't seem to have a generic machine name
finding function, hence the sequence of alternatives.
#@+node:ekr.20071217092203.145: *7* Applied plumloco's patch to plugins_menu.py
The version of plugins_menu.py at http://leo.zwiki.org/Plumloco separates out
the gui dependent dialogs (the menus are already gui independent) and made them
general purpose dialogs available to all plugins.

I have also slightly enhanced the dialogs to provide user defined buttons. 
#@+node:ekr.20071217092203.146: *7* Upgraded to Pmw 1.3
#@+node:ekr.20071217092203.147: *7* Added find-next-clone command
The finds the next cloned node, regardless of whether the presently selected node is a clone or not.
#@+node:ekr.20071217092203.149: *7* Added toggle-sparse-move command
The command toggles whether moving a node left collapses the outline.
#@+node:ekr.20071217092203.152: *7* Added support for @data nodes in @settings trees
#@+node:ekr.20071217092203.154: *7* Added @auto xml script
Use @data import_xml_tags setting to specify the xml tags that act as organizers.
#@+node:ekr.20071217092203.163: *7* Added @import scanners for javascript and xml files
Javascript regexps that look like section references cause problems, but that can not be helped.
#@+node:ekr.20080106114225: *5* leo 4.4.6 b2
Leo 4.4.6 beta 2                           January 15, 2008

Leo 4.4.6 beta 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.4.6 fixes several recently reported bugs, all minor.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.6:
----------------------------
- Fixes all known bugs.
- Added @auto importers for javascript and xml files.
- Added find-next-clone and toggle-sparse-move commands.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080106114648: *6* Fixed bugs
#@+node:ekr.20080106114203.1: *7* Fixed bug in nav_buttons plugin
http://sourceforge.net/forum/message.php?msg_id=4682598
#@+node:ekr.20080106114203.2: *7* Fixed problems with modes/rest.py
http://sourceforge.net/forum/message.php?msg_id=4681175

- There was a horrendous bug in the match_seq_regexp matcher which could cause the colorizer to loop.
- There was another horrendous bug in match_regexp_helper that cause spurious matches.
- Added some more defensive code to have the colorizer recover more gracefully in this case. 
- The jedit2py script was not associating regexp rules whose regex starts with
  '\' with the proper character. The proper character is the hash_char
  character, not the '\' character. As a result, regexp's that start with '\'
  never got matched.

The following colorizers are affected by the change:

modes/apacheconf.py
modes/erlang.py
modes/moin.py
modes/perl.py
modes/php.py
modes/pl1.py
modes/rest.py
modes/shell.py
modes/shellscript.py
#@+node:ekr.20080106114203.3: *7* Replaced delete-all-icons command with a script in script.leo
#@+node:ekr.20080106114203.4: *7* Leo issues better messages if Image can not be imported
http://sourceforge.net/forum/message.php?msg_id=4687706
#@+node:ekr.20080115093848.18: *7* Added convenience methods for icons
See http://webpages.charter.net/edreamleo/scripting.html#inserting-and-deleting-icons
#@+node:ekr.20080115093848.19: *7* Fixed undo bug
http://sourceforge.net/forum/message.php?msg_id=4712329
#@+node:ekr.20080115093848.23: *7* Don't mark nodes dirty if insert-icon is cancelled
http://sourceforge.net/forum/message.php?msg_id=4714779
#@+node:ekr.20080126090039: *5* leo 4.4.6 final
Leo 4.4.6 final                           January 26, 2008

Leo 4.4.6 final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.4.6 fixes several recently reported bugs, all minor.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.6:
----------------------------
- Fixes all known bugs.
- Added @auto importers for javascript and xml files.
- Added find-next-clone and toggle-sparse-move commands.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Home:     http://sourceforge.net/projects/leo/
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080218154129: *4* 4.4.7 ipython plugin
#@+node:ekr.20080212221734: *5* leo 4.4.7 b1
Leo 4.4.7 beta 1                           February 12, 2008

Leo 4.4.7 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version features the ipython plugin that provides a two-way bridge
between Leo and IPython.  See http://webpages.charter.net/edreamleo/IPythonBridge.html

Leo's main discussion is now at: http://groups.google.com/group/leo-editor

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.7:
----------------------------
- The ipython plugin creates a simple, powerful, effective bridge between IPython and Leo.
  See http://webpages.charter.net/edreamleo/IPythonBridge.html
- Improved handling of unicode encodings in @auto files.
- All import commands now support @path directives in ancestor nodes.
- Fixed several minor bugs.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080212221711.1: *6* Fixed bugs
#@+node:ekr.20080212221711.2: *7* Fixed perl syntax coloring bug
#@+node:ekr.20080212221711.4: *7* Removed warnings while typing @language directives
#@+node:ekr.20080212221711.15: *7* Fixed pascal import bug
http://groups.google.com/group/leo-editor/browse_thread/thread/4fa4709969fc04d
#@+node:ekr.20080212221711.35: *7* write-outline-only command now prints a 'done' message
#@+node:ekr.20080213094948.1: *7* Worked around problems with winpdb
There appear to be problems with Python's subprocess module on Ubuntu.
#@+node:ekr.20080213094948.4: *7* Fixed new problem with image.py
The version of PIL that ships with Ubuntu (and presumably Debian and maybe some
other distributions) no longer includes the ImageTk module. ImageTk is now
located in the python- imaging-tk package.
#@+node:ekr.20080212221711.32: *6* New features
#@+node:ekr.20080212221711.33: *7* All import commands now honor @path
#@+node:ekr.20080212221711.34: *7* Added ipython plugin
#@+node:ekr.20080212221711.47: *7* Added support for @bool open_with_save_on_update setting
If the @bool open_with_save_on_update setting is True,
Leo will automatically save the outline whenever an external editor
changes the outline.
#@+node:ekr.20080212221711.26: *7* Improved handling of unicode for @auto files
When reading an @auto tree, createOutline now does the following:

1. When importing Python files, createOutline uses the encoding implied by
Python's # -*- coding line. This line must be the first line of the imported file.

2. Otherwise, createOutline scans the @auto node and its ancestors for Leo's @encoding directive.

3. If no such @encoding directive is found, createOutline uses the encoding specified by the setting: @string default_at_auto_file_encoding = utf-8

4. If this setting does not exist, the utf-8 encoding is used.
#@+node:ekr.20080218153931: *5* leo 4.4.7 final
Leo 4.4.7 final                           February 18, 2008

Leo 4.4.7 final is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version features a new ipython plugin that provides a two-way bridge
between Leo and IPython.  See http://webpages.charter.net/edreamleo/IPythonBridge.html

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.7:
----------------------------
- The ipython plugin creates a simple, powerful, effective bridge between IPython and Leo.
  See http://webpages.charter.net/edreamleo/IPythonBridge.html
- Improved handling of unicode encodings in @auto files.
- All import commands now support @path directives in ancestor nodes.
- Fixed several minor bugs.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
CVS:      http://leo.tigris.org/source/browse/leo/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080218153931.1: *6* Fixed bugs
#@+node:ekr.20080218153931.2: *7* Fixed perl syntax coloring bug
#@+node:ekr.20080218153931.3: *7* Removed warnings while typing @language directives
#@+node:ekr.20080218153931.4: *7* Fixed pascal import bug
http://groups.google.com/group/leo-editor/browse_thread/thread/4fa4709969fc04d
#@+node:ekr.20080218153931.5: *7* write-outline-only command now prints a 'done' message
#@+node:ekr.20080218153931.6: *7* Worked around problems with winpdb
There appear to be problems with Python's subprocess module on Ubuntu.
#@+node:ekr.20080218153931.7: *7* Fixed new problem with image.py
The version of PIL that ships with Ubuntu (and presumably Debian and maybe some
other distributions) no longer includes the ImageTk module. ImageTk is now
located in the python- imaging-tk package.
#@+node:ekr.20080218154129.1: *7* Leo's old colorizer now colorizes Leo directives properly
#@+node:ekr.20080218153931.8: *6* New features
#@+node:ekr.20080218153931.9: *7* All import commands now honor @path
#@+node:ekr.20080218153931.10: *7* Added ipython plugin
#@+node:ekr.20080218153931.11: *7* Added support for @bool open_with_save_on_update setting
If the @bool open_with_save_on_update setting is True,
Leo will automatically save the outline whenever an external editor
changes the outline.
#@+node:ekr.20080218153931.12: *7* Improved handling of unicode for @auto files
When reading an @auto tree, createOutline now does the following:

1. When importing Python files, createOutline uses the encoding implied by
Python's # -*- coding line. This line must be the first line of the imported file.

2. Otherwise, createOutline scans the @auto node and its ancestors for Leo's @encoding directive.

3. If no such @encoding directive is found, createOutline uses the encoding specified by the setting: @string default_at_auto_file_encoding = utf-8

4. If this setting does not exist, the utf-8 encoding is used.
#@+node:ekr.20080311060457.215: *4* 4.4.8 translating args to g.es and g.es_print
#@+node:ekr.20080304112808: *5* 4.4.8 b1
Leo 4.4.8 beta 1                           March 5, 2008

Leo 4.4.8 beta 1 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version features a new ipython plugin that provides a two-way bridge
between Leo and IPython.  See http://webpages.charter.net/edreamleo/IPythonBridge.html

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.8:
----------------------------
- Leo's source code is now managed by bzr.
  See the Bzr link below.
- Leo's discussion is now hosted by Google Groups:
  See the Forum link below.
- The first, third, fifth etc. arguments to g.es and g.es_print
  can now be translated using Python's gettext.gettext function.
- Completed ILeo: a bridge between IPython and Leo.
  See http://webpages.charter.net/edreamleo/IPythonBridge.html
- Added support for arguments to minibuffer commands.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080304112802.1: *6* Allow arguments to minibuffer commands
http://mail.google.com/mail/#inbox/1184b70ea10f5aa3

Leo now contains minimal support for arguments to minibuffer commands.

- k.simulateCommand now puts arguments following the command name in k.givenArgs.
  Whitespace separates arguments.

- k.simulateCommand knows nothing about what the arguments mean. That is up to
  the individual commands.

- At present, only the following minibuffer commands now support k.givenArgs:
  open-outline, open-outline-by-name, save-file, save-file-as,
  save-file-as-unzipped and save-file-as-zipped.

  These commands use ''.join(k.givenArgs) to get the file name,
  which may cause problems if the file name contains whitespace.

- At present, the repeat-complex-command command does not support arguments.
#@+node:ekr.20080304112802.25: *6* Added translation services
@language rest
@color
#@+node:ekr.20080310093038.4: *7* Translating Leo's menus and messages
.. _gettext: http://docs.python.org/lib/module-gettext.html

It is easy to translate Leo's menu strings: simply create an @menus tree in
leoSettings.leo or myLeoSettings.leo that contains the translated menu names.

**New in Leo 4.4.8**:
Leo now contains support for translating messages sent to Leo's log:

- Rather than using an '_' function to denote strings to be translated, Leo's
  g.es and g.es_print functions translate "odd" (first, third, fifth) arguments,
  leaving "even" arguments untranslated. Keyword arguments, color, newline, etc.
  are never translated.

- All calls to g.es and g.es_print in Leo's core follow this convention.

- g.translateString does the actual translation using Python's `gettext`_ module.

- You can use the script in the node "@button print g.es stats" in scripts.leo
  to create catalogs of all scripts that need to be translated. Such catalogs
  are used by Python's gettext module. (This script was also used to check that
  the proper arguments to g.es and g.es_print were translated.)
#@+node:ekr.20080311060457.1: *5* 4.4.8 b2
Leo 4.4.8 beta 2                           March 14, 2008

Leo 4.4.8 beta 2 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version features a new ipython plugin that provides a two-way bridge
between Leo and IPython.  See http://webpages.charter.net/edreamleo/IPythonBridge.html

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.8:
----------------------------
- Leo's source code is now managed by bzr.
  See the Bzr link below.
- Leo's discussion is now hosted by Google Groups:
  See the Forum link below.
- The first, third, fifth etc. arguments to g.es and g.es_print
  can now be translated using Python's gettext.gettext function.
- Completed ILeo: a bridge between IPython and Leo.
  See http://webpages.charter.net/edreamleo/IPythonBridge.html
- Added support for arguments to minibuffer commands.
- @menu trees can now refer to commands created by
  @command and @button nodes
- Added support for common @commands nodes in settings files.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080311060457.210: *6* b1
#@+node:ekr.20080311060457.211: *7* Allow arguments to minibuffer commands
http://mail.google.com/mail/#inbox/1184b70ea10f5aa3

Leo now contains minimal support for arguments to minibuffer commands.

- k.simulateCommand now puts arguments following the command name in k.givenArgs.
  Whitespace separates arguments.

- k.simulateCommand knows nothing about what the arguments mean. That is up to
  the individual commands.

- At present, only the following minibuffer commands now support k.givenArgs:
  open-outline, open-outline-by-name, save-file, save-file-as,
  save-file-as-unzipped and save-file-as-zipped.

  These commands use ''.join(k.givenArgs) to get the file name,
  which may cause problems if the file name contains whitespace.

- At present, the repeat-complex-command command does not support arguments.
#@+node:ekr.20080311060457.212: *7* Added translation services
@language rest
@color
#@+node:ekr.20080311060457.213: *8* Translating Leo's menus and messages
.. _gettext: http://docs.python.org/lib/module-gettext.html

It is easy to translate Leo's menu strings: simply create an @menus tree in
leoSettings.leo or myLeoSettings.leo that contains the translated menu names.

**New in Leo 4.4.8**:
Leo now contains support for translating messages sent to Leo's log:

- Rather than using an '_' function to denote strings to be translated, Leo's
  g.es and g.es_print functions translate "odd" (first, third, fifth) arguments,
  leaving "even" arguments untranslated. Keyword arguments, color, newline, etc.
  are never translated.

- All calls to g.es and g.es_print in Leo's core follow this convention.

- g.translateString does the actual translation using Python's `gettext`_ module.

- You can use the script in the node "@button print g.es stats" in scripts.leo
  to create catalogs of all scripts that need to be translated. Such catalogs
  are used by Python's gettext module. (This script was also used to check that
  the proper arguments to g.es and g.es_print were translated.)
#@+node:ekr.20080311060457.216: *6* b2
#@+node:ekr.20080311060457.2: *7* Bug fixes
#@+node:ekr.20080311060457.3: *8* Assigned g.fileIndex on the fly
@nocolor

Eureka! I have just discovered an elegant solution to this problem!

The Aha is this:  we can create a "base" timestamp just *once*, when
the commander (i.e. the nodeIndices class) is created.  Thereafter,
code that writes gnx's simply calls nodeIndices.getIndex if the node
doesn't already have an index (or if indices are being reassigned in a
copied tree).

In other words, there is no need to be picky about timestamps, the
base timestamp will do, so there is no need to assign indices before
writing nodes!

I didn't see this before because computing timestamps is quite time
consuming.  In fact, we can't do so "on the fly".  That being so, the
old code computed the "new" timestamp once in assignFileIndices, which
lead me away from getting gnx's as needed.  But if there is only *one*
timestamp everything becomes easy.  There is no need to "batch" the
computation of gnx's.  In other words, timestamps don't have to be up-
to-the-second accurate.  They simply guarantee that two nodes (in a
particular outline) created by the *same* person can't collide.

This is the way it is written in "The Book". All calls to
assignFileIndices disappear!  All the code I wrote this morning that
remembers whether indices have been assigned disappears.  I'll keep a
do-nothing assignFileIndices around for compatibility with old
scripts.

This is *so* important.  It eliminates forever a source of serious
file write problems.  Furthermore, nodeIndices.getIndex becomes
substantially simpler. Even though the code was short, it implied some
very tricky assumptions.  Every time I read it I had to recreate why
it worked.  Those mental gymnastics should disappear.

A great day for Leo. 

@color
#@+node:ekr.20080311060457.28: *8* Allow tkFrame to complete before killing it
#@+node:ekr.20080311060457.38: *8* Renamed self.fileIndex to  readBufferIndex in file read logic
# This should have been done long ago.
#@+node:ekr.20080311060457.125: *8* Made sure that all fileIndex fields get converted on read
#@+node:ekr.20080311060457.128: *7* Features
#@+node:ekr.20080311060457.188: *8* Compile regexp's once in findNextMatch
http://sourceforge.net/forum/message.php?msg_id=4677335
#@+node:ekr.20080311060457.198: *8* Created menus very late in the creation process
This allows @menu items to refer to commands created by @button.
#@+node:ekr.20080314081157.1: *8* Improved marks/recent buttons plugin
- Added show-marks-dialog and show-recent-sections-dialog commands.
- Select an item initially.
- Added bindings for up and down arrows.
#@+node:ekr.20080314081157.2: *8* Added support for @commands trees in settings files
#@+node:ekr.20080328074117.340: *5* 4.4.8 b3
Leo 4.4.8 beta 3                           March 28, 2008

Leo 4.4.8 beta 3 is available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version features a new ipython plugin that provides a two-way bridge
between Leo and IPython.  See http://webpages.charter.net/edreamleo/IPythonBridge.html

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.8:
----------------------------
- Leo's source code is now managed by bzr: see link below.
- Leo's discussion is now hosted by Google Groups: see link below.
- Arguments to g.es and g.es_print can be translated using gettext.
- Completed ILeo: a bridge between IPython and Leo.
  See http://webpages.charter.net/edreamleo/IPythonBridge.html
- Minibuffer commands may have arguments.
- @menu trees can now refer to commands created by
  @command and @button nodes.
- Added support for common @commands nodes in settings files.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080328074117.2: *6* Fixed bugs
#@+node:ekr.20080328074117.3: *7* Corrected docs: unit tests are in test/unitTest.leo
#@+node:ekr.20080328074117.4: *7* Removed '.' from leoID
This fixes a bug that can corrupt .leo files.
#@+node:ekr.20080328074117.12: *7* Fixed Open With menu
http://groups.google.com/group/leo-editor/browse_thread/thread/62fe73901d14f6c3
#@+node:ekr.20080328074117.30: *7* Fixed @lineending botch
http://groups.google.com/group/leo-editor/browse_thread/thread/f802b083dee96312
#@+node:ekr.20080328074117.76: *7* Fixed undo problem with mutliple editors
http://mail.google.com/mail/#inbox/11899019a43f74ca

When you have two editors open on the same node most actions show up in both
editors, however, if you do an undo the change only show up in the selected
editor. (The change shows up in the other editor when you select it).
#@+node:ekr.20080328074117.77: *7* Write dirty bit if write fails
http://groups.google.com/group/leo-editor/browse_thread/thread/71822f48720e71bc/6e0fd1c72fa39817#6e0fd1c72fa39817
#@+node:ekr.20080328074117.135: *7* Fixed bug involving default_target_language
The new setting is @string target_language, not @language default_target_language.
#@+node:ekr.20080328074117.215: *7* Fixed plugins that create new menu items
@nocolor

http://groups.google.com/group/leo-editor/browse_thread/thread/6a5087a59d6d23

- Changed menu1 to menu2 in several plugins.
- Changed menu2 to menu-update.
- Moved after-create-leo-frame to after menu2.
#@+node:ekr.20080328074117.216: *6* Features
#@+node:ekr.20080328074117.217: *7* Added @bool collapse_nodes_while_spelling setting
This hugely speeds up spelling when there are lots of misspelled words.
#@+node:ekr.20080328074117.220: *7* Errors reading external files give line numbers
#@+node:ekr.20080328074117.262: *7* Added @bool allow_middle_button_paste
@nocolor

http://groups.google.com/group/leo-editor/browse_thread/thread/62fe73901d14f6c3

And, while you're looking at the editor code :-) - in linux when you paste in
text to a body editor with a middle mouse button click, it's not stored unless
you follow that with a key stroke or some other action in the body editor. If
you instead middle button paste to the editor and then click on another node in
the tree, the text's forgotten.

To do-->@thin ../doc/leoToDoLater.txt-->Can't or won't-->Known Bugs: can't be fixed or can wait-->Bug: can't be fixed-->Cut/paste bug on X windows (waiting for help)

@color
#@+node:ekr.20080328074117.297: *7* Added support for @popup settings
#@+node:ekr.20080403065258.10: *5* 4.4.8 rc1
Leo 4.4.8 rc1                        April 3, 2008

Leo 4.4.8 rc1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version features a new ipython plugin that provides a two-way bridge
between Leo and IPython.  See http://webpages.charter.net/edreamleo/IPythonBridge.html

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.8:
----------------------------
- Leo's source code is now managed by bzr: see link below.
- Leo's discussion is now hosted by Google Groups: see link below.
- Arguments to g.es and g.es_print can be translated using gettext.
- Completed ILeo: a bridge between IPython and Leo.
  See http://webpages.charter.net/edreamleo/IPythonBridge.html
- Minibuffer commands may have arguments.
- @menu trees can now refer to commands created by
  @command and @button nodes.
- Added support for common @commands nodes in settings files.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080403065258.6: *6* Fixed delete-editor problem
http://groups.google.com/group/leo-editor/browse_thread/thread/ed5d82429e1ec821

The following sequence of commands caused problems:

add-editor
add-editor
delete-editor
delete-editor
add-editor
#@+node:ekr.20080405074410.4: *4* 4.4.8 final
Leo 4.4.8 final                        April 6, 2008

Leo 4.4.8 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

This version features a new ipython plugin that provides a two-way bridge
between Leo and IPython.  See http://webpages.charter.net/edreamleo/IPythonBridge.html

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.4.8:
----------------------------
- Leo's source code is now managed by bzr: see link below.
- Leo's discussion is now hosted by Google Groups: see link below.
- Arguments to g.es and g.es_print can be translated using gettext.
- Completed ILeo: a bridge between IPython and Leo.
  See http://webpages.charter.net/edreamleo/IPythonBridge.html
- Minibuffer commands may have arguments.
- @menu trees can now refer to commands created by
  @command and @button nodes.
- Added support for common @commands nodes in settings files.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080405074410.7: *5* Open leoPluginsRef.leo in help menu if leoPlugins.leo does not exist
#@+node:ekr.20080405074410.9: *5* Fixed big performance bug in find/spell commands.
#@+node:ekr.20080405074410.38: *5* Fixed several unit testing bugs relating to doTests(all=True)
#@+node:ekr.20080730095710.1: *3* 4.5 code reorgs, vim bindings, @shadow
#@+node:ekr.20080624093059.1: *4* 4.5 b1
Leo 4.5 beta 1                      June 28, 2008

Leo 4.5 beta 1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.5:
--------------------------
- A major revision of Leo's node structures, compatible with so-called unified nodes.
- A major revision of Leo's key-handling code.  Most per-pane key bindings have been eliminated.
- A major revision of Leo's outline drawing and focus handling code.
  Calls to c.beginUpdate and c.endUpdate simply request later redrawing in c.outerUpdate.
- The beginning of usable vim-like bindings.  More support is coming.
- Many small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080624093059.2: *5* Bug fixes
#@+node:ekr.20080624093059.3: *6* Fixed bug in appendToRecentFiles
#@+node:ekr.20080624093059.4: *6* Fixed bug in install script
On Mon, Apr 7, 2008 at 7:07 PM, SegundoBob <bhossley@ieee.org> wrote:

I installed Leo 4.4..8 final on Ubuntu.  The installation failed
because the installation put files in /usr/lib/leo/leo.  The
duplicated leo is a mistake.
On line 13 of install I changed:
LEO_LIB_DIR="${LEO_PREFIX}/lib/leo"
to
LEO_LIB_DIR="${LEO_PREFIX}/lib"

With the change the installation worked.
#@+node:ekr.20080624093059.5: *6* Fixed bug: no focus after save-as and save-to commands
#@+node:ekr.20080624093059.6: *6* Fixed find bug
http://groups.google.com/group/leo-editor/browse_thread/thread/294866696257802e
#@+node:ekr.20080624093059.7: *6* Fixed find completion bug
Trying to edit the minibuffer, when I backspace to a character and
press delete the cursor moves to the end of the buffer and deletes the
last character instead.
#@+node:ekr.20080624093059.8: *6* Fixed how-many, find-word and goto-character commands
find-word
=========
This command is supposed to:

"Put the cursor at the next word (on a line) that starts with a
character"

It does not. You have to type in a whole word to get any result and
even then
it only selects the word it does not move the cursor to it.


goto-character
==============
'''Put the cursor at the n'th character of the buffer.'''

Doesn't do anything.
#@+node:ekr.20080624093059.9: *6* Fixed import PHP bug
http://groups.google.com/group/leo-editor/browse_thread/thread/b068e88a577a0547
#@+node:ekr.20080624093059.10: *6* Fixed keyword handling in g.es and g.es_print
#@+node:ekr.20080624093059.11: *6* Fixed new @auto bug
Leo's running, so I create a new outline with File->New

Then I save as in a location where foo.py exists.

The I create a node '@auto foo.py'

Then I use File->Read/Write->Read @auto (with that node selected)

Leo says it can't read it.

I close the leo file, re-open in from the recent files menu of the
outline that spawned it, and the @auto file is read no problems.
#@+node:ekr.20080624093059.12: *6* Fixed recent files bug
http://groups.google.com/group/leo-editor/browse_thread/thread/c6c4faf6fdead672
#@+node:ekr.20080624093059.14: *6* Greatly increased speed of undo clone-find-all
findAll now just creates undo info for clone-find-all for one inserted node.
#@+node:ekr.20080624093059.15: *6* Temporary fix for php import bug
#@+node:ekr.20080624093059.16: *6* Fixed unbounded loop in autocompleter.findAnchor
#@+node:ekr.20080624093059.17: *6* Fixed insert-newline bug
exception executing command
Traceback (most recent call last):
 File "C:\_Proj\Leo\key-handling\leo\src\leoCommands.py", line 298, in doCommand
   val = command(event)
 File "C:\_Proj\Leo\key-handling\leo\src\leoEditCommands.py", line 2946, in insertNewLine
   self.insertNewlineHelper(w=w,oldSel=oldSel,undoType=None)
 File "C:\_Proj\Leo\key-handling\leo\src\leoEditCommands.py", line 3104, in insertNewlineHelper
   w.setInsertPoint(i+1)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
truncating headline to one line
#@+node:ekr.20080624093059.18: *6* Single click did not color body correctly
#@+node:ekr.20080624093059.19: *6* Body not colored correctly after find
#@+node:ekr.20080624093059.20: *6* Fixed big performance bug in contract-all command
#@+node:ekr.20080624093059.21: *6* Changed bindings so Home and end keys work as expected when editing a headline
#@+node:ekr.20080624093059.22: *6* Fixed bug: myLeoSettings.leo sometimes read twice
http://groups.google.com/group/leo-editor/browse_thread/thread/35a8ea2024036623s
#@+node:ekr.20080624093059.23: *6* Compute menus list for each c
http://sourceforge.net/forum/forum.php?thread_id=1858451&forum_id=10228
#@+node:ekr.20080624093059.24: *6* Fixed minor spelling bug
http://groups.google.com/group/leo-editor/browse_thread/thread/d2a9aeac0d0082f6
#@+node:ekr.20080624093059.25: *6* Fixed spell bug: words containing unicode characters aren't saved properly
#@+node:ekr.20080624093059.26: *6* Fixed coloring bugs in reformatParagraph and c.redraw
#@+node:ekr.20080624093059.27: *6* Fixed missing redraw problem
Changed c.outerUpdate and added c.bind and c.bind2.
#@+node:ekr.20080624093059.28: *6* Fixed new-headline problem
#@+node:ekr.20080624093059.29: *6* Fixed recent crasher
Traceback (most recent call last):
  File "c:\leo.repo\trunk\leo\core\leoCommands.py", line 311, in doCommand
    val = command(event)
  File "c:\leo.repo\trunk\leo\core\leoEditCommands.py", line 4781, in selectAllText
    return w.selectAllText()
AttributeError: Canvas instance has no attribute 'selectAllText'
#@+node:ekr.20080624093059.30: *6* Fixed encoding problems with paste from clipboard
#@+node:ekr.20080624093059.31: *6* Changed installer to support leo-as-a-package
http://groups.google.com/group/leo-editor/browse_thread/thread/8edc4e7b809189cf
#@+node:ekr.20080628062747.69: *6* Fixed undo problem
http://groups.google.com/group/leo-editor/browse_thread/thread/794ca596f7c58ae5

The fix was to call c.redraw_now in undo() and redo().  This allows the undo interlock to work.
#@+node:ekr.20080628062747.70: *6* Fixed insert-file bug
Minor nit - insert-file to load a file into a node, text appears in the
body pane.  Without doing anything else to the body pane click on
another node.  Inserted text is lost - body for node is empty.  As long
as you move the cursor into the body frame and press a key after
inserting the contents, it's retained.
#@+node:ekr.20080628062747.71: *6* Fixed script button bug
@nocolor

c.beginUpdate()
try:
 add / change icons on some nodes
 c.setChanged(True)
finally:
 c.endUpdate()

seems not to give a redraw *after* a script button is pressed.

It does give one before the action is taken, so pressing the button
twice shows the change.

EKR: The fix was to mod_scripting.py.

@color
#@+node:ekr.20080628062747.72: *6* Fixed dragging bug
The fix was a major addition to p._adjustPositionBeforeUnlink.

Report:

Run this script:

t = p.insertAfter()
c.setHeadString(t, 'test node 1')
t = t.insertAfter()
c.setHeadString(t, 'test node 2')
t = t.insertAfter()
c.setHeadString(t, 'test area')
for i in range(200):
   n = t.insertAsLastChild()
   c.setHeadString(n, str(i))
   if i == 3: x = n

for i in range(100):
   n = x.insertAsLastChild()
   c.setHeadString(n, str(i+500))

t.expand()

It creates an outline, you might need to click on the node from which
the script was run to see what was added.  It should look like this:

test node 1
test node 2
test area
   1
   2
  +3
   4
   5
   etc.

Now, use the mouse to drag test node 1 down to a position after node
4... for me at least this results in the outline view leaping to the
bottom of the tree, which it shouldn't do.

Scroll back up to the top, and drag test node 2 down to a position
after node 4, this time no leap.

It appears that the first time you drag something into the test area it
reacts as if 3 is expanded and repositions to allow for all those
actually not visible lines, but the second time you drag something in
it's ok, as if it has an accurate count on visible lines now.
#@+node:ekr.20080624093059.32: *5* Features
#@+node:ekr.20080624093059.33: *6* Remove useTextWidget option from leoKeys.py
#@+node:ekr.20080624093059.34: *6* Set use_sax = True always
#@+node:ekr.20080624093059.35: *6* Added g.unified_nodes
- Made t arg optional in vnode ctor.

- Removed the t arg from insertAsX.  Affects these plugins:

wrote:     base64Packager.py
wrote:     macros.py
wrote:     table.py
wrote:     templates.py
wrote:     xsltWithNodes.py

Search for tnode.
#@+node:ekr.20080624093059.36: *6* Added install nodes re Leo's home directory
Leo puts several files in the home directory: .leoID.txt,
.leoRecentFiles.txt, and myLeoSettings.leo.  There are various fallback directories if there is no home directory.

If you want more details, you can do what I did: do a clone-find-all for homeDir.

As for how the home directory is set, the code to do this is g.computeHomeDir.  We get the home directory with

home = os.getenv('HOME',default=None)

There are some mind-numbing details to be handled if there os.getenv does, in fact, return a directory.
#@+node:ekr.20080624093059.37: *6* Added support for @bool fixedWindow option
Leo suppresses marks, expansion state, orphan bits and current
position bits when writing fixed .leo files.  As a result, all nodes
will be collapsed and the root node will always be selected when Leo
opens a fixed .leo file.

When writing fixed .leo files, Leo writes fixed, immutable, reasonable
defaults for window size, position and body-outline ratio.
Specifically, width,height,left,top = 700,500,50,50 and the ratio is
0.5. These values are written so older versions of Leo can read fixed
files.

You make a file fixed by putting '@bool fixedWindow = True' in the
@settings tree of a particular .leo file.  The file will be fixed
after you save the file, reload the file, and save the file again.
Yes, this is clumsy, but it only has to be done once.  A toggle-fixed
file command doesn't seem that useful: using an @bool node is simple
and clear.

You can optionally specify the size and position on the screen of
fixed .leo files by putting an '@data fixedWindowPosition' node in the
@settings tree of myLeoSettings.leo or leoSettings.leo.  You should
**not** put such a node in the fixed .leo file itself--everyone who
opens the file would get that fixed position.

The body of the '@data fixedWindowPosition' node should contain
something like this:

# Must be four entries: width,height,left,top.
# Put this in myLeoSettings.leo, **not** in individual .leo files.

1200
800
50
50

Leo uses reasonable defaults for fixed .leo files if this node does
not exist, or contains something other than 4 numbers, one per line. 
#@+node:ekr.20080624093059.38: *6* Added new key-handling
This allows substantially simpler key bindings. Indeed, most per-pane bindings
have been eliminate.
#@+node:ekr.20080624093059.39: *6* New drawing/focus code
#@+node:ekr.20080624093059.40: *6* Improved end of calltips
# Added ')' at end.
#@+node:ekr.20080624093059.41: *6* Find character crosses lines
#@+node:ekr.20080624093059.42: *6* Added os.curdir to sys.path if possible
This is necessary to simulate operation as a package.
#@+node:ekr.20080624093059.43: *6* Added support for single-config option
This code appears to have been reverted in such a way that it never got pushed to launchpad.
#@+node:ekr.20080624093059.44: *6* Finished Tracer class
This is a Python 'debugger' that computes a call graph.

To trace a function and its callers, put the following at the function's start::

    g.startTracer()
#@+node:ekr.20080624093059.45: *6* Rewrote option-parsing code using optparse
#@+node:ekr.20080624093059.46: *6* Added @bool cleo_color_ignore = True
This determines whether cleo colors @ignore headlines. The default is True.
#@+node:ekr.20080624093059.47: *6* Set cwd in read/write commands
This affect the following commands:

open, save, save-as, save-to, read-outline-only, read-file-into-node, write-file-from-node and all the import/export commands.
#@+node:ekr.20080624093059.48: *6* Added  vim patches
Headline pane:

- Prevented "--> exit-named-modes" from switching focus to the Body pane.
    Removed 'c.frame.log.deleteTab('Mode') from endMode

Body pane:

- Enabled search for 'space' character in text
    Removed 'if ch.isspace(): return' in zapToCharacter:

- Eliminated delete-word from removing trailing white space
    Removed 'self.killWs(event)' in killWord and backwardKillWord

- Put zapped text to clipboard
    Added 'g.app.gui.replaceClipboardWith(s[ins:i])' after 'sel.addToKillBuffer(s[ins:i])' in zapToCharacter

@nocolor
#@+node:ekr.20080624093059.49: *7* Realization
Leo Configuration:
    | The following configuration was used for all testing:
        @strings  top_level_unbound_key_action = command
        @bool stayInTreeAfterEditHeadline = True
        @bool stayInTreeAfterSelect = True
        @bool outline_pane_has_initial_focus = True

Leo's Panes:
    | A "pane" is a area of the screen containing a user interface
    | dedicated to supporting a common set of tasks.  Vi key mappings are
    | associated with the Outline pane, the Body pane, or to the Leo
    | program.  See the no pane (see "General Commands" below). (Outline
    | pane, Body pane)

Leo's Command/Insert States:
    Command state - Denoted by a blue background color (Outline,Body pane)
        | Keys are mapped to commands.
    Insert state - Denoted by a red background color (Outline,Body pane)
        | Keys pressed are inserted into the text.
    Grayed state - Denoted by a gray background color (Outline pane)
        | Keys pressed will cause the next node with a headline starting
        | with that key to be selected.  This "select node by first
        | character" feature is built into Leo. It is not part of the vi
        | support.
        | 
        | This state is intentionally avoided in the vi based outline key
        | mappings. If in the "Grayed" state, enter Ctrl-i to switch to the
        | "Command" state.  The "Grayed" state can be entered from the
        | outline's "Command" state by pressing the Ctrl-] key.

Leo's modes:
| Most vi commands are implemented using Leo's "mode" functionality.
| Modes beginning with "vi-" denote a vi command for the body pane.
| Modes beginning with "tree-" denote a vi-like command for the outline.
| Modes beginning with "body-" denote outline commands that can be called
| from the body pane (and return focus back to the body pane)
| 
| Modes are used both for managing multi-key vi commands and for defining
| macros.

    Multi-key command modes:
    | Vi has many commands that require multiple keys to invoke.  Each key
    | accept the last in the command are assigned to a mode that, when
    | executed, maps the subsequent allowed keys in the command sequence.
    | The last key in the sequence is mapped directly to a Leo command or
    | to a "Macro" mode (see below). Any modes mapped to a key by another
    | mode are located in a child node of the mode node doing the mapping.
    | 
    | Example:
    |     dtw = Delete To the 'W' character (note the capital letters)
    |   The 'd' key is mapped to vi-delete-object
    |   vi-delete-object maps the 't' key to vi-delete-to-char
    |   vi-delete-to-char contains Leo commands to perform the vi command.

    Macros modes:
    | Most vi commands do not have an equivalent Leo command.  Instead, a
    | series of Leo commands must be issued to emulate the vi command.
    | The Leo commands needed to emulate a vi command are placed in a
    | single @mode node.

Code limitations:
    Current character:
    | Vi implementation normally use two different "current character"
    | designators depending on the current state.

        Insert state:
        | In the Insert state, a vertical bar is placed between two
        | characters to indicate where the next key will be inserted.
        | Leo's cursor is of this type.

        Command state: 
        | In the Command state, vi expects that the cursor is highlighting
        | a current character and provides commands to enter the insert
        | state or paste text either before or after that current
        | character.  Leo's vi emulation currently does not support a
        | "current character" cursor. As a result, inserting and pasting
        | before or after is replaced by inserting or pasting "at" the
        | current cursor location.  For example, the 'i' and 'a' command
        | are both mapped to enter the insert state at the current cursor
        | location.

    Conditional code execution:
    | No conditional command invocation exits.  Instead, conditional
    | branching is replace by setup commands that insure that, regardless
    | of current state, the command performs correctly.  For example,
    | Beginning-of-line command will go to previous line if called when
    | cursor is at beginning of line.  Vi requires that '|' always goes to
    | beginning of current line.  Problme is solved by issueing
    | forward-char command to insure cursor is moved off of the beginning
    | of the line before beginning-of-line command is issued.

    Commands requesting user input:
    | Commands getting user input must be the last command within the
    | mode.  See "Commands getting user input" in Problems section below.

    Edit headings using modes:
    | Commands modifying or selecting headline text do not work correctly
    | within a mode.  See "Editing headlines within modes" in Problems
    | section below.  This eliminates accurate implementation of vi's
    | delete/change/substitute/yank object commands.  Instead, the
    | commands are modified to only select text.
#@+node:ekr.20080624093059.50: *7* Problems
Binding numeric keys:
| Mapping a number to a command or mode prevents the number from being
| entered as text while in the insert state.

Binding '?' key:
| No response when key pressed.

Binding 'bksp' key:
| Binding 'bksp' key to back-char to move back a character in command mode
| prevents 'bksp' from deleting characters in text edit mode.

Commands getting user input:
| Commands requesting user input must be the last command executed.  These
| commands include: find-character and zap-to-character.

Editing headlines within modes:
| Text editing commands do not work within modes assigned to outline key
| mappings.

Undo command:
| The 'undo' command sometimes does not work when returning to a node's
| command mode.  Moving to another node fixes the problem.(i.e. delete-char, set-insert-state, ...)

Matching bracket command:
| Performs bracket matching on Body text when in node's headline command
| state.

Word definition:
| "Word" related commands determine boundries of a word differently.

Toggle case:
| Leo provides support for switching to upper or lower case but no method |
| exists to toggle between cases.

Find settings
| Leo commands only allow toggling of search settings.  If specific "set"
| and "clear" search setting commands were available then searches from the
| body pane could be restricted to the body pane and searches from the
| outline could be restricted to the outline.
Forward and backward sentences:
| Leo's forwardSentenceHelper and backSentenceHelper functions do not stop
| at empty lines nor do they skip over periods within words nor do they stop
| at sentences ending in non-periods nor do they stop at the end or
| beginning of the buffer.

Focus to Body pane:
| Leo functions exist which unconditionally set focus to the body pane
| regardless of the active pane.
    deleteTab() function:
        | Issuing "--> exit-named-mode" calls "endMode" function which calls
        | "c.frame.log.deleteTab('Mode')" function which sets the focus to the
        | body pane.  

Displaying mode help:
| The "--> mode-help" command displays all mapped keys using a capitol
| letter regardless of the actual binding.
    Recommendations:
    | To better support narrow tab cards, display the mode's label without
    | the "enter-" and "-mode" text and place key label before mode label.
    | Results in change from:
    |                enter-vi-delete-line-mode D
    |    enter-vi-delete-to-begin-of-word-mode B 
    | to:
    |    D : vi-delete-line
    |    B : vi-delete-to-begin-of-word
#@+node:ekr.20080624093059.51: *7* Notes
Yank vs. Yank
| A vi "yank" operation copies the selected text TO the clipboard.
| A Leo "yank" operation inserts text FROM the clipboard.

copy-text in modes:
| Leo's copy-text does not work within a mode.  As a result, all "copy to
| clipboard" capability is being implemented using kill-<object> command
| followed by a "yank" command.

paste-text in modes:
| paste-text in modes does not work.  Use Leo's "yank" instead.

delete-node does not copy node to clipboard:
| Issue copy-node command followed by delete-node
#@+node:ekr.20080624093059.52: *6* Added 'kill' bindings
#@+node:ekr.20080624093059.53: *6* Added check for empty @nosent nodes
These are now treated much like empty @auto nodes
#@+node:ekr.20080730095710.2: *4* 4.5 b2
Leo 4.5 beta 2                      August 7, 2008

Leo 4.5 beta 2 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.5 contains many important new features.  See below for details.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.5:
--------------------------

- Full support for @shadow files in Leo's core.
- Major improvements to Leo's key binding code.
- The beginning of usable vim-like bindings.
- uA's may now be associated with vnodes in @thin and @shadow files.
- Several major reorganizations of Leo's code:
  including sax-based parsing, support for the Graph world (unified nodes),
  simplified drawing code.
- Leo is now an installable package.
- Prepared code to be ready for Python 3.0.
- Many small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080806211440.188: *5* Major new features
.. _`v.uA's`: http://groups.google.com/group/leo-editor/browse_thread/thread/750bb3099090f5b

- Added support for @shadow files.
  This is a major breakthrough.
  See the `Using @shadow`_ chapter for full details.

- Added much improved support for vim bindings.

- Allow `v.uA's`_ in @file and @shadow nodes.
#@+node:ekr.20080806211440.253: *5* Major code reorganizations
- Leo now uses a sax-based parser to read .leo files.
  This makes it possible to extend Leo's file format without invalidating previous versions of Leo.

- Leo now supports the so-called 'Graph World'.
  When g.unified_nodes is True, Leo moves all information from tnodes into vnodes.

- Leo now uses a new key binding scheme.
  This allows substantially simpler key bindings. Indeed, most per-pane bindings
  have been eliminated.
  Added support for kill bindings.

- Leo is now an installable package.
  To make this work, Leo adds os.curdir to sys.path if needed on startup.

- Reorganized Leo's drawing and focus code.
  As a result, calls to c.beginUpdate and c.endUpdate are no longer needed.

- Leo is now ready for Python 3.x:
  Change most print statements to calls to g.pr.
#@+node:ekr.20080806211440.256: *5* Minor new features
- Added g.Tracer class.  This is a Python 'debugger' that computes a call graph.
  To trace a function and its callers, put the following at the function's start::

    g.startTracer()

- The find-character command now finds characters across line boundaries.

- Set cwd in read/write commands. This affect the following commands:
  open, save, save-as, save-to, read-outline-only, read-file-into-node,
  write-file-from-node and all the import/export commands.

- Leo creates the .leo folder in the user's HOME directory, and puts several configuration files there.
  Leo looks for myLeoSettings.leo in HOME/.leo.
  Leo uses os.path.expanduser("~") if there is no home setting.
#@+node:ekr.20080806211440.189: *5* New settings
- The default settings for @shadow files are now located in leoSettings.leo in the node::

        @settings-->File options-->Shadow files

    The defaults for these settings are::

        @string shadow_prefix = x
        @string shadow_subdir = .leo_shadow

- Added support for @bool fixedWindow option.

    Leo suppresses marks, expansion state, orphan bits and current position bits
    when writing fixed .leo files. As a result, all nodes will be collapsed and
    the root node will always be selected when Leo opens a fixed .leo file.

    You can optionally specify the size and position on the screen of fixed .leo
    files by putting an '@data fixedWindowPosition' node in the
    \@settings tree of myLeoSettings.leo or leoSettings.leo.  You should
    **not** put such a node in the fixed .leo file itself--everyone who
    opens the file would get that fixed position.

    The body of the '@data fixedWindowPosition' node should contain
    something like this::

        # Must be four entries: width,height,left,top.
        # Put this in myLeoSettings.leo, **not** in individual .leo files.

        1200
        800
        50
        50

- Added @bool cleo_color_ignore = True

    This determines whether cleo colors @ignore headlines. The default is True.
#@+node:ekr.20080815093141.89: *4* 4.5 b3
Leo 4.5 beta 3                      August 15, 2008

Leo 4.5 beta 3 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.5 contains many important new features.  See below for details.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.5:
--------------------------

- Full support for @shadow files in Leo's core.
- Major improvements to Leo's key binding code.
- The beginning of usable vim-like bindings.
- uA's may now be associated with vnodes in @thin and @shadow files.
- Several major reorganizations of Leo's code:
  including sax-based parsing, support for the Graph world (unified nodes),
  simplified drawing code.
- Leo is now an installable package.
- Prepared code to be ready for Python 3.0.
- Many small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080815093141.90: *5* Major new features
- Added support for @shadow files.
  This is a major breakthrough.
  See `Chapter 23`_ for full details.

- Added much improved support for vim bindings.

- Allow v.uA's in @thin and @shadow nodes.
  See http://groups.google.com/group/leo-editor/browse_thread/thread/750bb3099090f5b
#@+node:ekr.20080815093141.91: *5* Major code reorganizations
- Leo now uses a sax-based parser to read .leo files.
  This makes it possible to extend Leo's file format without invalidating previous versions of Leo.

- Leo now supports the so-called 'Graph World'.
  When g.unified_nodes is True, Leo moves all information from tnodes into vnodes.

- Leo now uses a new key binding scheme.
  This allows substantially simpler key bindings. Indeed, most per-pane bindings
  have been eliminated.
  Added support for kill bindings.

- Leo is now an installable package.
  To make this work, Leo adds os.curdir to sys.path if needed on startup.

- Reorganized Leo's drawing and focus code.
  As a result, calls to c.beginUpdate and c.endUpdate are no longer needed.

- Leo is now ready for Python 3.x:
  Change most print statements to calls to g.pr.
#@+node:ekr.20080815093141.92: *5* Minor new features
- Added g.Tracer class.  This is a Python 'debugger' that computes a call graph.
  To trace a function and its callers, put the following at the function's start::

    g.startTracer()

- The find-character command now finds characters across line boundaries.

- Set cwd in read/write commands. This affect the following commands:
  open, save, save-as, save-to, read-outline-only, read-file-into-node,
  write-file-from-node and all the import/export commands.

- Create myLeoSettings.leo if it does not exist.
  Leo create a simple template myLeoSettings.leo in the home directory if no other
  copy of myLeoSettings.leo exists.

- Added support for @args list for @button nodes.
  See the docstring for the mod_scripting plugin for details.

#@+node:ekr.20080815093141.93: *5* New settings
- The default settings for @shadow files are now located in leoSettings.leo in the node::

    @settings-->File options-->Shadow files

  The defaults for these settings are::

    @string shadow_prefix = x
    @string shadow_subdir = .leo_shadow

- Added support for @bool fixedWindow option. Leo suppresses marks, expansion
  state, orphan bits and current position bits when writing fixed .leo files. As
  a result, all nodes will be collapsed and the root node will always be
  selected when Leo opens a fixed .leo file.

  You can optionally specify the size and position on the screen of fixed .leo
  files by putting an '@data fixedWindowPosition' node in the
  @settings tree of myLeoSettings.leo or leoSettings.leo.  You should
  **not** put such a node in the fixed .leo file itself--everyone who
  opens the file would get that fixed position.

  The body of the '@data fixedWindowPosition' node should contain
  something like this::

    # Must be four entries: width,height,left,top.
    # Put this in myLeoSettings.leo, **not** in individual .leo files.

    1200
    800
    50
    50

- Added @bool cleo_color_ignore = True
  This determines whether cleo colors @ignore headlines. The default is True.

- Added @bool suppress_import_parsing setting
  When True, @auto and @shadow import the entire file into a single node.
#@+node:ekr.20080827175609.55: *4* 4.5 rc1
Leo 4.5 release candidate 1                      August 28, 2008

Leo 4.5 rc1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.5 contains many important new features.  See below for details.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.5:
--------------------------

- Full support for @shadow files in Leo's core.
- Major improvements to Leo's key binding code.
- The beginning of usable vim-like bindings.
- uA's may now be associated with vnodes in @thin and @shadow files.
- Several major reorganizations of Leo's code:
  including sax-based parsing, support for the Graph world (unified nodes),
  and simplified drawing code.
- Leo is now an installable package.
- Prepared code to be ready for Python 3.0.
- Many small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080827175609.56: *5* Major new features
- Added support for @shadow files.
  This is a major breakthrough.
  See `Chapter 23`_ for full details.

- Added much improved support for vim bindings.

- Allow v.uA's in @thin and @shadow nodes.
  See http://groups.google.com/group/leo-editor/browse_thread/thread/750bb3099090f5b
#@+node:ekr.20080827175609.57: *5* Major code reorganizations
- Leo now uses a sax-based parser to read .leo files.
  This makes it possible to extend Leo's file format without invalidating previous versions of Leo.

- Leo now supports the so-called 'Graph World'.
  When g.unified_nodes is True, Leo moves all information from tnodes into vnodes.

- Leo now uses a new key binding scheme.
  This allows substantially simpler key bindings. Indeed, most per-pane bindings
  have been eliminated.
  Added support for kill bindings.

- Leo is now an installable package.
  To make this work, Leo adds os.curdir to sys.path if needed on startup.

- Reorganized Leo's drawing and focus code.
  As a result, calls to c.beginUpdate and c.endUpdate are no longer needed.

- Leo is now ready for Python 3.x:
  Change most print statements to calls to g.pr.
#@+node:ekr.20080827175609.58: *5* Minor new features
- Added g.Tracer class.  This is a Python 'debugger' that computes a call graph.
  To trace a function and its callers, put the following at the function's start::

    g.startTracer()

- The find-character command now finds characters across line boundaries.

- Set cwd in read/write commands. This affect the following commands:
  open, save, save-as, save-to, read-outline-only, read-file-into-node,
  write-file-from-node and all the import/export commands.

- Added support for @args list for @button nodes.
  See the docstring for the mod_scripting plugin for details.

- Leo creates the .leo folder in the user's HOME directory, and puts several configuration files there.
  Leo looks for myLeoSettings.leo in HOME/.leo.
#@+node:ekr.20080827175609.59: *5* New settings
- The default settings for @shadow files are now located in leoSettings.leo in the node::

    @settings-->File options-->Shadow files

  The defaults for these settings are::

    @string shadow_prefix = x
    @string shadow_subdir = .leo_shadow

- Added support for @bool fixedWindow option. Leo suppresses marks, expansion
  state, orphan bits and current position bits when writing fixed .leo files. As
  a result, all nodes will be collapsed and the root node will always be
  selected when Leo opens a fixed .leo file.

  You can optionally specify the size and position on the screen of fixed .leo
  files by putting an '@data fixedWindowPosition' node in the
  @settings tree of myLeoSettings.leo or leoSettings.leo.  You should
  **not** put such a node in the fixed .leo file itself--everyone who
  opens the file would get that fixed position.

  The body of the '@data fixedWindowPosition' node should contain
  something like this::

    # Must be four entries: width,height,left,top.
    # Put this in myLeoSettings.leo, **not** in individual .leo files.

    1200
    800
    50
    50

- Added @bool cleo_color_ignore = True
  This determines whether cleo colors @ignore headlines. The default is True.

- Added @bool suppress_import_parsing setting
  When True, @auto and @shadow import the entire file into a single node.
#@+node:ekr.20080830082008.1: *4* 4.5 rc2
Leo 4.5 release candidate 2                     August 30, 2008

Leo 4.5 rc2 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.5 contains many important new features.  See below for details.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.5:
--------------------------

- Full support for @shadow files in Leo's core.
- Major improvements to Leo's key binding code.
- The beginning of usable vim-like bindings.
- uA's may now be associated with vnodes in @thin and @shadow files.
- Several major reorganizations of Leo's code:
  including sax-based parsing, support for the Graph world (unified nodes),
  and simplified drawing code.
- Leo is now an installable package.
- Prepared code to be ready for Python 3.0.
- Many small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080830082008.2: *5* Major new features
- Added support for @shadow files.
  This is a major breakthrough.
  See `Chapter 23`_ for full details.

- Added much improved support for vim bindings.

- Allow v.uA's in @thin and @shadow nodes.
  See http://groups.google.com/group/leo-editor/browse_thread/thread/750bb3099090f5b
#@+node:ekr.20080830082008.3: *5* Major code reorganizations
- Leo now uses a sax-based parser to read .leo files.
  This makes it possible to extend Leo's file format without invalidating previous versions of Leo.

- Leo now supports the so-called 'Graph World'.
  When g.unified_nodes is True, Leo moves all information from tnodes into vnodes.

- Leo now uses a new key binding scheme.
  This allows substantially simpler key bindings. Indeed, most per-pane bindings
  have been eliminated.
  Added support for kill bindings.

- Leo is now an installable package.
  To make this work, Leo adds os.curdir to sys.path if needed on startup.

- Reorganized Leo's drawing and focus code.
  As a result, calls to c.beginUpdate and c.endUpdate are no longer needed.

- Leo is now ready for Python 3.x:
  Change most print statements to calls to g.pr.
#@+node:ekr.20080830082008.4: *5* Minor new features
- Added g.Tracer class.  This is a Python 'debugger' that computes a call graph.
  To trace a function and its callers, put the following at the function's start::

    g.startTracer()

- The find-character command now finds characters across line boundaries.

- Set cwd in read/write commands. This affect the following commands:
  open, save, save-as, save-to, read-outline-only, read-file-into-node,
  write-file-from-node and all the import/export commands.

- Added support for @args list for @button nodes.
  See the docstring for the mod_scripting plugin for details.

- Leo creates the .leo folder in the user's HOME directory, and puts several configuration files there.
  Leo looks for myLeoSettings.leo in HOME/.leo.
#@+node:ekr.20080830082008.5: *5* New settings
- The default settings for @shadow files are now located in leoSettings.leo in the node::

    @settings-->File options-->Shadow files

  The defaults for these settings are::

    @string shadow_prefix = x
    @string shadow_subdir = .leo_shadow

- Added support for @bool fixedWindow option. Leo suppresses marks, expansion
  state, orphan bits and current position bits when writing fixed .leo files. As
  a result, all nodes will be collapsed and the root node will always be
  selected when Leo opens a fixed .leo file.

  You can optionally specify the size and position on the screen of fixed .leo
  files by putting an '@data fixedWindowPosition' node in the
  @settings tree of myLeoSettings.leo or leoSettings.leo.  You should
  **not** put such a node in the fixed .leo file itself--everyone who
  opens the file would get that fixed position.

  The body of the '@data fixedWindowPosition' node should contain
  something like this::

    # Must be four entries: width,height,left,top.
    # Put this in myLeoSettings.leo, **not** in individual .leo files.

    1200
    800
    50
    50

- Added @bool cleo_color_ignore = True
  This determines whether cleo colors @ignore headlines. The default is True.

- Added @bool suppress_import_parsing setting
  When True, @auto and @shadow import the entire file into a single node.
#@+node:ekr.20080902080930.2: *4* 4.5 final
Leo 4.5 final                                  September 2, 2008

Leo 4.5 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.5:
--------------------------

- Full support for @shadow files in Leo's core.
- Major improvements to Leo's key binding code.
- The beginning of usable vim-like bindings.
- uA's may now be associated with vnodes in @thin and @shadow files.
- Several major reorganizations of Leo's code:
  including sax-based parsing, support for the Graph world (unified nodes),
  and simplified drawing code.
- Leo is now an installable package.
- Prepared code to be ready for Python 3.0.
- Many small improvements and bug fixes.

Quote of the month:
-------------------
Squeak and Leo have been two of the most significant technologies to
redefine my personal computer experience and the ideas behind computing.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080902080930.3: *5* Major new features
- Added support for @shadow files.
  This is a major breakthrough.
  See `Chapter 23`_ for full details.

- Added much improved support for vim bindings.

- Allow v.uA's in @thin and @shadow nodes.
  See http://groups.google.com/group/leo-editor/browse_thread/thread/750bb3099090f5b
#@+node:ekr.20080902080930.4: *5* Major code reorganizations
- Leo now uses a sax-based parser to read .leo files.
  This makes it possible to extend Leo's file format without invalidating previous versions of Leo.

- Leo now supports the so-called 'Graph World'.
  When g.unified_nodes is True, Leo moves all information from tnodes into vnodes.

- Leo now uses a new key binding scheme.
  This allows substantially simpler key bindings. Indeed, most per-pane bindings
  have been eliminated.
  Added support for kill bindings.

- Leo is now an installable package.
  To make this work, Leo adds os.curdir to sys.path if needed on startup.

- Reorganized Leo's drawing and focus code.
  As a result, calls to c.beginUpdate and c.endUpdate are no longer needed.

- Leo is now ready for Python 3.x:
  Change most print statements to calls to g.pr.
#@+node:ekr.20080902080930.5: *5* Minor new features
- Added g.Tracer class.  This is a Python 'debugger' that computes a call graph.
  To trace a function and its callers, put the following at the function's start::

    g.startTracer()

- The find-character command now finds characters across line boundaries.

- Set cwd in read/write commands. This affect the following commands:
  open, save, save-as, save-to, read-outline-only, read-file-into-node,
  write-file-from-node and all the import/export commands.

- Added support for @args list for @button nodes.
  See the docstring for the mod_scripting plugin for details.

- Leo creates the .leo folder in the user's HOME directory, and puts several configuration files there.
  Leo looks for myLeoSettings.leo in HOME/.leo.
#@+node:ekr.20080902080930.6: *5* New settings
- The default settings for @shadow files are now located in leoSettings.leo in the node::

    @settings-->File options-->Shadow files

  The defaults for these settings are::

    @string shadow_prefix = x
    @string shadow_subdir = .leo_shadow

- Added support for @bool fixedWindow option. Leo suppresses marks, expansion
  state, orphan bits and current position bits when writing fixed .leo files. As
  a result, all nodes will be collapsed and the root node will always be
  selected when Leo opens a fixed .leo file.

  You can optionally specify the size and position on the screen of fixed .leo
  files by putting an '@data fixedWindowPosition' node in the
  @settings tree of myLeoSettings.leo or leoSettings.leo.  You should
  **not** put such a node in the fixed .leo file itself--everyone who
  opens the file would get that fixed position.

  The body of the '@data fixedWindowPosition' node should contain
  something like this::

    # Must be four entries: width,height,left,top.
    # Put this in myLeoSettings.leo, **not** in individual .leo files.

    1200
    800
    50
    50

- Added @bool cleo_color_ignore = True
  This determines whether cleo colors @ignore headlines. The default is True.

- Added @bool suppress_import_parsing setting
  When True, @auto and @shadow import the entire file into a single node.
#@+node:ekr.20080912143702.137: *4* 4.5.1 final
Leo 4.5.1 final                                  September 14, 2008

Leo 4.5.1 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.5.1 final fixes several important bugs in Leo 4.5 final:

- Eliminated spurious error messages in the goto-global-line command.
- @shadow files with unknown file extensions now work properly.
- Improved Leo's installer.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.5:
--------------------------

- Full support for @shadow files in Leo's core.
- Major improvements to Leo's key binding code.
- The beginning of usable vim-like bindings.
- uA's may now be associated with vnodes in @thin and @shadow files.
- Several major reorganizations of Leo's code:
  including sax-based parsing, support for the Graph world (unified nodes),
  and simplified drawing code.
- Leo is now an installable package.
- Prepared code to be ready for Python 3.0.
- Many small improvements and bug fixes.

Quote of the month:
-------------------
Squeak and Leo have been two of the most significant technologies to
redefine my personal computer experience and the ideas behind computing.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20080912143702.138: *5* Fixed line number problems
# goToLineNumber was always complaining about a missing private shadow file.
#@+node:ekr.20080912143702.139: *5* Fixed problems with @shadow files with unknown file extensions
@

adjustTargetLanguage, a helper of writeOneAtShadowNode, no longer sets
c.target_language to 'unknown_language' when the file extension is unknown.
#@+node:ekr.20080912143702.140: *5* Fixed bug in Leo's pre-install script
The script failed for paths such as c:\xp\python25\python.exe
for which python was not the top-most directory.
#@+node:ekr.20090717084250.10704: *3* 4.6 file caching, qt gui, @edit, @auto-rst
#@+node:ekr.20090324085713.2: *4* 4.6 b1
Leo 4.6 beta 1                                       March 23, 2009

Leo 4.6 b1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.6:
--------------------------

- Leo now requires Python 2.4 or later.
- Leo now features a modern Qt interface;
  Leo's legacy Tk interface can also be used.
- New --config --file and --gui command-line options.
- Dozens of small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20090324085713.285: *5* Bugs fixed
#@+node:ekr.20090324085713.292: *6* Fixed goto-global-line crasher
#@+node:ekr.20090324085713.326: *6* Fixed bug that prevented Leo from opening files on the XP desktop
#@+node:ekr.20090324085713.350: *6* Save/restore tnodeList in atFile.write
The code should save/restore, just as in the clean_file function (from scripts.leo)
#@+node:ekr.20090324085713.358: *6* Paste outline problem
The problem was missing calls to initAfterLoad in c.new.
#@+node:ekr.20090324085713.395: *6* Made sure $Home works for @nosent
http://groups.google.com/group/leo-editor/browse_thread/thread/f27e3514310a5c90
#@+node:ekr.20090324085713.404: *6* Fixed atFile unicode bug
#@+node:ekr.20090324085713.513: *6* Fixed Mark Edgington's @shadow bug
#@+node:ekr.20090324085713.605: *6* Fixed whitespace problems with @auto/@shadow
Pulled trunk, got r1599

python launchLeo.py leo/plugins/leoPlugins.leo

go to

Plugins-->Graph world-->@shadow backlink.py-->backlink declarations

All I did was add the full stop at the end of the docstring, but see
the diff:

=== modified file 'leo/plugins/backlink.py'
--- leo/plugins/backlink.py     2009-02-19 18:16:01 +0000
+++ leo/plugins/backlink.py     2009-02-25 22:14:46 +0000
@@ -1,4 +1,4 @@
-'''Backlink - allow arbitrary links between nodes
+'''Backlink - allow arbitrary links between nodes.
 '''

 # Notes
@@ -296,7 +296,7 @@
                break
        else:
            self.showMessage("Error: no such link")
-
+
        gcc = getattr(self.c, 'graphcanvasController')
        if gcc:
            gcc.update()
#@+node:ekr.20090324085713.327: *6* Fixed nested @path problem
http://groups.google.com/group/leo-editor/browse_thread/thread/7d8325d055cbef30
#@+node:ekr.20090324085713.289: *6* Fixed encoding problems with rst3 plugin
http://groups.google.com/group/leo-editor/browse_thread/thread/5f5219fedd977ec2
#@+node:ekr.20090324085713.318: *6* Fixed new rst3 crash
http://groups.google.com/group/leo-editor/browse_thread/thread/414137b93c7e4b90

Calls g.makeAllNonExistentDirectories instead of os.mkdir.
#@+node:ekr.20090324085713.320: *6* Fixed two c syntax-coloring bugs
http://groups.google.com/group/leo-editor/browse_thread/thread/707a910f975f3715

http://groups.google.com/group/leo-editor/browse_thread/thread/74c6ab4809bde980

There were two separate bugs:

1. The eol_span and eol_span_regex now honor the mode's escape character.

2. colorRangeWithTag now colors delegates with the default tag color.

No changes were made in modes/c.py or modes/c.xml.
#@+node:ekr.20090324085713.690: *5* Improved file handling
#@+node:ekr.20090324085713.726: *6* Open a default .leo file if no other is specified
http://groups.google.com/group/leo-editor/browse_thread/thread/d6449236bc140713#

Added support for @string default_leo_file = ~/.leo/workbook.leo
#@+node:ekr.20090324085713.748: *6* Added escapes for underindented lines
@string underindent-escape-string = \-
#@+node:ekr.20090324085713.792: *6* Warn when writing an externally changed file
http://groups.google.com/group/leo-editor/browse_thread/thread/c80fd8375534afdf
#@+node:ekr.20090324085713.661: *5* New code features
#@+node:ekr.20090324085713.662: *6* Added autoCompleter.getExternalCompletions
@nocolor

http://groups.google.com/group/leo-editor/browse_thread/thread/4ad91984a6d0acac

> As I said, all I need would be is for leo to call callback/hook with
> signature like
> def complete(line-up-to-cursor, current_node) => list of strings

The actual signature is:

theObject,completionList = getExternalCompletions (self,s,p=None,language='python')

p is used only to get the language, or you can set the language by hand.

@color
#@+node:ekr.20090324085713.663: *6* Added g.posList
#@+node:ekr.20090324085713.666: *6* Better plugin info
c.config.doEnabledPlugins sets g.app.config.enabledPluginsFileName
#@+node:ekr.20090324085713.672: *6* Added properties to leoNodes.py
p.b, p.h and p.gnx
t.b, t.h, t.gnx and t.u
v.b, v.h, v.gnx, and v.u
#@+node:ekr.20090324085713.688: *6* Added script to leoSettings.leo to ensure all menu items are valid
#@+node:ekr.20090324085713.689: *6* Added c.config.getSettingSource
c.config.getSettingSource('show_full_tracebacks_in_scripts')
returns the name of the file which Leo used to determine the setting

- D indicates default settings.
- F indicates the file being loaded
- L indicates leoSettings.leo
- M indicates myLeoSettings.leo
#@+node:ekr.20090324085713.272: *6* Predefined 'self' in @test/@suite nodes
#@+node:ekr.20090324085713.745: *6* Added c.getNodePath and c.getNodeFileName
http://groups.google.com/group/leo-editor/browse_thread/thread/3b5f1232ecc6bba7
#@+node:ekr.20090324105223.15: *5* New command-line options
#@+node:ekr.20090324085713.849: *6* Added -c option to specify config files
@nocolor

The setting is called -c or --config.  The one-config-file arg no longer exists.

http://groups.google.com/group/leo-editor/browse_thread/thread/f3f95d93bcd93b94

Personally, I'd like to see another config file available via -c on
the command line:
(a common idiom)

leo myproject.leo -c /usr/lib/myproject/myLeoSettings.leo

or better yet:

leo myproject.leo -c /etc/leo/style01.leo
leo myotherproject.leo -c /etc/leo/style02.leo
leo anotherproject.leo -c /etc/leo/style23.leo

Each file opens in an editor with the shortcuts, buttons, commands,
plugins, appearance etc.  that has been tuned for that data management task.

or best yet:

leo myproject.leo -c /usr/lib/python2.5/site-packages/leo/config/style94.leo

==================

http://groups.google.com/group/leo-editor/browse_thread/thread/b5a736089079acaf#

Please, I think each file has a distinct and required role.

- config/leoSettings.leo = Edward's base, required for a sane starting point

- home/.leo/myLeoSettings.leo = adjust Edwards suggestions to taste

- cwd/myLeoSettings.leo = provide a customized working environment in
this folder

- leo -c /usr/lib/leo-editor/src/config/zope3_ide.leo =
  - open this file in a specialized environments, mine or community contributed
  - ...

- currentfile/@settings =
  - I'm working on some customization ideas
  - Here, try out this Leo file I sent you, check out all the spiffy
modifications 

@color
#@+node:ekr.20090324085713.835: *6* Added support for --file=fileName command-line option
Only .zip and .leo extensions are allowed at present.
#@+node:ekr.20090324085713.867: *6* Added support for --gui option
#@+node:ekr.20090324105223.9: *5* New commands
#@+node:ekr.20090324085713.747: *6* Added smart home (back-to-home) command
#@+node:ekr.20090324085713.817: *6* The open command creates @edit nodes when opening non-.leo files
http://groups.google.com/group/leo-editor/browse_thread/thread/3417ff5e9c02c626

The open file dialog now shows all files by default.
Selecting a non-.leo file will load that file into a new node in the present outline.

This plugs what may have been the biggest hole in Leo's history.
#@+node:ekr.20090324085713.836: *6* added pdb minibuffer command
This works, but stops Leo in the middle of the command-handling logic.

However, it is possible to pick up the commander by stepping out into
k.masterKeyHandler or k.masterCommandHandler. Using c, one can then get all
other info.
#@+node:ekr.20090324085713.837: *6* Added support for smart_tab setting
- Tab = indent when there is a text selection
- Shift-Tab unindents always
#@+node:ekr.20090324085713.847: *6* Improved isearch commands
Escape now ends isearch
#@+node:ekr.20090324105223.10: *5* New and improved directives
#@+node:ekr.20090324085713.740: *6* Added @nocolor-node directive
# Useful: we don't need a closing @color to enable coloring in descendants.
#@+node:ekr.20090324085713.691: *6* Improved @path handling
#@+node:ekr.20090324085713.848: *5* New settings
#@+node:ekr.20090324085713.732: *6* Added better default fonts for Leo on Linux
http://groups.google.com/group/leo-editor/browse_thread/thread/f1c7c5134b95c77e
#@+node:ekr.20090324085713.850: *6* Added support for @int icon_bar_widgets_per_row setting
#@+node:ekr.20090324085713.746: *6* Added support for meta keys
http://groups.google.com/group/leo-editor/browse_thread/thread/b6a39ed672a28c65?pli=1
#@+node:ekr.20090324085713.814: *6* Use myLeoSettings when opening leoSettings.leo
Changed config.get so that settings in leoSettings.leo are read *last*.
This means that myLeoSettings.leo will override leoSettings.leo,
even when leoSettings.leo is the local file.
#@+node:ekr.20090324085713.868: *5* Plugins
#@+node:ekr.20090324085713.869: *6* Improved nav_buttons plugin and corresponding nodeHistory class
#@+node:ekr.20090324085713.881: *6* Created qtGui and tkGui plugins
#@+node:ekr.20090324085713.890: *6* Created leoGuiPluginsRef.leo
This contains all gui plugins.
#@+node:ekr.20090620073906.11072: *4* 4.6 b2
Leo 4.6 beta 2                                  June 22, 2009

Leo 4.6 b2 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.6:
--------------------------

- Cached external files *greatly* reduces the time to load .leo files.
- Leo now features a modern Qt interface by default.
  Leo's legacy Tk interface can also be used.
- New --config, --file and --gui command-line options.
- Leo tests syntax of .py files when saving them.
- Leo can now open any kind of file into @edit nodes.
- @auto-rst nodes support "round-tripping" of reStructuredText files.
- Properties of commanders, positions and nodes simplify programming.
- Improved Leo's unit testing framework.
- Leo now requires Python 2.5 or later.
- Dozens of small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20090620073906.11073: *5* Bugs
#@+node:ekr.20090620073906.11083: *6* Added patch for startup logic
A patch at the start of loadOnePlugin prevents leo from crashing and allows the
gui prompt for a leoID to come up.
#@+node:ekr.20090620073906.11087: *6* Allocate gnx's when nodes are created
This is reasonable now that old-style file indices are rare.
#@+node:ekr.20090620073906.11960: *6* Allow block comments in private shadow files
Html files are a good test case.
#@+node:ekr.20090620073906.11590: *6* Compute delims from private shadow file as needed
#@+node:ekr.20090620073906.11376: *6* Don't copy @edit trees to outline
http://bugs.launchpad.net/leo-editor/+bug/376634

The fix was to putVnodes.
#@+node:ekr.20090620073906.11981: *6* Don't expand ancestors of @chapter node when selecting chapter
#@+node:ekr.20090620073906.12044: *6* Entries in recent files menu now have absolute paths
http://bugs.launchpad.net/leo-editor/+bug/383204
#@+node:ekr.20090620073906.11865: *6* Fixed (worked around) tk chapters bug
http://groups.google.com/group/leo-editor/browse_thread/thread/981c27d5c24c90f8
#@+node:ekr.20090620073906.11850: *6* Fixed @edit bug
The generated @nocolor line now ends with a newline.
#@+node:ekr.20090620073906.11564: *6* Fixed @shadow crasher
http://groups.google.com/group/leo-editor/browse_thread/thread/6cab5e676d4d75a0
#@+node:ekr.20090620073906.11296: *6* Fixed @thin bug
- Removed forceGnxOnPosition from leoImport.py and leoAtFile.py.

- readStartNode now always uses root.v for the first node
  instead of calling createThinChild4
#@+node:ekr.20090620073906.11081: *6* Fixed back-to-home so it works as expected
https://bugs.launchpad.net/leo-editor/+bug/367462

The expected/customary behavior (one you get used to in almost every editor) is:

End: always move to end of line
Home: Move to first visible character on the line. When pressing home again, move to column zero. If Home is pressed one more time, move to first visible character again.

This is also the way emacs behaves, though ctrl+a always moves to column zero.
#@+node:ekr.20090620103431.5601: *6* Fixed bad @verbatim bug
The @verbatim was being inserted into the outline.
#@+node:ekr.20090620073906.11833: *6* Fixed binding problem with notebook
#@+node:ekr.20090620073906.11374: *6* Fixed bug: sorting could revert headline changes
#@+node:ekr.20090620073906.11521: *6* Fixed crash when reading .zip files
The problem arose when reading a zipped file:

 File "C:\Programme\Leo-4-6-b1\leo\core\leoFileCommands.py", line
1265, in parse_leo_file
   s = theFile.read()
TypeError: read() takes at least 2 arguments (1 given)
saved: [zipped] Dive-into-Python-3.leo
#@+node:ekr.20090620073906.11091: *6* Fixed crasher when creating .leoID.txt
exception loading plugin
Traceback (most recent call last):

  File "C:\leo.repo\trunk\leo\core\leoPlugins.py", line 429, in loadOnePlugin
    loadedModulesFilesDict[moduleName] = g.app.config.enabledPluginsFileName

AttributeError: StubConfig instance has no attribute 'enabledPluginsFileName'

leoID='ekr'
.leoID.txt created in C:\Documents and Settings\HP_Administrator\My Documents\Edward\.leo
load 
#@+node:ekr.20090620073906.11380: *6* Fixed dabbrev-expands bug
http://bugs.launchpad.net/leo-editor/+bug/362048

I have 'dabbrev-expands' bound to the F4 key. When I press F4 after
the word "freq" in a body pane containing the word "frequency" then
Leo 4.5.1 shows a hour-glass for a while before giving an empty
dabbrev-expand: prompt in the minibuffer.

If I back up one character, putting point between the e and q and then
type F4, I get the expected behavior: the word "frequency" is inserted
immediately.

What I did:

- Removed "not ready messages".
- Made the code undoable.
- Added wimpy unit test.
#@+node:ekr.20090620073906.11074: *6* Fixed elisp importer problem
#@+node:ekr.20090620073906.11137: *6* Fixed F10/11/12 key bug
Added call to isFKey in k.handleUnboundKeys.
#@+node:ekr.20090620073906.11387: *6* Fixed file bug re unicode characters
http://bugs.launchpad.net/leo-editor/+bug/376189
#@+node:ekr.20090620073906.11776: *6* Fixed hoist problems
http://bugs.launchpad.net/leo-editor/+bug/382221
#@+node:ekr.20090620073906.11707: *6* Fixed lost anchor bug page up/down
http://bugs.launchpad.net/leo-editor/+bug/363403

With a long body text you might place the cursor on a line, hold down Shift, and
PgDn several pages to select a large block of text. The last PgDn may overshoot
the range you want selected, so you should be able to use UpArrow to bring the
bottom of the range back up to where you want it. However, on the first UpArrow
the selection is lost and restarted from the current cursor position. I.e. you
end up with just one line selected, instead of trimming one line of the
selection of several pages, as intended.
#@+node:ekr.20090620073906.11377: *6* Fixed minor @auto bug
http://bugs.launchpad.net/leo-editor/+bug/306671

If a Leo editor window is opened, and the "NewHeadline" node is renamed to
"@auto <path to some valid file>", and then the "File->Read/Write->Read @auto
nodes" menu option is selected, the renamed node reverts to its previous name
("NewHeadline"), and nothing is loaded into the node.
#@+node:ekr.20090620073906.11864: *6* Fixed multiple-editor focus problems
http://groups.google.com/group/leo-editor/browse_thread/thread/21bddd50f3400bdc?hl=en
#@+node:ekr.20090620073906.11352: *6* Fixed new command
The outline wasn't being redrawn properly.
#@+node:ekr.20090620073906.11740: *6* Fixed problems with change-all command
http://groups.google.com/group/leo-editor/browse_thread/thread/430287018f9d773d

The fix to minibufferFind.changeAll fixes a bug that is several years old.
The fix to findNextMatch fixes a bug that is likely much older than that.
#@+node:ekr.20090620073906.11818: *6* Fixed read clone bug
#@+node:ekr.20090620073906.11390: *6* Fixed rst import bug
#@+node:ekr.20090620073906.11086: *6* Fixed rst3 problem
http://mail.google.com/mail/#inbox/11ef0076a3f4d866
#@+node:ekr.20090620073906.11760: *6* Fixed seg-fault bug
The crash happened inside the call to::

    c.widgetWantsFocusNow(event.widget)

in callAltXFunction. Actually, the crash happened later, in c.outerUpdate.

A better fix would be to use wrappers for all edit widgets, and recalculate the
edit widget any it needs to be used.
#@+node:ekr.20090620073906.11666: *6* Fixed Shift-Arrow in headlines
#@+node:ekr.20090620073906.11866: *6* Fixed startup problem
http://groups.google.com/group/leo-editor/browse_thread/thread/606277d73b193037
#@+node:ekr.20090620073906.11349: *6* Fixed stubConfig problems
#@+node:ekr.20090620073906.11107: *6* Fixed undo bug
onTextChanged in the qt gui was calling setUndoTypingParams, in many case
redundantly and with bad params.

It remains to be seen whether onTextChanged is ever needed. If it is, it may be
difficult to set the old selection properly.
#@+node:ekr.20090620073906.11378: *6* Fixed vim bindings (dd) bug
http://bugs.launchpad.net/leo-editor/+bug/353925

The "kill-region" function did nothing when using the qt gui.

The fix was to replace tag_ranges with w.getSelectionRange, etc.
This was the only call to tag_ranges in the core.
#@+node:ekr.20090620073906.11759: *6* Investigated bug: File->Export->write failed due to incorrect path
http://bugs.launchpad.net/leo-editor/+bug/377907

I'm going to mark this invalid, although the behavior is way too confusing.

I added the following to the plugin's docstring:

Configuration
~~~~~~~~~~~~~

At present, the file leo/plugins/leo_to_html.ini contains configuration settings.
In particular, the default export path, "c:\" must be changed for *nix systems.
#@+node:ekr.20090620073906.11094: *6* Investigated speed of external unit tests
The problem is imports in the Commands ctor. When executed the first time from
the bridge the imports take about 3/4 sec. on my machine. There is nothing that
can or should be done. Ctrl-5 is still hugely faster than opening unitTest.leo!
#@+node:ekr.20090620073906.11612: *6* Made @url nodes work with qt gui
#@+node:ekr.20090620073906.11620: *6* Mark @<file> nodes dirty when @path nodes change
#@+node:ekr.20090620073906.11824: *6* Removed duplicate messages when opening non-existent .leo file
#@+node:ekr.20090620073906.11771: *6* Reversed messages about redefined keys
http://groups.google.com/group/leo-editor/browse_thread/thread/a04dcefbb672078f
#@+node:ekr.20090620073906.11973: *6* Scroll commands now affect only scrollbars
#@+node:ekr.20090620073906.11870: *5* New features
#@+node:ekr.20090620073906.11923: *6* Allow Leo to open any file
Leo can now open, for example, any .py file.
It will be put in an @edit node in an otherwise-empty outline.

This allows Leo to be associated with the edit action of .py files.
Something like this::

C:\Python26\python.exe "c:\leo.repo\trunk\launchLeo.py" --gui=qt %1 %2
#@+node:ekr.20090620073906.11873: *6* Improved unit testing
- leoDynamicTest.py now supports a --path argument giving the .leo file.
  This is so useful!

- leoDynamicTest.py now honors the --silent argument.

- leoTest.runUnitTestLeoFile runs all unit tests in a given .leo file
  in a separate process.

- leoTest.runTestsExternally calls runUnitTestLeoFile after creating
  dynamicUnitTest.leo.

- When reporting that no unit tests were found, all unit tests commands tell
  whether the entire outline or just the selected outline was searched.
  This fixes sometimes-misleading error messages.

- test.leo contains a 'run-test.leo-tests' button.

- leoPy.leo contains a 'run-all-core-tests' button.
#@+node:ekr.20090620073906.11898: *6* Leo tests syntax of .py files when saving them
#@+node:ekr.20090620073906.12061: *6* Made qt gui the default
#@+node:ekr.20090620073906.11935: *6* Support @auto-rst
#@+node:ekr.20090709084001.5944: *4* 4.6 rc1
Leo 4.6 release candidate 1                             July 9, 2009

Leo 4.6 rc1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.6:
--------------------------

- Cached external files *greatly* reduces the time to load .leo files.
- Leo now features a modern Qt interface by default.
  Leo's legacy Tk interface can also be used.
- New --config, --file and --gui command-line options.
- Leo tests syntax of .py files when saving them.
- Leo can now open any kind of file into @edit nodes.
- @auto-rst nodes allow easy editing of reStructuredText files.
- Properties of commanders, positions and nodes simplify programming.
- Improved Leo's unit testing framework.
- Leo now requires Python 2.5 or later.
- Dozens of small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20090709084001.5945: *5* Bugs
#@+node:ekr.20090709084001.5968: *6* Fixed unicode problem with spell checker
#@+node:ekr.20090709084001.6086: *6* Ensure newline at end of each @auto node
#@+node:ekr.20090709084001.6096: *6* Fixed bugs with goto-global-line and @auto
#@+node:ekr.20090709084001.6119: *6* Added key bindings in log pane
#@+node:ekr.20090709084001.6138: *6* Honor split ratios
#@+node:ekr.20090709084001.6140: *6* Click in body after editing activates body
#@+node:ekr.20090709084001.6144: *6* Rewrote string-rectangle command for speed
#@+node:ekr.20090709084001.6149: *6* Fixed read-at-auto-nodes bug
#@+node:ekr.20090709084001.6153: *6* Fixed major focus problems
Various get-focus methods must translate from wrapped widget to wrapper widget.
This happens in g.app.gui.get_focus, which needs a c arg to work properly in some cases!
#@+node:ekr.20090709084001.6156: *6* Fixed problem with read-at-file/shadow-nodes
#@+node:ekr.20090709084001.6164: *6* Fixed major icon/t.uA bug
https://bugs.launchpad.net/leo-editor/+bug/345917
#@+node:ekr.20090709084001.6192: *6* Fixed rst bug
Exact repro steps (using trunk):

Help -> open quickstart.leo

Go to Programming-->External files-->reStructuredText (@auto-
rst)-->@path ~-->@@auto-rst myfile_rst.txt

Remove first @ from @auto-rst

Save => exception occurs.
#@+node:ekr.20090709084001.6204: *6* Made alt-6 run all unit tests
@test nodes in the generated file were being run when modules were imported.

The fix was to set g.unitTesting = False while importing in safeImportModule.
#@+node:ekr.20090709084001.6238: *6* Fixed crasher in dynamicExpanderHelper
#@+node:ekr.20090709084001.6241: *6* Don't collapse initial node automatically
#@+node:ekr.20090709084001.6254: *6* Fixed bug: don't duplicate standard buttons
@nocolor-node

https://bugs.launchpad.net/leo-editor/+bug/394965

Several changes:

- Fixed bug in runLeo.py.completeFileName.
  Do not add ".leo" suffix if the file exists without it!

- Fixed (???) the bug by not calling g.doHook("new"...) in g.openWrapperFile.
  This **might** be a perfect fix, but maybe not.
  But if a bug remains, it might be less bad than the duplicated buttons bug :-)
#@+node:ekr.20090709084001.6283: *6* Fixed critical @file data-loss problem
The culprit was the code in atFile.read that deleted all children.

Added several important new unit tests.
#@+node:ekr.20090709084001.6291: *6* Added hasSelection to leoQtBody
Also added test for leoQtBody to existing test.
#@+node:ekr.20090709084001.6296: *5* Features
#@+node:ekr.20090709084001.6297: *6* Added open-quickstart-leo command
#@+node:ekr.20090709084001.6300: *6* Added tree bindings for page-up/down commands
This was a binding issue. Leo has a full range of scrolling commands. They work.

The old bindings bound the PageUp/Down keys to back/forward page commands, and
these commands work only for text.

The new default bindings in leoSettings.leo: @keys EKR bindings are:

back-page                       ! text = PageUp
back-page-extend-selection      ! text = Shift-PageUp
forward-page                    ! text = PageDn
forward-page-extend-selection   ! text = Shift-PageDn

scroll-down-half-page   ! tree = Shift-PageDn
scroll-down-page        ! tree = PageDn
scroll-up-half-page     ! tree = Shift-PageUp
scroll-up-page          ! tree = PageUp         
#@+node:ekr.20090709084001.6301: *6* Issue error message re non-existent plugins
Leo now prints an error message when @enabled-plugins node contains a plugin
that does not exist.
#@+node:ekr.20090709084001.6304: *6* Expanded Alt-lt/rt arrows
#@+node:ekr.20090709084001.6307: *6* Added important @auto warning
Warn if the file exists and has never been read. This prevents a newly-created
@auto node from overwriting an existing file.
#@+node:ekr.20090717084250.10808: *4* 4.6 final
Leo 4.6 final                             July 15, 2009

Leo 4.6 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.6:
--------------------------

- Cached external files *greatly* reduces the time to load .leo files.
- Leo now features a modern Qt interface by default.
  Leo's legacy Tk interface can also be used.
- New --config, --file and --gui command-line options.
- Leo tests syntax of .py files when saving them.
- Leo can now open any kind of file into @edit nodes.
- @auto-rst nodes allow easy editing of reStructuredText files.
- Properties of commanders, positions and nodes simplify programming.
- Improved Leo's unit testing framework.
- Leo now requires Python 2.5 or later.
- Dozens of small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20090717084250.10809: *5* Bug fixes
#@+node:ekr.20090717084250.10810: *6* Bugs fixed in 4.6 b2
#@+node:ekr.20090717084250.10811: *7* Added patch for startup logic
A patch at the start of loadOnePlugin prevents leo from crashing and allows the
gui prompt for a leoID to come up.
#@+node:ekr.20090717084250.10812: *7* Allocate gnx's when nodes are created
This is reasonable now that old-style file indices are rare.
#@+node:ekr.20090717084250.10813: *7* Allow block comments in private shadow files
Html files are a good test case.
#@+node:ekr.20090717084250.10814: *7* Compute delims from private shadow file as needed
#@+node:ekr.20090717084250.10815: *7* Don't copy @edit trees to outline
http://bugs.launchpad.net/leo-editor/+bug/376634

The fix was to putVnodes.
#@+node:ekr.20090717084250.10816: *7* Don't expand ancestors of @chapter node when selecting chapter
#@+node:ekr.20090717084250.10817: *7* Entries in recent files menu now have absolute paths
http://bugs.launchpad.net/leo-editor/+bug/383204
#@+node:ekr.20090717084250.10818: *7* Fixed (worked around) tk chapters bug
http://groups.google.com/group/leo-editor/browse_thread/thread/981c27d5c24c90f8
#@+node:ekr.20090717084250.10819: *7* Fixed @edit bug
The generated @nocolor line now ends with a newline.
#@+node:ekr.20090717084250.10820: *7* Fixed @shadow crasher
http://groups.google.com/group/leo-editor/browse_thread/thread/6cab5e676d4d75a0
#@+node:ekr.20090717084250.10821: *7* Fixed @thin bug
- Removed forceGnxOnPosition from leoImport.py and leoAtFile.py.

- readStartNode now always uses root.v for the first node
  instead of calling createThinChild4
#@+node:ekr.20090717084250.10822: *7* Fixed back-to-home so it works as expected
https://bugs.launchpad.net/leo-editor/+bug/367462

The expected/customary behavior (one you get used to in almost every editor) is:

End: always move to end of line
Home: Move to first visible character on the line. When pressing home again, move to column zero. If Home is pressed one more time, move to first visible character again.

This is also the way emacs behaves, though ctrl+a always moves to column zero.
#@+node:ekr.20090717084250.10823: *7* Fixed bad @verbatim bug
The @verbatim was being inserted into the outline.
#@+node:ekr.20090717084250.10824: *7* Fixed binding problem with notebook
#@+node:ekr.20090717084250.10825: *7* Fixed bug: sorting could revert headline changes
#@+node:ekr.20090717084250.10826: *7* Fixed crash when reading .zip files
The problem arose when reading a zipped file:

 File "C:\Programme\Leo-4-6-b1\leo\core\leoFileCommands.py", line
1265, in parse_leo_file
   s = theFile.read()
TypeError: read() takes at least 2 arguments (1 given)
saved: [zipped] Dive-into-Python-3.leo
#@+node:ekr.20090717084250.10827: *7* Fixed crasher when creating .leoID.txt
exception loading plugin
Traceback (most recent call last):

  File "C:\leo.repo\trunk\leo\core\leoPlugins.py", line 429, in loadOnePlugin
    loadedModulesFilesDict[moduleName] = g.app.config.enabledPluginsFileName

AttributeError: StubConfig instance has no attribute 'enabledPluginsFileName'

leoID='ekr'
.leoID.txt created in C:\Documents and Settings\HP_Administrator\My Documents\Edward\.leo
load 
#@+node:ekr.20090717084250.10828: *7* Fixed dabbrev-expands bug
http://bugs.launchpad.net/leo-editor/+bug/362048

I have 'dabbrev-expands' bound to the F4 key. When I press F4 after
the word "freq" in a body pane containing the word "frequency" then
Leo 4.5.1 shows a hour-glass for a while before giving an empty
dabbrev-expand: prompt in the minibuffer.

If I back up one character, putting point between the e and q and then
type F4, I get the expected behavior: the word "frequency" is inserted
immediately.

What I did:

- Removed "not ready messages".
- Made the code undoable.
- Added wimpy unit test.
#@+node:ekr.20090717084250.10829: *7* Fixed elisp importer problem
#@+node:ekr.20090717084250.10830: *7* Fixed F10/11/12 key bug
Added call to isFKey in k.handleUnboundKeys.
#@+node:ekr.20090717084250.10831: *7* Fixed file bug re unicode characters
http://bugs.launchpad.net/leo-editor/+bug/376189
#@+node:ekr.20090717084250.10832: *7* Fixed hoist problems
http://bugs.launchpad.net/leo-editor/+bug/382221
#@+node:ekr.20090717084250.10833: *7* Fixed lost anchor bug page up/down
http://bugs.launchpad.net/leo-editor/+bug/363403

With a long body text you might place the cursor on a line, hold down Shift, and
PgDn several pages to select a large block of text. The last PgDn may overshoot
the range you want selected, so you should be able to use UpArrow to bring the
bottom of the range back up to where you want it. However, on the first UpArrow
the selection is lost and restarted from the current cursor position. I.e. you
end up with just one line selected, instead of trimming one line of the
selection of several pages, as intended.
#@+node:ekr.20090717084250.10834: *7* Fixed minor @auto bug
http://bugs.launchpad.net/leo-editor/+bug/306671

If a Leo editor window is opened, and the "NewHeadline" node is renamed to
"@auto <path to some valid file>", and then the "File->Read/Write->Read @auto
nodes" menu option is selected, the renamed node reverts to its previous name
("NewHeadline"), and nothing is loaded into the node.
#@+node:ekr.20090717084250.10835: *7* Fixed multiple-editor focus problems
http://groups.google.com/group/leo-editor/browse_thread/thread/21bddd50f3400bdc?hl=en
#@+node:ekr.20090717084250.10836: *7* Fixed new command
The outline wasn't being redrawn properly.
#@+node:ekr.20090717084250.10837: *7* Fixed problems with change-all command
http://groups.google.com/group/leo-editor/browse_thread/thread/430287018f9d773d

The fix to minibufferFind.changeAll fixes a bug that is several years old.
The fix to findNextMatch fixes a bug that is likely much older than that.
#@+node:ekr.20090717084250.10838: *7* Fixed read clone bug
#@+node:ekr.20090717084250.10839: *7* Fixed rst import bug
#@+node:ekr.20090717084250.10840: *7* Fixed rst3 problem
http://mail.google.com/mail/#inbox/11ef0076a3f4d866
#@+node:ekr.20090717084250.10841: *7* Fixed seg-fault bug
The crash happened inside the call to::

    c.widgetWantsFocusNow(event.widget)

in callAltXFunction. Actually, the crash happened later, in c.outerUpdate.

A better fix would be to use wrappers for all edit widgets, and recalculate the
edit widget any it needs to be used.
#@+node:ekr.20090717084250.10842: *7* Fixed Shift-Arrow in headlines
#@+node:ekr.20090717084250.10843: *7* Fixed startup problem
http://groups.google.com/group/leo-editor/browse_thread/thread/606277d73b193037
#@+node:ekr.20090717084250.10844: *7* Fixed stubConfig problems
#@+node:ekr.20090717084250.10845: *7* Fixed undo bug
onTextChanged in the qt gui was calling setUndoTypingParams, in many case
redundantly and with bad params.

It remains to be seen whether onTextChanged is ever needed. If it is, it may be
difficult to set the old selection properly.
#@+node:ekr.20090717084250.10846: *7* Fixed vim bindings (dd) bug
http://bugs.launchpad.net/leo-editor/+bug/353925

The "kill-region" function did nothing when using the qt gui.

The fix was to replace tag_ranges with w.getSelectionRange, etc.
This was the only call to tag_ranges in the core.
#@+node:ekr.20090717084250.10847: *7* Investigated bug: File->Export->write failed due to incorrect path
http://bugs.launchpad.net/leo-editor/+bug/377907

I'm going to mark this invalid, although the behavior is way too confusing.

I added the following to the plugin's docstring:

Configuration
~~~~~~~~~~~~~

At present, the file leo/plugins/leo_to_html.ini contains configuration settings.
In particular, the default export path, "c:\" must be changed for *nix systems.
#@+node:ekr.20090717084250.10848: *7* Investigated speed of external unit tests
The problem is imports in the Commands ctor. When executed the first time from
the bridge the imports take about 3/4 sec. on my machine. There is nothing that
can or should be done. Ctrl-5 is still hugely faster than opening unitTest.leo!
#@+node:ekr.20090717084250.10849: *7* Made @url nodes work with qt gui
#@+node:ekr.20090717084250.10850: *7* Mark @<file> nodes dirty when @path nodes change
#@+node:ekr.20090717084250.10851: *7* Removed duplicate messages when opening non-existent .leo file
#@+node:ekr.20090717084250.10852: *7* Reversed messages about redefined keys
http://groups.google.com/group/leo-editor/browse_thread/thread/a04dcefbb672078f
#@+node:ekr.20090717084250.10853: *7* Scroll commands now affect only scrollbars
#@+node:ekr.20090717084250.10854: *6* Bugs fixed in 4.6 b1
#@+node:ekr.20090717084250.10855: *7* Fixed goto-global-line crasher
#@+node:ekr.20090717084250.10856: *7* Fixed bug that prevented Leo from opening files on the XP desktop
#@+node:ekr.20090717084250.10857: *7* Save/restore tnodeList in atFile.write
The code should save/restore, just as in the clean_file function (from scripts.leo)
#@+node:ekr.20090717084250.10858: *7* Paste outline problem
The problem was missing calls to initAfterLoad in c.new.
#@+node:ekr.20090717084250.10859: *7* Made sure $Home works for @nosent
http://groups.google.com/group/leo-editor/browse_thread/thread/f27e3514310a5c90
#@+node:ekr.20090717084250.10860: *7* Fixed atFile unicode bug
#@+node:ekr.20090717084250.10861: *7* Fixed Mark Edgington's @shadow bug
#@+node:ekr.20090717084250.10862: *7* Fixed whitespace problems with @auto/@shadow
Pulled trunk, got r1599

python launchLeo.py leo/plugins/leoPlugins.leo

go to

Plugins-->Graph world-->@shadow backlink.py-->backlink declarations

All I did was add the full stop at the end of the docstring, but see
the diff:

=== modified file 'leo/plugins/backlink.py'
--- leo/plugins/backlink.py     2009-02-19 18:16:01 +0000
+++ leo/plugins/backlink.py     2009-02-25 22:14:46 +0000
@@ -1,4 +1,4 @@
-'''Backlink - allow arbitrary links between nodes
+'''Backlink - allow arbitrary links between nodes.
 '''

 # Notes
@@ -296,7 +296,7 @@
                break
        else:
            self.showMessage("Error: no such link")
-
+
        gcc = getattr(self.c, 'graphcanvasController')
        if gcc:
            gcc.update()
#@+node:ekr.20090717084250.10863: *7* Fixed nested @path problem
http://groups.google.com/group/leo-editor/browse_thread/thread/7d8325d055cbef30
#@+node:ekr.20090717084250.10864: *7* Fixed encoding problems with rst3 plugin
http://groups.google.com/group/leo-editor/browse_thread/thread/5f5219fedd977ec2
#@+node:ekr.20090717084250.10865: *7* Fixed new rst3 crash
http://groups.google.com/group/leo-editor/browse_thread/thread/414137b93c7e4b90

Calls g.makeAllNonExistentDirectories instead of os.mkdir.
#@+node:ekr.20090717084250.10866: *7* Fixed two c syntax-coloring bugs
http://groups.google.com/group/leo-editor/browse_thread/thread/707a910f975f3715

http://groups.google.com/group/leo-editor/browse_thread/thread/74c6ab4809bde980

There were two separate bugs:

1. The eol_span and eol_span_regex now honor the mode's escape character.

2. colorRangeWithTag now colors delegates with the default tag color.

No changes were made in modes/c.py or modes/c.xml.
#@+node:ekr.20090717084250.10867: *5* New features
#@+node:ekr.20090717084250.10868: *6* New features in 4.6 b1
#@+node:ekr.20090717084250.10869: *7* Improved file handling
#@+node:ekr.20090717084250.10870: *8* Open a default .leo file if no other is specified
http://groups.google.com/group/leo-editor/browse_thread/thread/d6449236bc140713#

Added support for @string default_leo_file = ~/.leo/workbook.leo
#@+node:ekr.20090717084250.10871: *8* Added escapes for underindented lines
@string underindent-escape-string = \-
#@+node:ekr.20090717084250.10872: *8* Warn when writing an externally changed file
http://groups.google.com/group/leo-editor/browse_thread/thread/c80fd8375534afdf
#@+node:ekr.20090717084250.10873: *7* New code features
#@+node:ekr.20090717084250.10874: *8* Added autoCompleter.getExternalCompletions
@nocolor

http://groups.google.com/group/leo-editor/browse_thread/thread/4ad91984a6d0acac

> As I said, all I need would be is for leo to call callback/hook with
> signature like
> def complete(line-up-to-cursor, current_node) => list of strings

The actual signature is:

theObject,completionList = getExternalCompletions (self,s,p=None,language='python')

p is used only to get the language, or you can set the language by hand.

@color
#@+node:ekr.20090717084250.10875: *8* Added g.posList
#@+node:ekr.20090717084250.10876: *8* Better plugin info
c.config.doEnabledPlugins sets g.app.config.enabledPluginsFileName
#@+node:ekr.20090717084250.10877: *8* Added properties to leoNodes.py
p.b, p.h and p.gnx
t.b, t.h, t.gnx and t.u
v.b, v.h, v.gnx, and v.u
#@+node:ekr.20090717084250.10878: *8* Added script to leoSettings.leo to ensure all menu items are valid
#@+node:ekr.20090717084250.10879: *8* Added c.config.getSettingSource
c.config.getSettingSource('show_full_tracebacks_in_scripts')
returns the name of the file which Leo used to determine the setting

- D indicates default settings.
- F indicates the file being loaded
- L indicates leoSettings.leo
- M indicates myLeoSettings.leo
#@+node:ekr.20090717084250.10880: *8* Predefined 'self' in @test/@suite nodes
#@+node:ekr.20090717084250.10881: *8* Added c.getNodePath and c.getNodeFileName
http://groups.google.com/group/leo-editor/browse_thread/thread/3b5f1232ecc6bba7
#@+node:ekr.20090717084250.10882: *7* New command-line options
#@+node:ekr.20090717084250.10883: *8* Added -c option to specify config files
@nocolor

The setting is called -c or --config.  The one-config-file arg no longer exists.

http://groups.google.com/group/leo-editor/browse_thread/thread/f3f95d93bcd93b94

Personally, I'd like to see another config file available via -c on
the command line:
(a common idiom)

leo myproject.leo -c /usr/lib/myproject/myLeoSettings.leo

or better yet:

leo myproject.leo -c /etc/leo/style01.leo
leo myotherproject.leo -c /etc/leo/style02.leo
leo anotherproject.leo -c /etc/leo/style23.leo

Each file opens in an editor with the shortcuts, buttons, commands,
plugins, appearance etc.  that has been tuned for that data management task.

or best yet:

leo myproject.leo -c /usr/lib/python2.5/site-packages/leo/config/style94.leo

==================

http://groups.google.com/group/leo-editor/browse_thread/thread/b5a736089079acaf#

Please, I think each file has a distinct and required role.

- config/leoSettings.leo = Edward's base, required for a sane starting point

- home/.leo/myLeoSettings.leo = adjust Edwards suggestions to taste

- cwd/myLeoSettings.leo = provide a customized working environment in
this folder

- leo -c /usr/lib/leo-editor/src/config/zope3_ide.leo =
  - open this file in a specialized environments, mine or community contributed
  - ...

- currentfile/@settings =
  - I'm working on some customization ideas
  - Here, try out this Leo file I sent you, check out all the spiffy
modifications 

@color
#@+node:ekr.20090717084250.10884: *8* Added support for --file=fileName command-line option
Only .zip and .leo extensions are allowed at present.
#@+node:ekr.20090717084250.10885: *8* Added support for --gui option
#@+node:ekr.20090717084250.10886: *7* New commands
#@+node:ekr.20090717084250.10887: *8* Added smart home (back-to-home) command
#@+node:ekr.20090717084250.10888: *8* The open command creates @edit nodes when opening non-.leo files
http://groups.google.com/group/leo-editor/browse_thread/thread/3417ff5e9c02c626

The open file dialog now shows all files by default.
Selecting a non-.leo file will load that file into a new node in the present outline.

This plugs what may have been the biggest hole in Leo's history.
#@+node:ekr.20090717084250.10889: *8* added pdb minibuffer command
This works, but stops Leo in the middle of the command-handling logic.

However, it is possible to pick up the commander by stepping out into
k.masterKeyHandler or k.masterCommandHandler. Using c, one can then get all
other info.
#@+node:ekr.20090717084250.10890: *8* Added support for smart_tab setting
- Tab = indent when there is a text selection
- Shift-Tab unindents always
#@+node:ekr.20090717084250.10891: *8* Improved isearch commands
Escape now ends isearch
#@+node:ekr.20090717084250.10892: *7* New and improved directives
#@+node:ekr.20090717084250.10893: *8* Added @nocolor-node directive
# Useful: we don't need a closing @color to enable coloring in descendants.
#@+node:ekr.20090717084250.10894: *8* Improved @path handling
#@+node:ekr.20090717084250.10895: *7* New settings
#@+node:ekr.20090717084250.10896: *8* Added better default fonts for Leo on Linux
http://groups.google.com/group/leo-editor/browse_thread/thread/f1c7c5134b95c77e
#@+node:ekr.20090717084250.10897: *8* Added support for @int icon_bar_widgets_per_row setting
#@+node:ekr.20090717084250.10898: *8* Added support for meta keys
http://groups.google.com/group/leo-editor/browse_thread/thread/b6a39ed672a28c65?pli=1
#@+node:ekr.20090717084250.10899: *8* Use myLeoSettings when opening leoSettings.leo
Changed config.get so that settings in leoSettings.leo are read *last*.
This means that myLeoSettings.leo will override leoSettings.leo,
even when leoSettings.leo is the local file.
#@+node:ekr.20090717084250.10900: *7* Plugins
#@+node:ekr.20090717084250.10901: *8* Improved nav_buttons plugin and corresponding nodeHistory class
#@+node:ekr.20090717084250.10902: *8* Created qtGui and tkGui plugins
#@+node:ekr.20090717084250.10903: *8* Created leoGuiPluginsRef.leo
This contains all gui plugins.
#@+node:ekr.20090717084250.10904: *6* New features in 4.6 b2
#@+node:ekr.20090717084250.10905: *7* Allow Leo to open any file
Leo can now open, for example, any .py file.
It will be put in an @edit node in an otherwise-empty outline.

This allows Leo to be associated with the edit action of .py files.
Something like this::

C:\Python26\python.exe "c:\leo.repo\trunk\launchLeo.py" --gui=qt %1 %2
#@+node:ekr.20090717084250.10906: *7* Improved unit testing
- leoDynamicTest.py now supports a --path argument giving the .leo file.
  This is so useful!

- leoDynamicTest.py now honors the --silent argument.

- leoTest.runUnitTestLeoFile runs all unit tests in a given .leo file
  in a separate process.

- leoTest.runTestsExternally calls runUnitTestLeoFile after creating
  dynamicUnitTest.leo.

- When reporting that no unit tests were found, all unit tests commands tell
  whether the entire outline or just the selected outline was searched.
  This fixes sometimes-misleading error messages.

- test.leo contains a 'run-test.leo-tests' button.

- leoPy.leo contains a 'run-all-core-tests' button.
#@+node:ekr.20090717084250.10907: *7* Leo tests syntax of .py files when saving them
#@+node:ekr.20090717084250.10908: *7* Made qt gui the default
#@+node:ekr.20090717084250.10909: *7* Support @auto-rst
#@+node:ekr.20090717084250.10910: *6* New features in 4.6 final
Leo now warns on dangerous writes to @thin and @file nodes.
#@+node:ekr.20090718092032.10405: *4* 4.6.1 final
Leo 4.6.1 final                             July 30, 2009

Leo 4.6.1 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Leo 4.6.1 fixes several minor bugs in Leo 4.6.


The highlights of Leo 4.6
--------------------------

- Cached external files *greatly* reduces the time to load .leo files.
- Leo now features a modern Qt interface by default.
  Leo's legacy Tk interface can also be used.
- New --config, --file and --gui command-line options.
- Leo tests syntax of .py files when saving them.
- Leo can now open any kind of file into @edit nodes.
- @auto-rst nodes allow easy editing of reStructuredText files.
- Properties of commanders, positions and nodes simplify programming.
- Improved Leo's unit testing framework.
- Leo now requires Python 2.5 or later.
- Dozens of small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20090718092032.10406: *5* Bug fixes
#@+node:ekr.20090718092032.10407: *6* Bugs fixed in 4.6 b2
#@+node:ekr.20090718092032.10408: *7* Added patch for startup logic
A patch at the start of loadOnePlugin prevents leo from crashing and allows the
gui prompt for a leoID to come up.
#@+node:ekr.20090718092032.10409: *7* Allocate gnx's when nodes are created
This is reasonable now that old-style file indices are rare.
#@+node:ekr.20090718092032.10410: *7* Allow block comments in private shadow files
Html files are a good test case.
#@+node:ekr.20090718092032.10411: *7* Compute delims from private shadow file as needed
#@+node:ekr.20090718092032.10412: *7* Don't copy @edit trees to outline
http://bugs.launchpad.net/leo-editor/+bug/376634

The fix was to putVnodes.
#@+node:ekr.20090718092032.10413: *7* Don't expand ancestors of @chapter node when selecting chapter
#@+node:ekr.20090718092032.10414: *7* Entries in recent files menu now have absolute paths
http://bugs.launchpad.net/leo-editor/+bug/383204
#@+node:ekr.20090718092032.10415: *7* Fixed (worked around) tk chapters bug
http://groups.google.com/group/leo-editor/browse_thread/thread/981c27d5c24c90f8
#@+node:ekr.20090718092032.10416: *7* Fixed @edit bug
The generated @nocolor line now ends with a newline.
#@+node:ekr.20090718092032.10417: *7* Fixed @shadow crasher
http://groups.google.com/group/leo-editor/browse_thread/thread/6cab5e676d4d75a0
#@+node:ekr.20090718092032.10418: *7* Fixed @thin bug
- Removed forceGnxOnPosition from leoImport.py and leoAtFile.py.

- readStartNode now always uses root.v for the first node
  instead of calling createThinChild4
#@+node:ekr.20090718092032.10419: *7* Fixed back-to-home so it works as expected
https://bugs.launchpad.net/leo-editor/+bug/367462

The expected/customary behavior (one you get used to in almost every editor) is:

End: always move to end of line
Home: Move to first visible character on the line. When pressing home again, move to column zero. If Home is pressed one more time, move to first visible character again.

This is also the way emacs behaves, though ctrl+a always moves to column zero.
#@+node:ekr.20090718092032.10420: *7* Fixed bad @verbatim bug
The @verbatim was being inserted into the outline.
#@+node:ekr.20090718092032.10421: *7* Fixed binding problem with notebook
#@+node:ekr.20090718092032.10422: *7* Fixed bug: sorting could revert headline changes
#@+node:ekr.20090718092032.10423: *7* Fixed crash when reading .zip files
The problem arose when reading a zipped file:

 File "C:\Programme\Leo-4-6-b1\leo\core\leoFileCommands.py", line
1265, in parse_leo_file
   s = theFile.read()
TypeError: read() takes at least 2 arguments (1 given)
saved: [zipped] Dive-into-Python-3.leo
#@+node:ekr.20090718092032.10424: *7* Fixed crasher when creating .leoID.txt
exception loading plugin
Traceback (most recent call last):

  File "C:\leo.repo\trunk\leo\core\leoPlugins.py", line 429, in loadOnePlugin
    loadedModulesFilesDict[moduleName] = g.app.config.enabledPluginsFileName

AttributeError: StubConfig instance has no attribute 'enabledPluginsFileName'

leoID='ekr'
.leoID.txt created in C:\Documents and Settings\HP_Administrator\My Documents\Edward\.leo
load 
#@+node:ekr.20090718092032.10425: *7* Fixed dabbrev-expands bug
http://bugs.launchpad.net/leo-editor/+bug/362048

I have 'dabbrev-expands' bound to the F4 key. When I press F4 after
the word "freq" in a body pane containing the word "frequency" then
Leo 4.5.1 shows a hour-glass for a while before giving an empty
dabbrev-expand: prompt in the minibuffer.

If I back up one character, putting point between the e and q and then
type F4, I get the expected behavior: the word "frequency" is inserted
immediately.

What I did:

- Removed "not ready messages".
- Made the code undoable.
- Added wimpy unit test.
#@+node:ekr.20090718092032.10426: *7* Fixed elisp importer problem
#@+node:ekr.20090718092032.10427: *7* Fixed F10/11/12 key bug
Added call to isFKey in k.handleUnboundKeys.
#@+node:ekr.20090718092032.10428: *7* Fixed file bug re unicode characters
http://bugs.launchpad.net/leo-editor/+bug/376189
#@+node:ekr.20090718092032.10429: *7* Fixed hoist problems
http://bugs.launchpad.net/leo-editor/+bug/382221
#@+node:ekr.20090718092032.10430: *7* Fixed lost anchor bug page up/down
http://bugs.launchpad.net/leo-editor/+bug/363403

With a long body text you might place the cursor on a line, hold down Shift, and
PgDn several pages to select a large block of text. The last PgDn may overshoot
the range you want selected, so you should be able to use UpArrow to bring the
bottom of the range back up to where you want it. However, on the first UpArrow
the selection is lost and restarted from the current cursor position. I.e. you
end up with just one line selected, instead of trimming one line of the
selection of several pages, as intended.
#@+node:ekr.20090718092032.10431: *7* Fixed minor @auto bug
http://bugs.launchpad.net/leo-editor/+bug/306671

If a Leo editor window is opened, and the "NewHeadline" node is renamed to
"@auto <path to some valid file>", and then the "File->Read/Write->Read @auto
nodes" menu option is selected, the renamed node reverts to its previous name
("NewHeadline"), and nothing is loaded into the node.
#@+node:ekr.20090718092032.10432: *7* Fixed multiple-editor focus problems
http://groups.google.com/group/leo-editor/browse_thread/thread/21bddd50f3400bdc?hl=en
#@+node:ekr.20090718092032.10433: *7* Fixed new command
The outline wasn't being redrawn properly.
#@+node:ekr.20090718092032.10434: *7* Fixed problems with change-all command
http://groups.google.com/group/leo-editor/browse_thread/thread/430287018f9d773d

The fix to minibufferFind.changeAll fixes a bug that is several years old.
The fix to findNextMatch fixes a bug that is likely much older than that.
#@+node:ekr.20090718092032.10435: *7* Fixed read clone bug
#@+node:ekr.20090718092032.10436: *7* Fixed rst import bug
#@+node:ekr.20090718092032.10437: *7* Fixed rst3 problem
http://mail.google.com/mail/#inbox/11ef0076a3f4d866
#@+node:ekr.20090718092032.10438: *7* Fixed seg-fault bug
The crash happened inside the call to::

    c.widgetWantsFocusNow(event.widget)

in callAltXFunction. Actually, the crash happened later, in c.outerUpdate.

A better fix would be to use wrappers for all edit widgets, and recalculate the
edit widget any it needs to be used.
#@+node:ekr.20090718092032.10439: *7* Fixed Shift-Arrow in headlines
#@+node:ekr.20090718092032.10440: *7* Fixed startup problem
http://groups.google.com/group/leo-editor/browse_thread/thread/606277d73b193037
#@+node:ekr.20090718092032.10441: *7* Fixed stubConfig problems
#@+node:ekr.20090718092032.10442: *7* Fixed undo bug
onTextChanged in the qt gui was calling setUndoTypingParams, in many case
redundantly and with bad params.

It remains to be seen whether onTextChanged is ever needed. If it is, it may be
difficult to set the old selection properly.
#@+node:ekr.20090718092032.10443: *7* Fixed vim bindings (dd) bug
http://bugs.launchpad.net/leo-editor/+bug/353925

The "kill-region" function did nothing when using the qt gui.

The fix was to replace tag_ranges with w.getSelectionRange, etc.
This was the only call to tag_ranges in the core.
#@+node:ekr.20090718092032.10444: *7* Investigated bug: File->Export->write failed due to incorrect path
http://bugs.launchpad.net/leo-editor/+bug/377907

I'm going to mark this invalid, although the behavior is way too confusing.

I added the following to the plugin's docstring:

Configuration
~~~~~~~~~~~~~

At present, the file leo/plugins/leo_to_html.ini contains configuration settings.
In particular, the default export path, "c:\" must be changed for *nix systems.
#@+node:ekr.20090718092032.10445: *7* Investigated speed of external unit tests
The problem is imports in the Commands ctor. When executed the first time from
the bridge the imports take about 3/4 sec. on my machine. There is nothing that
can or should be done. Ctrl-5 is still hugely faster than opening unitTest.leo!
#@+node:ekr.20090718092032.10446: *7* Made @url nodes work with qt gui
#@+node:ekr.20090718092032.10447: *7* Mark @<file> nodes dirty when @path nodes change
#@+node:ekr.20090718092032.10448: *7* Removed duplicate messages when opening non-existent .leo file
#@+node:ekr.20090718092032.10449: *7* Reversed messages about redefined keys
http://groups.google.com/group/leo-editor/browse_thread/thread/a04dcefbb672078f
#@+node:ekr.20090718092032.10450: *7* Scroll commands now affect only scrollbars
#@+node:ekr.20090718092032.10451: *6* Bugs fixed in 4.6 b1
#@+node:ekr.20090718092032.10452: *7* Fixed goto-global-line crasher
#@+node:ekr.20090718092032.10453: *7* Fixed bug that prevented Leo from opening files on the XP desktop
#@+node:ekr.20090718092032.10454: *7* Save/restore tnodeList in atFile.write
The code should save/restore, just as in the clean_file function (from scripts.leo)
#@+node:ekr.20090718092032.10455: *7* Paste outline problem
The problem was missing calls to initAfterLoad in c.new.
#@+node:ekr.20090718092032.10456: *7* Made sure $Home works for @nosent
http://groups.google.com/group/leo-editor/browse_thread/thread/f27e3514310a5c90
#@+node:ekr.20090718092032.10457: *7* Fixed atFile unicode bug
#@+node:ekr.20090718092032.10458: *7* Fixed Mark Edgington's @shadow bug
#@+node:ekr.20090718092032.10459: *7* Fixed whitespace problems with @auto/@shadow
Pulled trunk, got r1599

python launchLeo.py leo/plugins/leoPlugins.leo

go to

Plugins-->Graph world-->@shadow backlink.py-->backlink declarations

All I did was add the full stop at the end of the docstring, but see
the diff:

=== modified file 'leo/plugins/backlink.py'
--- leo/plugins/backlink.py     2009-02-19 18:16:01 +0000
+++ leo/plugins/backlink.py     2009-02-25 22:14:46 +0000
@@ -1,4 +1,4 @@
-'''Backlink - allow arbitrary links between nodes
+'''Backlink - allow arbitrary links between nodes.
 '''

 # Notes
@@ -296,7 +296,7 @@
                break
        else:
            self.showMessage("Error: no such link")
-
+
        gcc = getattr(self.c, 'graphcanvasController')
        if gcc:
            gcc.update()
#@+node:ekr.20090718092032.10460: *7* Fixed nested @path problem
http://groups.google.com/group/leo-editor/browse_thread/thread/7d8325d055cbef30
#@+node:ekr.20090718092032.10461: *7* Fixed encoding problems with rst3 plugin
http://groups.google.com/group/leo-editor/browse_thread/thread/5f5219fedd977ec2
#@+node:ekr.20090718092032.10462: *7* Fixed new rst3 crash
http://groups.google.com/group/leo-editor/browse_thread/thread/414137b93c7e4b90

Calls g.makeAllNonExistentDirectories instead of os.mkdir.
#@+node:ekr.20090718092032.10463: *7* Fixed two c syntax-coloring bugs
http://groups.google.com/group/leo-editor/browse_thread/thread/707a910f975f3715

http://groups.google.com/group/leo-editor/browse_thread/thread/74c6ab4809bde980

There were two separate bugs:

1. The eol_span and eol_span_regex now honor the mode's escape character.

2. colorRangeWithTag now colors delegates with the default tag color.

No changes were made in modes/c.py or modes/c.xml.
#@+node:ekr.20090718092032.10464: *5* New features
#@+node:ekr.20090718092032.10465: *6* New features in 4.6 b1
#@+node:ekr.20090718092032.10466: *7* Improved file handling
#@+node:ekr.20090718092032.10467: *8* Open a default .leo file if no other is specified
http://groups.google.com/group/leo-editor/browse_thread/thread/d6449236bc140713#

Added support for @string default_leo_file = ~/.leo/workbook.leo
#@+node:ekr.20090718092032.10468: *8* Added escapes for underindented lines
@string underindent-escape-string = \-
#@+node:ekr.20090718092032.10469: *8* Warn when writing an externally changed file
http://groups.google.com/group/leo-editor/browse_thread/thread/c80fd8375534afdf
#@+node:ekr.20090718092032.10470: *7* New code features
#@+node:ekr.20090718092032.10471: *8* Added autoCompleter.getExternalCompletions
@nocolor

http://groups.google.com/group/leo-editor/browse_thread/thread/4ad91984a6d0acac

> As I said, all I need would be is for leo to call callback/hook with
> signature like
> def complete(line-up-to-cursor, current_node) => list of strings

The actual signature is:

theObject,completionList = getExternalCompletions (self,s,p=None,language='python')

p is used only to get the language, or you can set the language by hand.

@color
#@+node:ekr.20090718092032.10472: *8* Added g.posList
#@+node:ekr.20090718092032.10473: *8* Better plugin info
c.config.doEnabledPlugins sets g.app.config.enabledPluginsFileName
#@+node:ekr.20090718092032.10474: *8* Added properties to leoNodes.py
p.b, p.h and p.gnx
t.b, t.h, t.gnx and t.u
v.b, v.h, v.gnx, and v.u
#@+node:ekr.20090718092032.10475: *8* Added script to leoSettings.leo to ensure all menu items are valid
#@+node:ekr.20090718092032.10476: *8* Added c.config.getSettingSource
c.config.getSettingSource('show_full_tracebacks_in_scripts')
returns the name of the file which Leo used to determine the setting

- D indicates default settings.
- F indicates the file being loaded
- L indicates leoSettings.leo
- M indicates myLeoSettings.leo
#@+node:ekr.20090718092032.10477: *8* Predefined 'self' in @test/@suite nodes
#@+node:ekr.20090718092032.10478: *8* Added c.getNodePath and c.getNodeFileName
http://groups.google.com/group/leo-editor/browse_thread/thread/3b5f1232ecc6bba7
#@+node:ekr.20090718092032.10479: *7* New command-line options
#@+node:ekr.20090718092032.10480: *8* Added -c option to specify config files
@nocolor

The setting is called -c or --config.  The one-config-file arg no longer exists.

http://groups.google.com/group/leo-editor/browse_thread/thread/f3f95d93bcd93b94

Personally, I'd like to see another config file available via -c on
the command line:
(a common idiom)

leo myproject.leo -c /usr/lib/myproject/myLeoSettings.leo

or better yet:

leo myproject.leo -c /etc/leo/style01.leo
leo myotherproject.leo -c /etc/leo/style02.leo
leo anotherproject.leo -c /etc/leo/style23.leo

Each file opens in an editor with the shortcuts, buttons, commands,
plugins, appearance etc.  that has been tuned for that data management task.

or best yet:

leo myproject.leo -c /usr/lib/python2.5/site-packages/leo/config/style94.leo

==================

http://groups.google.com/group/leo-editor/browse_thread/thread/b5a736089079acaf#

Please, I think each file has a distinct and required role.

- config/leoSettings.leo = Edward's base, required for a sane starting point

- home/.leo/myLeoSettings.leo = adjust Edwards suggestions to taste

- cwd/myLeoSettings.leo = provide a customized working environment in
this folder

- leo -c /usr/lib/leo-editor/src/config/zope3_ide.leo =
  - open this file in a specialized environments, mine or community contributed
  - ...

- currentfile/@settings =
  - I'm working on some customization ideas
  - Here, try out this Leo file I sent you, check out all the spiffy
modifications 

@color
#@+node:ekr.20090718092032.10481: *8* Added support for --file=fileName command-line option
Only .zip and .leo extensions are allowed at present.
#@+node:ekr.20090718092032.10482: *8* Added support for --gui option
#@+node:ekr.20090718092032.10483: *7* New commands
#@+node:ekr.20090718092032.10484: *8* Added smart home (back-to-home) command
#@+node:ekr.20090718092032.10485: *8* The open command creates @edit nodes when opening non-.leo files
http://groups.google.com/group/leo-editor/browse_thread/thread/3417ff5e9c02c626

The open file dialog now shows all files by default.
Selecting a non-.leo file will load that file into a new node in the present outline.

This plugs what may have been the biggest hole in Leo's history.
#@+node:ekr.20090718092032.10486: *8* added pdb minibuffer command
This works, but stops Leo in the middle of the command-handling logic.

However, it is possible to pick up the commander by stepping out into
k.masterKeyHandler or k.masterCommandHandler. Using c, one can then get all
other info.
#@+node:ekr.20090718092032.10487: *8* Added support for smart_tab setting
- Tab = indent when there is a text selection
- Shift-Tab unindents always
#@+node:ekr.20090718092032.10488: *8* Improved isearch commands
Escape now ends isearch
#@+node:ekr.20090718092032.10489: *7* New and improved directives
#@+node:ekr.20090718092032.10490: *8* Added @nocolor-node directive
# Useful: we don't need a closing @color to enable coloring in descendants.
#@+node:ekr.20090718092032.10491: *8* Improved @path handling
#@+node:ekr.20090718092032.10492: *7* New settings
#@+node:ekr.20090718092032.10493: *8* Added better default fonts for Leo on Linux
http://groups.google.com/group/leo-editor/browse_thread/thread/f1c7c5134b95c77e
#@+node:ekr.20090718092032.10494: *8* Added support for @int icon_bar_widgets_per_row setting
#@+node:ekr.20090718092032.10495: *8* Added support for meta keys
http://groups.google.com/group/leo-editor/browse_thread/thread/b6a39ed672a28c65?pli=1
#@+node:ekr.20090718092032.10496: *8* Use myLeoSettings when opening leoSettings.leo
Changed config.get so that settings in leoSettings.leo are read *last*.
This means that myLeoSettings.leo will override leoSettings.leo,
even when leoSettings.leo is the local file.
#@+node:ekr.20090718092032.10497: *7* Plugins
#@+node:ekr.20090718092032.10498: *8* Improved nav_buttons plugin and corresponding nodeHistory class
#@+node:ekr.20090718092032.10499: *8* Created qtGui and tkGui plugins
#@+node:ekr.20090718092032.10500: *8* Created leoGuiPluginsRef.leo
This contains all gui plugins.
#@+node:ekr.20090718092032.10501: *6* New features in 4.6 b2
#@+node:ekr.20090718092032.10502: *7* Allow Leo to open any file
Leo can now open, for example, any .py file.
It will be put in an @edit node in an otherwise-empty outline.

This allows Leo to be associated with the edit action of .py files.
Something like this::

C:\Python26\python.exe "c:\leo.repo\trunk\launchLeo.py" --gui=qt %1 %2
#@+node:ekr.20090718092032.10503: *7* Improved unit testing
- leoDynamicTest.py now supports a --path argument giving the .leo file.
  This is so useful!

- leoDynamicTest.py now honors the --silent argument.

- leoTest.runUnitTestLeoFile runs all unit tests in a given .leo file
  in a separate process.

- leoTest.runTestsExternally calls runUnitTestLeoFile after creating
  dynamicUnitTest.leo.

- When reporting that no unit tests were found, all unit tests commands tell
  whether the entire outline or just the selected outline was searched.
  This fixes sometimes-misleading error messages.

- test.leo contains a 'run-test.leo-tests' button.

- leoPy.leo contains a 'run-all-core-tests' button.
#@+node:ekr.20090718092032.10504: *7* Leo tests syntax of .py files when saving them
#@+node:ekr.20090718092032.10505: *7* Made qt gui the default
#@+node:ekr.20090718092032.10506: *7* Support @auto-rst
#@+node:ekr.20090718092032.10507: *6* New features in 4.6 final
Leo now warns on dangerous writes to @thin and @file nodes.
#@+node:ekr.20090802162204.5798: *4* 4.6.2 final
Leo 4.6.2 final                             August 3, 2009

Leo 4.6.2 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Leo 4.6.2 fixes several bugs reported since Leo 4.6 was released.

The highlights of Leo 4.6
--------------------------

- Cached external files *greatly* reduces the time to load .leo files.
- Leo now features a modern Qt interface by default.
  Leo's legacy Tk interface can also be used.
- New --config, --file and --gui command-line options.
- Leo tests syntax of .py files when saving them.
- Leo can now open any kind of file into @edit nodes.
- @auto-rst nodes allow easy editing of reStructuredText files.
- Properties of commanders, positions and nodes simplify programming.
- Improved Leo's unit testing framework.
- Leo now requires Python 2.5 or later.
- Dozens of small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20090803084828.5800: *5* Bugs fixed
- AltGr properly handled as Alt+Ctrl.
  Created a setting: @bool enable_alt_ctrl_bindings.
  The default is False, needed for AltGr functionality on Windows.

- Fixed unpickling problems in getDescendentUnknownAttributes

- Plugins that fail to import Pmw no longer prevent Leo from launching.

- Fixed bug 397433, tk chapter menu crash, on all platforms.
#@+node:ekr.20091006093902.6558: *4* 4.6.3 final
Leo 4.6.3 final                             September 4, 2009

Leo 4.6.3 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

Leo 4.6.3 fixes a significant caching bug in Leo 4.6.2.
Leo 4.6.3 also comes with an executable installer for Windows.
Leo 3.6.3 adds several new plugins.

The highlights of Leo 4.6
--------------------------

- Cached external files *greatly* reduces the time to load .leo files.
- Leo now features a modern Qt interface by default.
  Leo's legacy Tk interface can also be used.
- New --config, --file and --gui command-line options.
- Leo tests syntax of .py files when saving them.
- Leo can now open any kind of file into @edit nodes.
- @auto-rst nodes allow easy editing of reStructuredText files.
- Properties of commanders, positions and nodes simplify programming.
- Improved Leo's unit testing framework.
- Leo now requires Python 2.5 or later.
- Dozens of small improvements and bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20091006093902.6559: *5* Bugs fixed
- Leo marks nodes dirty if the nodes changed during read.

- Fixed a bug in g.adjustTripleString.
#@+node:ekr.20091006093902.6560: *5* New features
- Added --gui=qttabs command-line option

- Added new plugins: spydershell.py, qtframecommands.py, and mod_framesize.py.

- Added "show folder" in rclick menu.
#@+node:ekr.20100118181428.8827: *3* 4.7 One-node world, Leo-3k, @auto-rst, convert @file
#@+node:ekr.20090909083000.6547: *4* 4.7 beta 1
Leo 4.7 beta 1                          September 9, 2009

Leo 4.7 beta 1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

This version of Leo is labeled a beta version because it contains some new,
relatively untested plugins.  However, Leo's core should be quite reliable.

In particular, Leo 4.7 beta 1 fixes a bug that caused Leo 4.6 releases to crash
if .leoID.txt did not exist. Usually this file does exist, but Leo will prompt
for the contents of this file (a user id) the very first time somebody uses Leo.
Alas, an unfortunate reversion of code caused Leo to crash. Not exactly the best
introduction to Leo!

The highlights of Leo 4.7:
--------------------------

- A major simplification of internal data model: the so-called
  one-node world. Note: this is **disabled** in the beta 1 release.
- A new executable Windows installer, whose manifest is created from
  the files that bzr actively manages.
- Leo no longer adds directories to sys.path on startup.
- New plugins.
- The usual assortment of bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20090909083000.6556: *5* Added new Windows installer
Unlike previous installers, the manifest is created from the
@button make leo.nsi script in dist.leo.
#@+node:ekr.20090909083000.6555: *5* Added new plugins
@nocolor-node

New command-line option
    --gui=qttabs

new plugins:
    spydershell,
    qtframecommands
    mod_framesize.

Improved plugin:  "show folder" in rclick menu.

Improved plugin: contextmenu.py

    If you rclick on @thin / whatever item, you should see "open
    /home/ville/foo" (or equivalent) menu entry. It open up the file manager on
    that folder (using xdg-open on linux, os.startfile on windows). I have no
    idea what to do with mac, now it runs xdg-open and probably fails.
#@+node:ekr.20090909083000.6552: *5* Added options to vim plugin
The setting::

    @string vim_trigger_event = icondclick2

is the default.  It opens vim when the user double-clicks the icon box.

Alternatives are::

    @string vim_trigger_event = iconclick2
    @string vim_trigger_event = select2

The former opens vim on single clicks in the icon bar.
The latter opens vim whenever a new node is selected in Leo.
#@+node:ekr.20090909083000.6553: *5* Leo no longer adds directories to sys.path
http://groups.google.com/group/leo-editor/browse_thread/thread/b868abd65fb57759

Leo no longer adds directories to sys.path on startup.

(Merged the clean-sys-path branch into the trunk.)_
#@+node:ekr.20100118181428.8813: *4* 4.7 beta 2
Leo 4.7 beta 1                January 28, 2009

Leo 4.7 release beta 1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.7 beta 1 fixes all known serious bugs in Leo.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.7:
--------------------------

- Leo now uses the simplest possible internal data model.
  This is the so-called "one-node" world.
- Leo supports Python 3.x.
- Leo requires Python 2.6 or above.
- Several important improvements in file handling.
    - Leo converts @file nodes to @thin nodes automatically.
    - Leo creates a 'Recovered Nodes' node to hold data that
      otherwise might be lost due to clone conflicts.
    - @auto-rst now works much more reliably reliably.
    - Leo no longer @noref trees.  Such trees are not
      reliable in cooperative environments.
- A new Windows installer.
- Many other features, including new command line options and new plugins.
- Dozens of bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20100118181428.7557: *5* Bugs
#@+node:ekr.20100118181428.7559: *6* Fixed calltips on leo3k
They wiped out the newly-inserted selection range.
#@+node:ekr.20100118181428.7570: *6* Fixed headline scrolling
My biggest annoyance is the invalid bug 409442, I have to use the tk
GUI because of it.

I've also complained about it in this thread:
http://groups.google.com/group/leo-editor/browse_thread/thread/07cdbb... 

----- Ville +1
I feel your pain.

Please try this workaround (run with ctrl+b):

tree = c.frame.tree.treeWidget
tree.setColumnCount(2)

-----
> Isn't it possible to stick this tree.setColumnCount(2) into some
> constructor in the leo qt GUI plugin so the outline pane would have
> the horizontal scrollbar by default?

Yes, but it's not sure we want to have 2 columns in the tree widget -
and it would create scrollbar on many occasions when it's not
necessary.

So this is not a simple fix for your problem, it has implications
beyond your problem. 
#@+node:ekr.20100118181428.7571: *6* Fixed bug 498692: Undo renames headline
#@+node:ekr.20100118181428.7614: *6* Fixed bug 498688: Undo back to last saved content...
Fixed bug Bug 498688: Undo back to last saved content still shows file as
modified ("*" in title)
#@+node:ekr.20100118181428.7712: *6* Fixed bug: no log when notebook does not exist
#@+node:ekr.20100118181428.7715: *6* Fixed bug 362950: during body text undo selection goes nuts...
Bug 362950: during body text undo selection goes nuts and view moves
#@+node:ekr.20100118181428.7830: *6* Removed unsettling @auto warning
#@+node:ekr.20100118181428.7831: *6* Fixed at-auto-rst problems
#@+node:ekr.20100118181428.8070: *6* Fixed bug: at-nosent nodes were not being dirty when headline changes
#@+node:ekr.20100118181428.8077: *6* Allow hyphens in xml tags
Fixes bug 497332: importing xml via @data import_xml_tags does not allow dashes in tag.

For characters valid in names see:
www.w3.org/TR/2008/REC-xml-20081126/#NT-Name
#@+node:ekr.20100118181428.8090: *6* Fixed Alt-u bug and refactored k.masterKeyHandler
Bug 404993: alt+U (universal argument) "freezes" leo state

Press alt+U displays "Universal argument:" in minibuffer, and there is no
obvious way to get out of this state. It seems ctrl+G gets you out of it, but
that's not really obvious. ESC should do it.
#@+node:ekr.20100118181428.8109: *6* Fixed at-shadow error
http://groups.google.com/group/leo-editor/browse_thread/thread/81f7bb5060ed8b01
#@+node:ekr.20100118181428.8236: *6* Fixed bug 408886: qttabs gui doesn't mark commanders dirty properly
#@+node:ekr.20100118181428.8239: *6* Fixed bug 476653: @nowrap isn't working for qt / @edit nodes
#@+node:ekr.20100118181428.8240: *6* Fixed bug 480422: string-rectangle kills syntax highlighting
#@+node:ekr.20100118181428.8242: *6* Fixed bug in g.adjustTripleString
#@+node:ekr.20100118181428.8248: *6* Fixed bug in writeNodeToString
Leo now adds a leading period if needed.
#@+node:ekr.20100118181428.8252: *6* Fixed bug: @nosent should warn about orphan nodes
#@+node:ekr.20100118181428.8257: *6* Fixed bug: Sometimes 'redefining shortcut' message is backwards
#@+node:ekr.20100118181428.8262: *6* Fixed contract-or-go-right
#@+node:ekr.20100118181428.8275: *6* Fixed crasher when writing to a newly-deleted file
#@+node:ekr.20100118181428.8278: *6* Fixed double prompt in c.close()
#@+node:ekr.20100118181428.8281: *6* Fixed elisp parsing bug
#@+node:ekr.20100118181428.8294: *6* Fixed publish-argv-for-missing-stylesheets
#@+node:ekr.20100118181428.8297: *6* Fixed registerHandler bug
http://groups.google.com/group/leo-editor/browse_thread/thread/8616f4e171e1a24b
#@+node:ekr.20100118181428.8298: *6* Fixed scrolling problem with multiple editors
http://groups.google.com/group/leo-editor/browse_thread/thread/33e87adbff5d69d9
#@+node:ekr.20100118181428.8299: *6* Fixed startup reversion when .leoID.txt does not exist
#@+node:ekr.20100118181428.8302: *6* Handle Insert key properly
This is now bound in the EKR bindings to insert-node.
#@+node:ekr.20100118181428.8306: *6* Improved the install docs
http://groups.google.com/group/leo-editor/browse_thread/thread/add6242d6f4fc476
#@+node:ekr.20100118181428.8307: *6* Made add-comments and delete-comments commands work with shortcuts
#@+node:ekr.20100118181428.8334: *6* Marked @<file> nodes dirty if nodes change during read.
#@+node:ekr.20100118181428.8358: *6* Recover from bad chars in .leo files
Form-feed characters were causing problems with Python 3k.
#@+node:ekr.20100118181428.8362: *6* Select main chapter initially
It can be alarming to select a small chapter in a large outline.
#@+node:ekr.20100118181428.8363: *6* Suppressed dangerous write prompt for clones
#@+node:ekr.20100118181428.8365: *6* Use w.leoMoveCursorHelper if it exists
This fixes the following two bugs:

- 421957 When body_pane_wraps is set to true, Previous-Line and Next-Line do not
  work as expected.

- 489917 Cursor placement defect 
#@+node:ekr.20100118181428.8413: *6* Fixed bug 452303 @auto-rst can be dangerous
http://groups.google.com/group/leo-editor/browse_thread/thread/b84659e608ba44d5
#@+node:ekr.20100118181428.8447: *6* Fixed underlining problem in rst
http://groups.google.com/group/leo-editor/browse_thread/thread/cdf78cbca5c526be
#@+node:ekr.20100118181428.8449: *6* Fixed qt key problems
Shift-PageUp/Down were not working.
#@+node:ekr.20100118181428.8473: *6* Fixed bug: 381895 qtGui Split ratio is not saved in .leo file
http://bugs.launchpad.net/leo-editor/+bug/381895
#@+node:ekr.20100118181428.8481: *6* Applied patches to fix bug: 451377 Make Leo frienly to mac apps
https://bugs.launchpad.net/leo-editor/+bug/451377
#@+node:ekr.20100118181428.8485: *6* Fixed bug: 394445 Chapters selection button: in qt, missing, in Tk, only one option
The Tk part of this bug can not be fixed.
#@+node:ekr.20100118181428.8486: *6* Fixed bug: overwrite modified file message
http://groups.google.com/group/leo-editor/browse_thread/thread/b77b5260854ffbf6
#@+node:ekr.20100118181428.8497: *6* Fixed auto-save problem
http://groups.google.com/group/leo-editor/browse_thread/thread/b77b5260854ffbf6
#@+node:ekr.20100118181428.8502: *6* Fixed old at-shadow problem
http://groups.google.com/group/leo-editor/browse_thread/thread/c8f3edda9de05484
#@+node:ekr.20100118181428.8514: *6* Fixed ctrl-tab bug
ctrl-tab (currently binded to cycle-focus) didn't work in windows with pyqt.
#@+node:ekr.20100118181428.8517: *6* Fixed 349027: body doesn't get focus after headline edit
https://bugs.launchpad.net/leo-editor/+bug/349027
#@+node:ekr.20100118181428.8518: *6* Fixed bug 507559: Can't use End key while editing node headline
#@+node:ekr.20100118181428.8522: *6* Finished bug 486433: non-breaking space etc. are invisible
https://bugs.launchpad.net/leo-editor/+bug/486433
#@+node:ekr.20100118181428.8523: *6* Fixed bug: 420988 @tabwith 8 not honored
https://bugs.launchpad.net/leo-editor/+bug/420988
#@+node:ekr.20100118181428.8524: *6* Don't colorize @others and @all unless they start a line
#@+node:ekr.20100119145003.7319: *6* Gui bugs
#@+node:ekr.20100119145003.7320: *7* Fixed file-open focus problem
#@+node:ekr.20100119145003.7322: *7* Eliminate double close prompt
#@+node:ekr.20100119145003.7324: *7* Fixed scrolling problem with multiple editors
#@+node:ekr.20100119145003.7325: *7* Fixed crash in quicksearch plugin
#@+node:ekr.20100119145003.7327: *7* Fixed @nosent dirty bug
Note: changing a headline as *no effect* on an @nosent file!
The only bug was that redraw_after_head_changed must update icons.
#@+node:ekr.20100119145003.7358: *7* Allow horizontal scrolling in QtTree
#@+node:ekr.20100119145003.7531: *7* Correct binding of insert key
#@+node:ekr.20100119145003.7546: *7* Update tab names when the commander is dirty
#@+node:ekr.20100119145003.7612: *7* Made @nowrap work
#@+node:ekr.20100119145003.7618: *7* Added leoMoveCursorHelper
#@+node:ekr.20100119145003.7625: *7* Remember the ratios when the user moves splitters by hand.
#@+node:ekr.20100119145003.7629: *7* Chapter tabs require both_chapters and use_chapters_tabs
#@+node:ekr.20100119145003.7632: *7* Don't colorize directives unless they start a line
#@+node:ekr.20100119145003.7643: *7* Config coloring tags whenever the language changes
#@+node:ekr.20100119145003.7718: *7* Update qttabs when saving a new file
#@+node:ekr.20100124164700.11919: *6* Fixed colorizer bug affecting per-language @font settings
@nocolor-node

It looks like you should be able to put the following in an
@font node, and get restructured text bold to appear in bold on screen:

rest_keyword2_font_size = 16
rest_keyword2_font_family = Bitstream Charter
rest_keyword2_font_slant = roman
rest_keyword2_font_weight = bold

However nothing happens when I do this. The python examples in the
test.leo file work fine for me, so I'm not sure what's gone wrong.

I think that the following should also work, but it's also currently
not doing anything for me:

@color rest_keyword2_color = black

==================

Rev 2706 fixes a significant colorizer bug that caused your problem.
Previously, the colorizer inited the so-called configuration tags only
once, which is wrong. These tags are what the @font settings specify.
Now, the colorizer inits the tags when the language changes when
switching nodes.  Usually the language doesn't change, so the new code
will be approximately as fast as the old. 
#@+node:ekr.20100124164700.11920: *6* support extend-mode for several commands
'backward-find-character'
'find-character'
#@+node:ekr.20100124164700.11921: *6* Fixed qttab problem
@nocolor-node

On Mon, Jan 18, 2010 at 9:25 PM, tfer <tfetherston@aol.com> wrote:

cmd.exe /k C:\PyDev\leo-editor\trunk\launchLeo.py --gui=qttabs -- ipython

1) (??) the button removal menu just flash on right mouse click, disappears immediately.

2) Leo opens up the workbook, I open a new doc in a tab, 'untitled', save it,
   get saved ... in log, however, tab title does not change unless I close and
   reload it.
#@+node:ekr.20100124164700.11922: *6* <alt-x> select-all crashes python when focus is in headline
@
The problem occurs because the QtGui.QLineEdit object goes away
when the minibuffer gets focus and the QTreeWidget loses focus.

The fix: add a 'permanent' ivar to leoQtTextWidgets, and set
this ivar to False for headline widgets.
#@+node:ekr.20100124164700.11923: *6* Allow saving .leo files with undefined-sections
@nocolor-node

http://groups.google.com/group/leo-editor/browse_thread/thread/db797dd1d4dddffb

1) Create an @thin file based outline.
2) In the @thin file, create an unreferenced section (something like a
  header <<This Section Is Bogus>>).
3) Now, File->Exit
4) A dialog box pops up
  (Save changes to leo_file.leo before quitting? Yes/No/Cancel)
5) Click "Yes"
6) In the log pane, you will see: "undefined section" and "saved: leo_file.leo"
  and in the console window, you see "undefined section: ..."

The point is that I can't kill Leo if I keep saying "Yes" to the
"Save change before quitting" dialog. This is definitely not the
intended behavior. The correct behavior would be to save the file,
give me the warning about the undefined section, and exit.

EKR: The fix was simple: write_leo_file ignores the status returned from
c.atFileCommands.writeAll.

Note that Leo writes the write error to the console as well as the log pane,
so this should be safe enough.
#@+node:ekr.20100124164700.11924: *6* Refactored write_Leo_file
#@+node:ekr.20100124164700.11925: *6* Fixed print-bindings crasher w/ leo3k
#@+node:ekr.20100124164700.11926: *6* Fixed problem with already-existing .leo.bak files
@nocolor-node

I also unhappily discovered that any file named somedoc.leo.bak will
get deleted whenever you save a file named somedoc.leo.

===========

This turned into a major refactoring of write_Leo_file.
#@+node:ekr.20100124164700.11927: *6* Fixed sort children bug
https://bugs.launchpad.net/leo-editor/+bug/510148

The fix was in sortSiblings.
#@+node:ekr.20100124164700.11928: *6* Fixed unicode problems
@nocolor-node

- 'encoding' arg removed from appendStringToBody, setBodyString

- There are too many usages of _bodyString !!

- There is no way to give an encoding to setBodyString:
    It should give an internal error if the s arg is not unicode.
#@+node:ekr.20100124164700.11938: *6* Fixed crash in writeToFileHelper
#@+node:ekr.20100124164700.11944: *6* Add warnings when @file logic happens
#@+node:ekr.20100124164700.11946: *6* Fixed mkstemp bug
@nocolor-node

https://bugs.launchpad.net/leo-editor/+bug/510145

Current leo trunk, r2732, Slackware Linux

- I go to /tmp in terminal
- there is no aaa.leo there (this is important, see below why)
- I launch leo (the current working directory is /tmp)
- I select "File->Save as" menu item
- the save file dialog opens in /tmp, this is correct
- I type in the file name "aaa" then hit "Save" button
- leo dumps an error in the log pane:

exception renaming /tmp/aaa.leo to /tmp/tmpbNydoS
IOError: [Errno 2] No such file or directory: u'/tmp/aaa.leo'

=============

The solution was to create the backup file only if fileName exists.
#@+node:ekr.20100124164700.11951: *6* Removed most usage of _bodyString & _headString
@nocolor-node

Made sure _bodyString _headString used only in leoNodes.py.

We allow setting this vars in file reading code.

*** p.b/p.h setters call c.setBody/HeadString,
    which are very slow!
#@+node:ekr.20100124164700.11965: *6* Don't use tnodeList to separate old/new @file nodes
@nocolor-node

- Removed thinFile arg from atFile.read.
  atFile.read can uncache *any* cached file.
- Removed thinFile arg from initReadIvars.
- self.thinFile ivar set only in readOpenFile.
- atFile.read no longer calls scanHeaderForThin:
  we simply use the thinFile value returned by scanHeader.
- atFile.readOpenFile deletes children as needed.
#@+node:ekr.20100124164700.12027: *6* Eliminated warning re orphan nodes
#@+node:ekr.20100128094926.12524: *6* Eliminated node-changed marks
These marks were just annoying.
#@+node:ekr.20100128094926.12739: *6* Suppress path changed message in save-as and save-to
#@+node:ekr.20100128094926.12756: *6* Fixed Terry's unicode problem
Deleting a range of line containing unicode characters deletes too much.
#@+node:ekr.20100118181428.8525: *5* Features
#@+node:ekr.20100118181428.8815: *6* Leo supports Python 3.x
Leo requires Python 2.6 or above, including Python 3.0 and above.
#@+node:ekr.20100129054823.11928: *6* Improved file handling
- Leo now treats @file nodes just like it treats @thin nodes. This makes Leo
  much safer to use in cooperative environments that use source code control
  systems. As part of this change, Leo no longer supports @noref nodes.

- @auto-rst now works much more reliably.

- Leo now has a simple, robust, and extremely useful scheme to recover from
  clone conflicts, no matter how they may arise. This removes all the dread from
  "node changed" messages. It is easy to see what the changes were, and it is
  easy to choose what, if anything to do.

  When a clone conflict occurs, you will see a red message in the log pane and a
  "Recovered Nodes" node as the last top-level node. This node has one child per
  red message. Each of these children contains two nodes: an "old" node and a
  "new" node. Unless there are multiple conflicts for a single node, the "new"
  node will have "won": every clone contains the new node's headline and body
  text. All these nodes are plain nodes, *not* clones. It is up to you to change
  the corresponding clone nodes if you choose to do so.

- Leo minimizes unnecessary changes to .leo files. Leo writes outline-size and
  orientation to the cache in your .leo directory. This eliminates unnecessary
  changes to .leo files.

- Leo now creates temporary files in the systems standard temporary directory.
  This prevents Leo from over-writing user-generated .bak files.
#@+node:ekr.20100129054823.17683: *6* New command-line options
- The --debug command-line option sets g.debug.

- The --version command-line option causes Leo
  to print it's version and exit.

#@+node:ekr.20100129054823.11935: *6* Improved plugins
Added options for vim plugin. The setting::

    @string vim_trigger_event = icondclick2

is the default. It opens vim when the user double-clicks the icon box.
Alternatives are::

    @string vim_trigger_event = iconclick2
    @string vim_trigger_event = select2

The former opens vim on single clicks in the icon bar.
The latter opens vim whenever a new node is selected in Leo.

#@+node:ekr.20100129054823.17685: *6* New settings
The qt colorizer now supports font specifications in @font nodes.
#@+node:ekr.20100201192329.7018: *4* 4.7 beta 3
Leo 4.7 beta 3                       February 2, 2009

Leo 4.7 beta 3 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.7 beta 3 fixes all known serious bugs in Leo.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.7:
--------------------------

- Leo now uses the simplest possible internal data model.
  This is the so-called "one-node" world.
- Leo supports Python 3.x.
- Leo requires Python 2.6 or above.
- Several important improvements in file handling.
    - Leo converts @file nodes to @thin nodes automatically.
    - @auto-rst now works much more reliably reliably.
    - Leo no longer @noref trees.  Such trees are not
      reliable in cooperative environments.
- A new Windows installer.
- Many other features, including new command line options and new plugins.
- Dozens of bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20100201192329.7095: *5* Bugs fixed in Leo 4.7 b3
#@+node:ekr.20100201192329.7141: *6* Fixed unicode problems
'utf-8' is now the official, explicit unicode encoding unless overridden when
reading files.

This simplifies the code in several ways. In particular, the 'mbcs' encoding is
never used by default, and there is no g.app.defaultEncoding argument.

The rst3 command now uses 'utf-8' for all encodings unless explicitly overridden.
#@+node:ekr.20100201192329.7101: *6* paste-node-as-clone now sets dirty bits properly
This was a serious error.  It could cause clone clashes on later reloads.
#@+node:ekr.20100201192329.7106: *6* Fixed crasher in sort-siblings
This only happened if two nodes had the same headline.
#@+node:ekr.20100201192329.7108: *6* Fixed bug 515164: a crasher in p.positionExists
#@+node:ekr.20100201192329.7112: *6* Fix crasher in scrolledMessage.py
#@+node:ekr.20100201192329.7113: *6* Fixed problem with colon following @path
@nocolor-node

The problem arises because an @path directive ended with ':':

    @path: aPath

What I did:

- g.get_directives_dict now carefully checks for non-whitespace following a directive.
- The qt colorizer does the same.
- Added unit test to check for this.
#@+node:ekr.20100201192329.7116: *6* Code cleanup
Eliminated most imports from the leo/extensions folder.

#@+node:ekr.20100205152016.14053: *4* 4.7 rc 1
Leo 4.7 rc 1                    February 12, 2009

Leo 4.7 release candidate 1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.7 rc 1 fixes all known bugs in Leo, serious or minor.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.7:
--------------------------

- Leo now uses the simplest possible internal data model.
  This is the so-called "one-node" world.
- Leo supports Python 3.x.
- Leo requires Python 2.6 or above.
- Several important improvements in file handling.
    - Leo converts @file nodes to @thin nodes automatically.
    - Leo creates a 'Recovered Nodes' node to hold data that
      otherwise might be lost due to clone conflicts.
    - @auto-rst now works much more reliably reliably.
    - Leo no longer supports @noref trees.  Such trees are not
      reliable in cooperative environments.
- A new Windows installer.
- Many other features, including new command line options and new plugins.
- Dozens of bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20100205152016.14054: *5* Recovering from clone conflicts
Leo now has a simple, robust, and extremely useful scheme to recover from clone
battles, no matter how they may arise. This removes all the dread from "node
changed" messages. It is easy to see what the changes were, and it is easy to
choose what, if anything to do.

It is easy to test the code to see how it works:

1. Put a clone in an external file, and put another clone in Leo
outside of any external file.

2. Change the clone outside of Leo using an external editor.

3. Reload Leo.

When a clone conflict occurs, you will see a red message in the log pane and a
"Recovered Nodes" node as the last top-level node. This node has one child per
red message. Each of these children contains two nodes: an "old" node and a
"new" node. Unless there are multiple conflicts for a single node, the "new"
node will have "won": every clone contains the new node's headline and body
text. All these nodes are plain nodes, *not* clones. It is up to you to change
the corresponding clone nodes if you choose to do so.
#@+node:ekr.20100209160132.11690: *5* Bugs fixed
#@+node:ekr.20100209160132.11691: *6* Fixed unicode bug in setSelectionRangeHelper
#@+node:ekr.20100209160132.11692: *6* Home key no longer clears the minibuffer
@nocolor-node

The fix: back-to-home is now included in k.singleLineCommandList.
#@+node:ekr.20100209160132.11694: *6* Fixed bug in c.pasteOutline when run from unit tests
There was code in tnodeAttributes that did something brain-dead when unit
testing, just to support a unit test!
#@+node:ekr.20100209160132.11700: *6* Removed all references to isAtNorefFileNode
#@+node:ekr.20100209160132.11701: *6* Fixed inconsistency in how @path works
@nocolor-node

http://groups.google.com/group/leo-editor/browse_thread/thread/6d87d95ecbc3b986

If a @path directive is within the body text of an @thin node then the
file write uses the @path directive but the file read does not.  Since
the file read cannot know of the @path directive until after it has
read the file it has no choice but to not use it.  The @thin file
write code should not use any @path declarations found in its body
text.

What I did:

- Defined g.app.atPathInBodyWarning, set by g.get_directives_dict to p.h
- g.get_directives_dict also sets d['@path_in_body'] = p.h
- c.scanAtPathDirectives doesn't set the path if d['@path_in_body'] is true.
- atFile.scanAllDirectives issues a warning if g.app.atPathInBodyWarning is true,
  but only if the issuePathWarning keyword arg is true.
#@+node:ekr.20100209160132.11711: *6* Fixed crasher in path.py
@nocolor-node

Traceback (most recent call last):
  File "launchLeo.py", line 8, in <module>
    leo.core.runLeo.run()
  File "c:\leo.repo\trunk\leo\core\runLeo.py", line 95, in run
    ok = doPostPluginsInit(args,fn,relFn,script,versionFlag)
  File "c:\leo.repo\trunk\leo\core\runLeo.py", line 354, in doPostPluginsInit
    c,frame = createFrame(fileName,relativeFileName,script)
  File "c:\leo.repo\trunk\leo\core\runLeo.py", line 383, in createFrame
    ok, frame = g.openWithFileName(relativeFileName or fileName,None)
  File "c:\leo.repo\trunk\leo\core\leoGlobals.py", line 2439, in openWithFileName
    ok = g.handleOpenHooks(c,old_c,gui,fn,f,readAtFileNodesFlag)
  File "c:\leo.repo\trunk\leo\core\leoGlobals.py", line 2502, in handleOpenHooks
    readAtFileNodesFlag=readAtFileNodesFlag) # closes file.
  File "c:\leo.repo\trunk\leo\core\leoFileCommands.py", line 911, in open
    silent=silent)
  File "c:\leo.repo\trunk\leo\core\leoFileCommands.py", line 811, in getLeoFile
    c.atFileCommands.readAll(c.rootVnode(),partialFlag=False)
  File "c:\leo.repo\trunk\leo\core\leoAtFile.py", line 659, in readAll
    at.readOneAtAutoNode (fileName,p)
  File "c:\leo.repo\trunk\leo\core\leoAtFile.py", line 732, in readOneAtAutoNode
    self.writeCachedTree(p, cachefile)
  File "c:\leo.repo\trunk\leo\core\leoAtFile.py", line 593, in writeCachedTree
    elif cachefile in c.db:
  File "c:\leo.repo\trunk\leo\external\pickleshare.py", line 138, in __contains__
    return self.has_key(key)
  File "c:\leo.repo\trunk\leo\external\pickleshare.py", line 234, in has_key
    value = self[key]
  File "c:\leo.repo\trunk\leo\external\pickleshare.py", line 160, in __getitem__
    fil = self.root / key
  File "c:\leo.repo\trunk\leo\external\path.py", line 102, in __div__
    return path(os.path.join(self, rel))
  File "c:\python31\lib\ntpath.py", line 111, in join
    elif isabs(b):
  File "c:\python31\lib\ntpath.py", line 92, in isabs
    s = splitdrive(s)[1]
  File "c:\python31\lib\ntpath.py", line 198, in splitdrive
    if len(p) > 1:
TypeError: object of type 'NoneType' has no len()

c:\leo.repo\trunk>
#@+node:ekr.20100209160132.11712: *6* Fixed at-auto write bug
@nocolor-node

Adding a blank line did not change the file!

The culprit was the ignoreLineEndings logic in compareFiles.
A new unit test is needed.
#@+node:ekr.20100209160132.11718: *6* Fixed the critical 'file used by another process' bug
@nocolor-node

What I did:

- fc.createBackupFile now calls shutils.move directly,
  avoiding g.utils_rename which does way too much:
  it calls g.makeAllNonExistentDirectories(!!)

- Simplified g.utils_rename.  We can assume shutils exists.

- Removed an unwise call to g.utils_remove in g.utils_rename.
  This could cause havoc with the following call to
  shutils_move!!
#@+node:ekr.20100209160132.11736: *6* Alt-right should *not* go down
#@+node:ekr.20100209160132.11742: *6* Big change: simplified g.utils_rename
Removed call to g.makeAllNonExistentDirectories in g.utils_rename.

This has global effects. Happily, there were only three callers of g.utils_rename:

- handleWriteLeoFileException: should *not* create directories.

- x.rename: no longer used!
#@+node:ekr.20100209160132.11751: *6* Fixed cursor hangnail
Non-extending cursor moves now always clear the selection.
#@+node:ekr.20100209160132.11755: *6* Do a full redraw when contracting a cloned node
#@+node:ekr.20100209160132.11756: *6* Bug 399720: (fixed) goto-global-line doesn't work with @edit nodes
The title says it all.

This was likely fixed at rev 2438 of the trunk, in early October, 2009.
#@+node:ekr.20100209160132.11765: *6* Fixed unit test for leo_interface.py
@nocolor-node

The module imported correctly, but leoTest.checkFileSyntax was failing.

It was a whitespace problem--the fix was stripping '\r' characters in checkFileSyntax.
#@+node:ekr.20100209160132.11767: *6* Fixed g.getLastTracebackFileAndLineNubmer
#@+node:ekr.20100209160132.11770: *6* Fixed open-with crash
@nocolor-node

There may have been a bug in the open_with plugin that allowed it to be active
when it shouldn't have been.
#@+node:ekr.20100209160132.11771: *7* Report
@nocolor-node

I am getting an exception when double-clicking to rename a node. The
exception does not occur when I rename a new node immediately
following creation while it is highlighted.

#---#
Leo Log Window
Leo 4.7 beta 3, build 2835, February 2, 2010
Python 3.1.1, qt version 4.6.1
Windows 6, 1, 7600, 2,
reading: C:\Users\skrivsm\Documents\toolbox\scratch\ruby_scratch.leo
creating:   newHeadline_LeoTemp_63898064.py
exception creating temp file
Traceback (most recent call last):
 File "C:\leo-editor\trunk\leo\core\leoCommands.py", line 1164, in
createOpenWithTempFile
   f.write(s)
TypeError: must be str, not bytes
recreating:   newHeadline_LeoTemp_63898064.py
exception creating temp file
Traceback (most recent call last):
 File "C:\leo-editor\trunk\leo\core\leoCommands.py", line 1164, in
createOpenWithTempFile
   f.write(s)
TypeError: must be str, not bytes
#---#
#@+node:ekr.20100209160132.11773: *6* Fixed bug 518823: clone headline updates
https://bugs.launchpad.net/leo-editor/+bug/518823

Clone headline modification not propagated after edit
#@+node:ekr.20100211125418.11596: *6* Removed duplicate can not open message for @auto file
#@+node:ekr.20100211125418.11599: *6* Fixed minor bug involving insertion point
This bug was highly annoying: it caused the newly-selected node to have the
insert point of a just-deleted node. This bug made it difficult, for example, to
delete nodes while examining the nodes created by clone-find-all.
#@+node:ekr.20100211125418.11602: *6* Fixed unicode crasher in write-recent-files logic
#@+node:ekr.20100211125418.11611: *5* New commands
#@+node:ekr.20100209160132.11888: *6* Created clear-cache and clear-all-caches commands
@nocolor-node

Global entries are in g.app.leoHomeDir/db/global

Per-leo-files entries are in g.app.homeLeoDir/db/<filename>_<hash>
#@+node:ekr.20100223063657.7262: *4* 4.7 final
Leo 4.7 final                    February 23, 2010

Leo 4.7 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.7 final fixes all known bugs in Leo.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.7:
--------------------------

- Leo now uses the simplest possible internal data model.
  This is the so-called "one-node" world.
- Leo supports Python 3.x.
- Leo requires Python 2.6 or above.
- Several important improvements in file handling.
    - Leo converts @file nodes to @thin nodes automatically.
    - Leo creates a 'Recovered Nodes' node to hold data that
      otherwise might be lost due to clone conflicts.
    - @auto-rst now works much more reliably reliably.
    - Leo no longer supports @noref trees.  Such trees are not
      reliable in cooperative environments.
- A new Windows installer.
- Many other features, including new command line options and new plugins.
- Dozens of bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20100223063657.7264: *5* Bug fixed
#@+node:ekr.20100223063657.7182: *6* Fixed calls to sort in 6 places
# This fixed a Python 3.x compatibility problem.
#@+node:ekr.20100223063657.7192: *6* Fix bug 363406: goto-global-line works with @auto files
#@+node:ekr.20100223063657.7212: *6* Put focus in a standard place after save commands
The edit pane lost focus after save commands.
#@+node:ekr.20100223063657.7232: *6* Fixed internal Leo error in atFile.read method
fileKey is needed even if force is True.
#@+node:ekr.20100223063657.7238: *6* Fixed wish-list bug 508108: No methods sub-nodes in PHP class import
https://bugs.launchpad.net/leo-editor/+bug/508108
#@+node:ekr.20100223063657.7245: *6* Fixed qt colorizer bug
Default fonts were not being properly restored after being overridden in another language.

For example, after colorizing php, python keywords looked like php keywords.
#@+node:ekr.20100223063657.7246: *6* Fixed ancient minibuffer bug
The bug: Find/change prompts were not fully protected after the user hit the
<home> key.
#@+node:ekr.20100223063657.7249: *6* Improved support for wrapping in the log pane
#@+node:ekr.20100223063657.7263: *6* Reformatted the output of the apropos commands
#@+node:ekr.20100225102026.7139: *4* 4.7.1 final
Leo 4.7.1 final                    February 26, 2010

Leo 4.7.1 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo 4.7.1 fixes a dangerous bug in Leo 4.7. When converting file-like sentinels
to thin-like sentinels in an external file, Leo now issues a warning and sets
the corresponding @file node dirty. This ensures that Leo will write the
converted external file and .leo file together, making it impossible to lose
data.

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.7:
--------------------------

- Leo now uses the simplest possible internal data model.
  This is the so-called "one-node" world.
- Leo supports Python 3.x.
- Leo requires Python 2.6 or above.
- Several important improvements in file handling.
    - Leo converts @file nodes to @thin nodes automatically.
    - Leo creates a 'Recovered Nodes' node to hold data that
      otherwise might be lost due to clone conflicts.
    - @auto-rst now works much more reliably reliably.
    - Leo no longer supports @noref trees.  Such trees are not
      reliable in cooperative environments.
- A new Windows installer.
- Many other features, including new command line options and new plugins.
- Dozens of bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20100225102026.7140: *5* Changes made to Leo 4.7.1
- Fixed a dangerous bug that could cause data loss when converting @file nodes
  from file-like to thin-like sentinels. The problem arose because it was too
  easy to save the .leo file (thus deleting the tnodeList) without forcing the
  converted external files to be saved. The next time Leo attempted to read the
  external files, the tnodeList would be missing and data would be lost.

  Leo's read logic now determines whether the file has file-like sentinels by
  reading the *uncached* contents of the file. When converting file-like
  sentinels to thin-like sentinels, Leo warns that it is converting the file and
  sets the @file node dirty. This ensures that Leo will write the converted
  external file whenever Leo writes the .leo file. This will make it impossible
  for a naive user to lose data. A sophisticated user might cause problems by
  using the write-outline-only command...

- Fixed expand/contract-pane commands.

- Fixed Python 3.x problems in delete-editor and cycle-editor-focus.

- Added a log message for show-colors saying the color picker does not exist for qt.

- Corrected date in trunk/license.txt.
#@+node:ekr.20101104091058.5045: *3* 4.8 Simpler sentinels, better installer, recovery nodes
#@+node:ekr.20101024234254.5433: *4* 4.8 a1
@nocolor

Leo 4.8 alpha 1                    October 29, 2010

Leo 4.8 alpha 1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.8:
--------------------------

- Leo now uses the simplest possible sentinel lines in external files.
  External files with sentinels now look like Emacs org-mode files.
- Leo Qt gui now supports Drag and Drop.
  This was one of the most frequently requested features.
- Improved abbreviation commands.
  You now define abbreviations in Leo settings nodes, not external files.
- @url nodes may contain url's in body text.
  This allows headlines to contain summaries: very useful.
- Leo now uses PyEnchant to check spelling.
- Leo can now open multiple files from the command line.
- Leo's ancient Tangle and Untangle commands are now deprecated.
  This will help newbies how to learn Leo.
- Leo now shows "Resurrected" and "Recovered" nodes.
  These protect data and show how data have changed.
  These fix several long-standing data-related problems.
- A new "screenshots" plugin for creating slide shows with Leo.
  I used this plugin to create Leo's introductory slide shows.
- A better installer.
- Many bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20101114081049.5004: *4* 4.8 b1
@nocolor

Leo 4.8 beta 1                               November 5, 2010

Leo 4.8 beta 1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.8:
--------------------------

- Leo now uses the simplest possible sentinel lines in external files.
  External files with sentinels now look like Emacs org-mode files.
- Leo Qt gui now supports Drag and Drop.
  This was one of the most frequently requested features.
- Improved abbreviation commands.
  You now define abbreviations in Leo settings nodes, not external files.
- @url nodes may contain url's in body text.
  This allows headlines to contain summaries: very useful.
- Leo now uses PyEnchant to check spelling.
- Leo can now open multiple files from the command line.
- Leo's ancient Tangle and Untangle commands are now deprecated.
  This will help newbies how to learn Leo.
- Leo now shows "Resurrected" and "Recovered" nodes.
  These protect data and show how data have changed.
  These fix several long-standing data-related problems.
- A new "screenshots" plugin for creating slide shows with Leo.
  I used this plugin to create Leo's introductory slide shows.
- Improved autocompletion: Ctrl-space starts a one-time completion.
- A better installer.
- Many bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20101104091058.4975: *4* 4.8 rc1
@nocolor

Leo 4.8 rc 1                               November 15, 2010

Leo 4.8 release candidate 1 is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.8:
--------------------------

- Leo now uses the simplest possible sentinel lines in external files.
  External files with sentinels now look like Emacs org-mode files.
- Leo Qt gui now supports Drag and Drop.
  This was one of the most frequently requested features.
- Improved abbreviation commands.
  You now define abbreviations in Leo settings nodes, not external files.
- @url nodes may contain url's in body text.
  This allows headlines to contain summaries: very useful.
- Leo now uses PyEnchant to check spelling.
- Leo can now open multiple files from the command line.
- Leo's ancient Tangle and Untangle commands are now deprecated.
  This will help newbies how to learn Leo.
- Leo now shows "Resurrected" and "Recovered" nodes.
  These protect data and show how data have changed.
  These fix several long-standing data-related problems.
- A new "screenshots" plugin for creating slide shows with Leo.
  I used this plugin to create Leo's introductory slide shows.
- Improved autocompletion: Ctrl-space starts a one-time completion.
- A better installer.
- Many bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20101104091058.4976: *5* Known problems
There are at least 2 installer issues outstanding:

1. Installing to the "Program Files" folder or the "Program Files
(x86)" folder can cause some unit tests to fail due to permission
issues.  I don't think this is too serious.

2. Installing to the "Program Files (x86)" folder can cause PyEnchant
not to find the spellpyx.txt folder.  This looks like a bug in
PyEnchant.
#@+node:ekr.20101104173324.5140: *5* New in 4.8 a1
#@+node:ekr.20101104091058.4977: *6* Bugs
#@+node:ekr.20101104091058.4978: *7* Significant bugs
#@+node:ekr.20101104091058.4979: *8* Fixed vampire nodes and created p.deletePositionsInList
# Also, created a "Resurrected Nodes" node to handle such nodes cleanly and safely.
#@+node:ekr.20101104091058.4980: *9* Post re vampire nodes
@language rest

Vampire nodes from cvs

I've just discovered a major problem with cvs updates.  It is a subtle
consequence of how Leo writes outlines and reads derived files.  This
is a big bug in Leo, not cvs.  The effect of the bug is that nodes can
appear in derived files that were never written to them!

The discovery of this 'big bug' came about as the result of the
following Aha:

**@thin files that contain @all directives should be a cvs binary (-kb) files.**

The reason is straightforward:  cvs doesn't know enough to merge such
files.  Maybe all @thin derived files should be -kb files, but Leo's
users will never agree to that!

Anyway, leoProjects.txt is now a binary file as far as cvs is
concerned.  Other .txt files, like leoScripts.txt, should also be
binary files.  As we shall see, the fact that leoProjects.txt is now a
-kb file means that we can not possibly blame the cvs merge algorithm
for what is about to happen.

Ok, back to the 'big bug'.  Here is how I got bitten:

- I changed leoProjects.txt in two sandboxes 1 and 2.  In sandbox 1 I
added a node called 'changed in the main line'.  In sandbox 2 I added
a node called 'changed2'.

- I changed LeoPyRef.leo in sandbox 2, but *not* in sandbox 1.

- I did a update in sandbox 2.

As expected (now that leoProjects.txt is a binary file) I got the
following from cvs:

M src/LeoPyRef.leo
...
cvs update: nonmergeable file needs merge
cvs update: revision 1.448 from repository is now in src/
leoProjects.txt
cvs update: file from working directory is now in .#leoProjects.txt.
1.447

To summarize the update:

- LeoPyRef.leo has been marked as modified (M), but it has **not**
been changed by cvs.

- As expected, leoProjects.txt contains the version from sandbox **1**.

So far, so good.  But when I opened LeoPyRef.leo I got a huge
surprise: the outline contains **both** the node 'changed in main-
line' and the node 'changed2'!

How did this happen?  Well, obviously the 'changed in main-line' node
came from the cvs update.  I expected that.  The 'changed2' line must
have come from the local copy of LeoPyRef.leo.

Once I knew what to look for it wasn't too hard to discover what had
happened.  The 'changed2' is a descendant of a cloned node called '4.4
projects'.

- One clone of '4.4 projects' node is a descendant of the @thin
leoProjects.txt node.

- Another clone of the '4.4 project' is in the LeoPyRef.leo file but
outside of any @thin node.

So the 'resurrection' of the 'changed2' node happened while Leo was
reading leoProjects.txt into LeoPyRef.leo.  The '4.4 projects' node
**already existed in the outline** before Leo read leoProjects.txt,
and the present atFile read logic only **adds** nodes, it never
deletes nodes.  Thus, the 'changed2' node 'survived' the atFile read
logic.  The 'changed2' node became a 'vampire' node that couldn't be
killed.

The problem is far from benign.  Because of clones, the vampire node
became an orphan node in **another** file, namely leoKeys.py.  I tried
two or three times to remove the vampire/orphan node before realizing
what had happened.

The fix (there is *always* a fix) will require some care.  The present
atFile.read logic is robust because it *doesn't* delete nodes.  It is
essential that the read logic remain robust.  I suspect the solutions
will be as follows:

A. The atFile.read code can not delete the subtree of @thin nodes
initially, because it doesn't know whether there will be read errors
later.  If there are read errors absolutely nothing must change.  This
ensures that read errors never destroy information.

B. A new post-pass will look for vampire nodes: nodes that were not
actually read from the derived file.  I think (but haven't proven)
that all descendants of vampire nodes are also vampire nodes.  If that
is so the post-pass will simply delete vampire nodes without worrying
about whether they have descendants.

Warning: the new scheme will mean that cvs update can destroy
information that previously existed in the outline.  I believe this is
correct: we assume that derived files are the 'truly meaningful'
files.  Hey, if we are wrong we can always get the old info from
cvs :-)
QQQ

At present, atFile.read contains code to warn of "resurrected" nodes,
and I did indeed get such a warning when the recent problem arose.

After a quick look at atFile.read, I strongly suspect that the problem
remains today pretty much exactly as it was in 2003.  The only
difference is that the caching code (the call to
root.v.createOutlineFromCacheList(c,aList)) doesn't do the check:
\<\< advise user to delete all unvisited nodes \>\>
that is done later in read(). That probably should be fixed.

Finding a better solution to vampire nodes has been on the list since
2003.  It's not easy because it involves the dreaded "multiple delete"
problem.

Hmm.  The present read code *does* delete the tree before reading thin
external files.  So it appears that vampire nodes could only be
expected in external files derived from @file nodes.  It may be that
part of the problem is that somehow Leo thinks that it is reading an
@file node?? That's pretty weird, but messages about resurrected nodes
and missing tnode lists did happen.  It's quite a puzzle.

Edward
#@+node:ekr.20101104091058.4981: *8* Fixed bug 577047: Invalid @path directory does not warn user
Specifying a @path directory causes Leo to save an "@thin file.ext" node below
it in Leo's home directory without any warning. The next time Leo is opened it
issues an error that it can not find the file.

It should instead issue a warning that the @path directory does not exist.

If this occurs when the saving of @thin nodes to files is performed as part of
the user closing Leo, the closing of Leo should be aborted to prevent the loss
of data.

===== The Aha

The computation of at./ic.default_directory **must not** attempt to create
directories! It's too early for that!

This simplifies all aspects of the code:

- No need to report errors & no need to recover from errors.
- at.scanAllDirectives can call c.

===== The actual fix:

Due to a previous fix, at.writeAllAtFileNodesHelper does *not* report errors.
This causes Leo to clear all dirty bits.

The proper fix, therefore, is to force a write of the entire @edit tree in
putVnode if it is orphaned.

Similarly, putVnode now forces writes of @auto and @shadow trees.

#@+node:ekr.20101104091058.4986: *8* Fixed @shadow problem
http://groups.google.com/group/leo-editor/browse_thread/thread/dbe098206376ec8d

The fixes are marked # 2010/10/22 in << handle the opcode >>.
#@+node:ekr.20101104173324.4924: *8* Don't write tnodes of @file nodes!
putVnode must test for @file just like @thin.
#@+node:ekr.20101104091058.4988: *7* Minor bugs
#@+node:ekr.20101104091058.4989: *8* Fixed the @test logic for external files
#@+node:ekr.20101104091058.4990: *8* Fixed save scrolling bug
- Open a node with long (multi-page) body text
- Move cursor towards the end of the node
- Save (ctrl+s)
- Observe how window is scrolled, cursor is moved
#@+node:ekr.20101104091058.4991: *8* Fixed at-auto-rst crash
#@+node:ekr.20101104091058.4992: *8* Don't put &nbsp; in redirected log
https://bugs.launchpad.net/leo-editor/+bug/549319

Leo 4.7.1 final, build 3005, February 26, 2010
Python 2.6.2, qt version 4.5.2
Windows 5, 1, 2600, 2, Service Pack 3

When redirecting the output to the Log pane using g.redirectStderr() and
g.redirectStdout(), the output displays non-breaking space characters (&nbsp;)
everywhere there is supposed to be a space.

For example, if I run print 'Hello World' I get Hello&nbsp;World in the Log
pane. This is really hard to read when you have 50 or 100 lines of numbers from
the output of a program.
#@+node:ekr.20101104091058.4993: *8* Fixed crash in log pane
Traceback (most recent call last):
  File "c:\leo.repo\trunk\leo\core\leoCommands.py", line 366, in doCommand
    val = command(event)
  File "c:\leo.repo\trunk\leo\core\leoKeys.py", line 284, in autoComplete
    k.masterCommand(event,func=None,stroke=None,commandName=None)
  File "c:\leo.repo\trunk\leo\core\leoKeys.py", line 2606, in masterCommand
    val = k.handleDefaultChar(event,stroke)
  File "c:\leo.repo\trunk\leo\core\leoKeys.py", line 2664, in handleDefaultChar
    if stroke.lower() == 'return': stroke = '\n'
AttributeError: 'NoneType' object has no attribute 'lower'
#@+node:ekr.20101104091058.4994: *8* Fixed at-auto-rst bug
#@+node:ekr.20101104091058.4995: *8* Fixed erroneous error message in at-auto-rst read logic
#@+node:ekr.20101104091058.4996: *8* Fixed crasher in openFileForReading
#@+node:ekr.20101104091058.4997: *8* Fixed Java import problem
On Windows, using Leo trunk from a few days ago, I get "error: class
class does not end in a newline; one will be added [nl]" on what seems
to be every imported java chunk.

This issue seems to be line-ending related and I duplicated it with a
simple test.  When I run the following code from within a Leo node, I
get the same error as when I tried to import the file.
#@+node:ekr.20101104091058.4999: *8* Fixed gloto-global-line
#@+node:ekr.20101104091058.5000: *8* Fixed rst3 bug with docutils on py3k
#@+node:ekr.20101104091058.5001: *8* fixed bug 618474: show_leo_directives
https://bugs.launchpad.net/leo-editor/+bug/618474

in core/leoRst the method removeLeoDirectives seems not to remove the leo directives.
which results in @leo directives inside generated rst code.

The problematic code line is the statement "g.match_word(s, 0,key)" in the following block:

                for key in self.leoDirectivesList:
                    if g.match_word(s, 0,key):
                        #g.trace('removing %s' % s)
                        break

As far as I understand the function match_word, it returns 1 if s contains key at index 0,
The self.leoDirectivesList contains all directive like color, language, ... (without @) but
s is a complete body line that looks like:
@language rest

That means language starts at index 1 not at 0.
changing the line to
  g.match_word(s, 1,key)

let it work correctly in my installation (4.7.1)
#@+node:ekr.20101104091058.5002: *8* fixed bug 618482: code-mode line feeds
https://bugs.launchpad.net/leo-editor/+bug/618482

in leoRst.py:

the method "handleCodeMode" does not preserve line linefeeds of the original code. While this is only annoying for code
parts it is fatal for doc parts, because rst directives does not work anymore.

The problem is in the line "elif not z.rstrip(): pass" of the following code block at the end of the method
        for z in result:
            if z == '': result2.append('\n\n')
            elif not z.rstrip(): pass
            elif z.endswith('\n\n'): result2.append(z) # Leave alone.
            else: result2.append('%s\n' % z.rstrip())

Commenting this line out, preserves the linefeeds in the doc part but doubles them in the code part.

The method "rstripList" is responsible for the doubling linefeeds:
   The lines arguments is a list of lines with (!) trailing linefeeds (\n),

   The statement s = '\n'.join(theList).rstrip() doubles therefore the linefeeds
    replacing the line with s = ''.join(theList).rstrip() works.
#@+node:ekr.20101104091058.5003: *8* Fixed weave (and many similar) commands
#@+node:ekr.20101104091058.5004: *8* Shorter warnings about incompatible gui type
#@+node:ekr.20101104091058.5005: *8* Improved @enabled-plugins: ignore lines starting with '@'
Also give calmer messages for non-existent plugins.
#@+node:ekr.20101104091058.5006: *8* Fixed bug in runUnitTestLeoFile
Replace ';' by os.pathsep.
#@+node:ekr.20101104091058.5007: *8* Fixed crasher with del in minibuffer
Changed w to self in leoQLineEditWidget.setInsertPoint.
#@+node:ekr.20101104091058.5008: *8* Ignore F-Keys & Ins in the minibuffer.
k.fullCommand now ignores fkeys and Ins.
#@+node:ekr.20101104091058.5009: *8* Fixed bug 618570: leoRst: option strip_at_file_prefixes...
leoRst: option strip_at_file_prefixes does not strip file prefixes in leo 4.7.1

The problematic code is in method underline of class rstCommands.
The last statement:

  return '%s\n%s\n\n' % (p.h.strip(),ch*n)

returns the full heading and not stripped one, (in the s parameter)
#@+node:ekr.20101104091058.5010: *8* Fixed bug 622802: Go to clone" switches to the first chapter
If one or more chapters exist (other than main), "Go to clone" switches to the
first chapter, whether or not the clone is in that chapter.

The new code always selects the main chapter.
This is the simplest thing that could possibly work.
Other approaches are fraught with difficulties.
#@+node:ekr.20101104091058.5011: *8* Fixed unicode bug in files
I created a file time.leo. When it's in the dir d:/Dmitry it's being
opened fine. But when I put it into the dir with Russian characters:
D:/Личное/Время leo prints squares at the window header and doesn't
open the file correctly. This problem existed in one of the revisions,
then it was fixed in the last official release. Now it emerged again
in my Leo 4.8 devel, build 3005

Traceback (most recent call last):
  File "c:\leo.repo\trunk\leo\core\leoGlobals.py", line 3307, in pr
    sys.stdout.write(s2)
  File "c:\python31\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]

UnicodeEncodeError: 'charmap' codec can't encode character '\xc2' in position
31: character maps to <undefined> path changed for @thin
Unicode-Â-folder/unicode-Â-test2.txt created:
C:\Users\edreamleo\Unicode-Â-folder\unicode-Â-test2.txt
#@+node:ekr.20101104091058.5012: *8* Eliminated check python syntax commands, but retained code
@nocolor-node

Removed the check-all-python-code and check-python code commands
(and removed the references to these commands in menus.)

- Retained the actual code for scripts.
- Retained automatic syntax checking of python files on saves

The problem with separate commands is that they don't necessarily check an
entire file: things like 'return' in a node that doesn't look it is in a
function.

Directives and section references are not the problem:
they get translated to comments before the check.
#@+node:ekr.20101104091058.5013: *8* Improved handling of history
nav_qt.py just uses these:

    c.goPrevVisitedNode()
    c.goNextVisitedNode()

and these subsequently use leoCommand.py / class nodeHistory.

The fix would have to happen in leoFrame.py / selectHelper() which does this:

    c.nodeHistory.update(p) # Remember this position.

It shouldn't call update() there. Rather, the call should be moved to
wherever body focus code is.

The fix was to leoTree.selectHelper and qtBody.onFocusIn.

#@+node:ekr.20101104091058.5014: *8* Remember whether @asis/@nosent existed at read time
Removed all traces of the "significant change" logic. The read code remembers
whether a node existed when Leo loaded the outline.

Leo will warn when writing a node that didn't previously exist. This is a nice
simplification of the code.
#@+node:ekr.20101104091058.5015: *8* Added g.app.config.config_iter
This simplifies the print-settings command.
#@+node:ekr.20101104091058.5016: *6* Code features
#@+node:ekr.20101104091058.5017: *7* Added g.findTestScript
http://groups.google.com/group/leo-editor/browse_thread/thread/a108d70400b28dc9#

g.findTestScript is an important new pattern for sharing code in Leo scripts,
including scripts in @test nodes.

Suppose there is common code that I want to include in several unit tests::

    class Hello():
        def __init__(self,name='john'):
            self.name=name
            print('hello %s' % name)

I put this in a node called 'Common test code'.

The unit tests can "import" the code as follows::

    exec(g.findTestScript('Common test code'))

Now class Hello is available the test code!

This is something that I've wanted to do forever.  It's almost too
easy.  I suppose it's a small security problem, but so is every other
@test node!
#@+node:ekr.20101104091058.5018: *7* Added p.deletePositionsInList
http://groups.google.com/group/leo-editor/browse_thread/thread/e3c736bc9f545b7e#

This is an important new helper.
#@+node:ekr.20101104173324.4920: *7* Leo is more clever in putting up the Leo id dialog
g.app.setLeoID now calls createDefaultGui instead of createTkGui.

We can *not* put up the LeoID dialog later: it is needed to set
g.app.nodeIndices, which is used in the read logic for outlines, so it *must* be
set before we load any Leo file!

#@+node:ekr.20101104173324.4921: *7* Simplified leoPlugins code
There are some tricky issues here:

http://groups.google.com/group/leo-editor/browse_thread/thread/4da36f0d897a25e8

Important: g.loadOnePlugin calls the plugins onCreate method to make up for
events that have already been generated. pc.loadOnePlugin does not.
#@+node:ekr.20101104173324.4923: *7* Patched @test logic
# Begin patch

=== modified file 'leo/core/leoTest.py'
@@ -697,9 +696,10 @@

     # 2010/03/05: set the current directory so that importing leo.core.whatever works.
     leoDir = g.os_path_finalize_join(g.app.loadDir,'..','..')
-    os.chdir(leoDir)
-
-    os.spawnve(os.P_NOWAIT,sys.executable,args,os.environ)

+    #os.chdir(leoDir)
+    env = dict(os.environ)
+    env['PYTHONPATH'] = env.get('PYTHONPATH', '')+';'+leoDir
+    os.spawnve(os.P_NOWAIT,sys.executable,args,env)
#@+node:ekr.20101104091058.5019: *6* Commands
#@+node:ekr.20101104091058.5020: *7* Added legend for print-settings command
#@+node:ekr.20101104091058.5021: *7* Added code-to-rst command
# And deprecated code mode.
#@+node:ekr.20101104091058.5022: *7* Removed mark-clones command
It is useless in the one-node world.
#@+node:ekr.20101104091058.5023: *7* Improved abbreviation commands
http://groups.google.com/group/leo-editor/browse_thread/thread/24cb88a8c2a20a07#

- Space activates abbreviations.
- Multi-line abbreviations handled properly.
- add-global-abbrev command uses entire selected text as the value of the abbreviation.
- Inserted abbreviations are undoable.
- Added support for @data abbreviations and @data global-abbreviations.
- Added support for @bool enable-abbreviations.

apropos-abbreviations
=====================

When abbreviation mode is on (abbrev-mode toggles this mode) Leo will expand
abbreviations as you type. Type the name of an abbreviation, followed by a
space. As soon as you type the space, Leo will replace the name by the
abbreviations value. You can undo the replacement as usual.

Note that defining any abbreviation automatically turns on abbreviation mode.

The add-global-abbreviation command (<alt-x>add-gl<tab><return>) takes the
selected text as the replacement value of the abbreviation. The minibuffer
prompts you for the name of the abbreviation.
#@+node:ekr.20101104091058.5150: *7* Completed cascade-windows and minimize-all-windows commands
#@+node:ekr.20101104091058.5252: *7* Created head-to-prev-node and tail-to-next-node commands
@nocolor-node

https://bugs.launchpad.net/leo-editor/+bug/611413

These work around the lack of AI in Python's importer.

Added leoImport.findClass helper.

The head-to-prev-node command moves non-empty text preceding a class, method or
function definition to the end of the previous sibling node.

The tail-to-next-node command moves non-empty text following a class, method or
function definition to the start of the next sibling node.
#@+node:ekr.20101104091058.5024: *6* Documentation
#@+node:ekr.20101104091058.5025: *7* Created introductory slide shows
#@+node:ekr.20101104091058.5026: *7* Reorganized Users Guide
http://groups.google.com/group/leo-editor/browse_thread/thread/d02df89c0b831a7c

I created my own copy of the home page:

    Files-->@edit leo_toc.html

This allows me to group items without creating special pages.
#@+node:ekr.20101104091058.5027: *6* Features
#@+node:ekr.20101104091058.5028: *7* New sentinels
#@+node:ekr.20101104091058.5029: *7* Don't create @chapter node for new file
I think @chapters node shouldn't be in a new leo file, but it should
be created when the first chapter is created.

Ditto for the chapter selector toolbar button.
#@+node:ekr.20101104091058.5030: *7* Improved install instructions & logic
http://groups.google.com/group/leo-editor/browse_thread/thread/a5a47afa65af9a37

The following changes are on the trunk, and also on Leo's web site:

- In home page, added link to Install page, just above the Beginner's Guide.

- Added more explicit instructions for installing Tk and Qt.

- In step 6 of the Windows install steps, the "assoc .leo=LeoFile"
  is on a line by itself.

- Updated home page to indicate that Leo requires Python and PyQt.
  I also revised and simplified the introduction in other ways.
  Ditto for description of Leo on SourceForge.

- Changed "%1" to "%*" throughout the installation instructions.

- Made batch files given in Installing Leo and Running Leo the same.

- The dialogs that ask for the Leo ID now tells why Leo needs it.

- Just before raising the dialog that asks for the Leo ID, Leo attempts
  to create the Qt Gui first, and then the Tk Gui if Qt does not exist.
  This should make it much less likely that a prompt for the id
  will be sent to the console.


2. The readme.txt file for 4.7.1-final does not mention that Python and PyQt is
   required.

readme.txt does say it has a new Windows installer. This
led me to believe -- erroneously -- that the Windows installer is all
I would need to download and install, since it's typical for most open
source programs I've used to have everything needed for the install
(for example. .NET) in the single Windows download.

2b. And perhaps the readme.txt file as well?

Can the [install] page be updated to make this clearer?

4. When I first went to the Install page, I clicked on the link for
"Installing Leo on Windows", got to the end of the steps and saw the
next section was "Tracking the development version" which I wasn't
interested in doing so I didn't read any further.

Clicking on the installer-created Windows link for Leo on the Start
Menu did nothing. Eventually I found the Windows section under
"Running Leo" and learned it was required to run Leo the first time
from a console window and not by launching it from Windows.
#@+node:ekr.20101104091058.5031: *7* DnD outline nodes
DnD creates @file or @auto nodes if appropriate
#@+node:ekr.20101104091058.5032: *7* write @edit nodes like @nosent nodes
#@+node:ekr.20101104091058.5033: *7* Leo now uses PyEnchant to check spelling
http://groups.google.com/group/leo-editor/browse_thread/thread/62ac1977b3704590#

#@+node:ekr.20101104091058.5034: *7* Improved @url nodes
Having to type the url after @url in headline is annoying.

The @url handler should look into the first line of body for url, if the text in
the headline is not an url. This way, the headline could actually be
descriptive.

I know some plugin does this, but there is no reason why this couldn't be the
default behavior.
#@+node:ekr.20101104091058.5035: *7* Made sure that all @auto nodes end with a newline
The fix was to the "if not trailingNewlineFlag:" code at the end of at.putBody.
#@+node:ekr.20101104091058.5036: *7* Improved language support
- improved support for elisp.

    - Use @language lisp instead of @language elisp.

- added importer for .ini files.
#@+node:ekr.20101104091058.5037: *6* Settings
#@+node:ekr.20101104091058.5038: *7* Allow multiple files on the command line
Refactored g.app.config.readSettingsFiles.

Settings now honored in workbook.

* Window size not honored when opened from menu.
#@+node:ekr.20101104091058.5039: *7* Allow proportional fonts in plain text
http://groups.google.com/group/leo-editor/browse_thread/thread/e6075a699909db53

You can now set a proportional font to use in all "@language plain" nodes

Specify fonts in @font nodes:

@font plain null font

plain_null_font_family = Times New Roman
plain_null_font_size = 16
plain_null_font_slant = roman
plain_null_font_weight = bold

That is, the actual font specs are in the body text.  Everything
except @font is ignored in the headline.

Specify colors in @color nodes:

@color plain null color = black
#@+node:ekr.20101104091058.5040: *7* Allow changing minibuffer colors
Added the following options with the indicated defaults.

\@color minibuffer_background_color = lightblue
\@color minibuffer_warning_color = lightgrey
#@+node:ekr.20101104091058.5041: *7* Added support for @string qt-toolbar-location
Valid values are top,bottom,left,right
#@+node:ekr.20101104091058.5042: *7* Support @bool write_expansion_bits_in_leo_files
#@+node:ekr.20101104091058.5043: *7* Added support for slideshow plugin
Command-line args
#@+node:ekr.20101104091058.5044: *7* New settings for abbreviations
@bool enable-abbreviations (default: False)

  When true, enables substitution of abbreviations.

@data global-abbreviations
@data abbreviations

  In both cases, body text contains lines of
  the form::

   name=value

  name is the abbreviation name, value is the substituted text. Whitespace is
  ignore around the name, but is significant in the value. Abbreviation names
  may contain only alphabetic characters, but may start with the '@' sign.

  By *convention* @data global-abbreviations setting should be defined in
  myLeoSettings.leo, while @data abbreviations should be defined in other .leo
  files. Regardless of where they are defined, abbreviations in @data
  abbreviation nodes will override settings (with the same name) in @data
  global-abbreviations nodes.
#@+node:ekr.20101104173324.5021: *5* New in 4.8 b1
#@+node:ekr.20101104173324.5142: *6* Bugs
#@+node:ekr.20101104173324.5023: *7* Fixed bug 603720: @auto parsing error on dedented triple quote string
The code that calculates the end of a block of indented Python code now takes
take more care with backslashes.
#@+node:ekr.20101104173324.5028: *7* Fixed bug 597757: c.frame.body.getSelectedText() doesn't work in added editors
#@+node:ekr.20101104173324.5102: *7* Fixed bug 604115: chapter-{clone,copy}-node-to broken
- Added better prompts for move/copy/clone commands.

- Undo/redo of these commands select the main chapter.
#@+node:ekr.20101104173324.5138: *7* Made sure proper install.txt appears
@nocolor-node

http://groups.google.com/group/leo-editor/browse_thread/thread/dea95cd8ab976cac


> > * The file 'INSTALL.TXT' contains the outline text with sentinels from
> > 'Chapter 1: Installing Leo'

There are *two* files called install.txt: the one that should
contain installation instructions and the one that contains the
"Installing Leo" chapter.

The solution was to change install.txt to installing.txt in the users guide.
#@+node:ekr.20101104173324.5031: *6* Completed cascade-windows and minimize-all-windows commands
#@+node:ekr.20101104173324.5032: *6* Improved present autocompleter
Allow "always on" operation:

- Ctrl-space is now bound to force-auto-completion

- Remove Alt-1 and Alt-2 default bindings.
#@+node:ekr.20101104173324.5133: *6* Created head-to-prev-node and tail-to-next-node commands
http://bugs.launchpad.net/leo-editor/+bug/611413

These work around the lack of AI in Python's importer.

The head-to-prev-node command moves non-empty text preceding a class, method or
function definition to the end of the previous sibling node.

The tail-to-next-node command moves non-empty text following a class, method or
function definition to the start of the next sibling node.
#@+node:ekr.20101105082829.4917: *6* Put non-def code in their own node
Fixed wishlist bug 670744: add a setting to put inter-def code in its own node

Added support for @bool at_auto_separate_non_def_nodes option.
The default (legacy mode) is False.
#@+node:ekr.20101114081049.5090: *5* New in 4.8 rc1
#@+node:ekr.20101114081049.5101: *6* Revised many plugins
@nocolor-node

Removed the keybindings.py plugin.  The print-bindings command should suffice.

The plugins_menu.py has been renamed old_plugin_menu.py to indicate that it
needs a lot of work to become functional.

The following plugins are now gui-independent (the used to be Tk only):

at_produce.py
chapter_hoist.py
import_cisco_config.py
macros.py
mod_read_dir_outline.py
multifile.py
read_only_nodes.py
word_count.py
xsltWithNodes.py

I also registered the menu2 event instead of the open2 event in all plugins that
use this event to create menus. This is required because a relatively recent
change creates menus *after* the open2 event happens.
#@+node:ekr.20101114081049.5102: *6* Fixed crasher in UNL.py: recursiveUNLSearch
#@+node:ekr.20101114081049.5103: *6* Big improvement to execute-script command
execute-script now calls execfile (or its equivalent when using Python 3k)
when @bool write_script_file = True.

This allows pdb to show the text of scripts!
#@+node:ekr.20101114081049.5108: *6* Added extract-python-method command
This should have been done *ages* ago. The command makes it easy to put python
methods in separate nodes.

Select a range of text, the first line of which starts with 'def foo (...)'

Do alt-x extract-python-method (or ctrl-p if you are repeating the command).

What happens:

- Creates a new child node whose headline is 'foo'.

- The body of foo contains all the selected text, properly indented.

The command is undoable.
#@+node:ekr.20101115085632.4928: *6* Open the default leo file if possible
Leo opens the file specified by the default_leo_file setting if it exists.

New in 4.8 rc1: if default (workbook) file does not exist Leo will
open an empty file and name is to be the default file.
#@+node:ekr.20101115085632.4930: *6* Fixed problems with installer
The installer now makes proper entries in the Windows start menu.
#@+node:ekr.20101124102457.5135: *4* 4.8 final
@nocolor

Leo 4.8 final                               November 26, 2010

Leo 4.8 final is now available at:
http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Leo is a text editor, data organizer, project manager and much more. See:
http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.8:
--------------------------

- Leo now uses the simplest possible sentinel lines in external files.
  External files with sentinels now look like Emacs org-mode files.
- Leo Qt gui now supports Drag and Drop.
  This was one of the most frequently requested features.
- Improved abbreviation commands.
  You now define abbreviations in Leo settings nodes, not external files.
- @url nodes may contain url's in body text.
  This allows headlines to contain summaries: very useful.
- Leo now uses PyEnchant to check spelling.
- Leo can now open multiple files from the command line.
- Leo's ancient Tangle and Untangle commands are now deprecated.
  This will help newbies how to learn Leo.
- Leo now shows "Resurrected" and "Recovered" nodes.
  These protect data and show how data have changed.
  These fix several long-standing data-related problems.
- A new "screenshots" plugin for creating slide shows with Leo.
  I used this plugin to create Leo's introductory slide shows.
- Improved autocompletion: Ctrl-space starts a one-time completion.
- A better installer.
- Many bug fixes.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/project/showfiles.php?group_id=3458
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20101124102457.5136: *5* Known problems
There are at least 2 installer issues outstanding:

1. Installing to the "Program Files" folder or the "Program Files
(x86)" folder can cause some unit tests to fail due to permission
issues.  I don't think this is too serious.

2. Installing to the "Program Files (x86)" folder can cause PyEnchant
not to find the spellpyx.txt folder.  This looks like a bug in
PyEnchant.
#@+node:ekr.20101124102457.5137: *5* New in 4.8 a1
#@+node:ekr.20101124102457.5138: *6* Bugs
#@+node:ekr.20101124102457.5139: *7* Significant bugs
#@+node:ekr.20101124102457.5140: *8* Fixed vampire nodes and created p.deletePositionsInList
# Also, created a "Resurrected Nodes" node to handle such nodes cleanly and safely.
#@+node:ekr.20101124102457.5141: *9* Post re vampire nodes
@language rest

Vampire nodes from cvs

I've just discovered a major problem with cvs updates.  It is a subtle
consequence of how Leo writes outlines and reads derived files.  This
is a big bug in Leo, not cvs.  The effect of the bug is that nodes can
appear in derived files that were never written to them!

The discovery of this 'big bug' came about as the result of the
following Aha:

**@thin files that contain @all directives should be a cvs binary (-kb) files.**

The reason is straightforward:  cvs doesn't know enough to merge such
files.  Maybe all @thin derived files should be -kb files, but Leo's
users will never agree to that!

Anyway, leoProjects.txt is now a binary file as far as cvs is
concerned.  Other .txt files, like leoScripts.txt, should also be
binary files.  As we shall see, the fact that leoProjects.txt is now a
-kb file means that we can not possibly blame the cvs merge algorithm
for what is about to happen.

Ok, back to the 'big bug'.  Here is how I got bitten:

- I changed leoProjects.txt in two sandboxes 1 and 2.  In sandbox 1 I
added a node called 'changed in the main line'.  In sandbox 2 I added
a node called 'changed2'.

- I changed LeoPyRef.leo in sandbox 2, but *not* in sandbox 1.

- I did a update in sandbox 2.

As expected (now that leoProjects.txt is a binary file) I got the
following from cvs:

M src/LeoPyRef.leo
...
cvs update: nonmergeable file needs merge
cvs update: revision 1.448 from repository is now in src/
leoProjects.txt
cvs update: file from working directory is now in .#leoProjects.txt.
1.447

To summarize the update:

- LeoPyRef.leo has been marked as modified (M), but it has **not**
been changed by cvs.

- As expected, leoProjects.txt contains the version from sandbox **1**.

So far, so good.  But when I opened LeoPyRef.leo I got a huge
surprise: the outline contains **both** the node 'changed in main-
line' and the node 'changed2'!

How did this happen?  Well, obviously the 'changed in main-line' node
came from the cvs update.  I expected that.  The 'changed2' line must
have come from the local copy of LeoPyRef.leo.

Once I knew what to look for it wasn't too hard to discover what had
happened.  The 'changed2' is a descendant of a cloned node called '4.4
projects'.

- One clone of '4.4 projects' node is a descendant of the @thin
leoProjects.txt node.

- Another clone of the '4.4 project' is in the LeoPyRef.leo file but
outside of any @thin node.

So the 'resurrection' of the 'changed2' node happened while Leo was
reading leoProjects.txt into LeoPyRef.leo.  The '4.4 projects' node
**already existed in the outline** before Leo read leoProjects.txt,
and the present atFile read logic only **adds** nodes, it never
deletes nodes.  Thus, the 'changed2' node 'survived' the atFile read
logic.  The 'changed2' node became a 'vampire' node that couldn't be
killed.

The problem is far from benign.  Because of clones, the vampire node
became an orphan node in **another** file, namely leoKeys.py.  I tried
two or three times to remove the vampire/orphan node before realizing
what had happened.

The fix (there is *always* a fix) will require some care.  The present
atFile.read logic is robust because it *doesn't* delete nodes.  It is
essential that the read logic remain robust.  I suspect the solutions
will be as follows:

A. The atFile.read code can not delete the subtree of @thin nodes
initially, because it doesn't know whether there will be read errors
later.  If there are read errors absolutely nothing must change.  This
ensures that read errors never destroy information.

B. A new post-pass will look for vampire nodes: nodes that were not
actually read from the derived file.  I think (but haven't proven)
that all descendants of vampire nodes are also vampire nodes.  If that
is so the post-pass will simply delete vampire nodes without worrying
about whether they have descendants.

Warning: the new scheme will mean that cvs update can destroy
information that previously existed in the outline.  I believe this is
correct: we assume that derived files are the 'truly meaningful'
files.  Hey, if we are wrong we can always get the old info from
cvs :-)
QQQ

At present, atFile.read contains code to warn of "resurrected" nodes,
and I did indeed get such a warning when the recent problem arose.

After a quick look at atFile.read, I strongly suspect that the problem
remains today pretty much exactly as it was in 2003.  The only
difference is that the caching code (the call to
root.v.createOutlineFromCacheList(c,aList)) doesn't do the check:
\<\< advise user to delete all unvisited nodes \>\>
that is done later in read(). That probably should be fixed.

Finding a better solution to vampire nodes has been on the list since
2003.  It's not easy because it involves the dreaded "multiple delete"
problem.

Hmm.  The present read code *does* delete the tree before reading thin
external files.  So it appears that vampire nodes could only be
expected in external files derived from @file nodes.  It may be that
part of the problem is that somehow Leo thinks that it is reading an
@file node?? That's pretty weird, but messages about resurrected nodes
and missing tnode lists did happen.  It's quite a puzzle.

Edward
#@+node:ekr.20101124102457.5142: *8* Fixed bug 577047: Invalid @path directory does not warn user
Specifying a @path directory causes Leo to save an "@thin file.ext" node below
it in Leo's home directory without any warning. The next time Leo is opened it
issues an error that it can not find the file.

It should instead issue a warning that the @path directory does not exist.

If this occurs when the saving of @thin nodes to files is performed as part of
the user closing Leo, the closing of Leo should be aborted to prevent the loss
of data.

===== The Aha

The computation of at./ic.default_directory **must not** attempt to create
directories! It's too early for that!

This simplifies all aspects of the code:

- No need to report errors & no need to recover from errors.
- at.scanAllDirectives can call c.

===== The actual fix:

Due to a previous fix, at.writeAllAtFileNodesHelper does *not* report errors.
This causes Leo to clear all dirty bits.

The proper fix, therefore, is to force a write of the entire @edit tree in
putVnode if it is orphaned.

Similarly, putVnode now forces writes of @auto and @shadow trees.

#@+node:ekr.20101124102457.5143: *8* Fixed @shadow problem
http://groups.google.com/group/leo-editor/browse_thread/thread/dbe098206376ec8d

The fixes are marked # 2010/10/22 in << handle the opcode >>.
#@+node:ekr.20101124102457.5144: *8* Don't write tnodes of @file nodes!
putVnode must test for @file just like @thin.
#@+node:ekr.20101124102457.5145: *7* Minor bugs
#@+node:ekr.20101124102457.5146: *8* Fixed the @test logic for external files
#@+node:ekr.20101124102457.5147: *8* Fixed save scrolling bug
- Open a node with long (multi-page) body text
- Move cursor towards the end of the node
- Save (ctrl+s)
- Observe how window is scrolled, cursor is moved
#@+node:ekr.20101124102457.5148: *8* Fixed at-auto-rst crash
#@+node:ekr.20101124102457.5149: *8* Don't put &nbsp; in redirected log
https://bugs.launchpad.net/leo-editor/+bug/549319

Leo 4.7.1 final, build 3005, February 26, 2010
Python 2.6.2, qt version 4.5.2
Windows 5, 1, 2600, 2, Service Pack 3

When redirecting the output to the Log pane using g.redirectStderr() and
g.redirectStdout(), the output displays non-breaking space characters (&nbsp;)
everywhere there is supposed to be a space.

For example, if I run print 'Hello World' I get Hello&nbsp;World in the Log
pane. This is really hard to read when you have 50 or 100 lines of numbers from
the output of a program.
#@+node:ekr.20101124102457.5150: *8* Fixed crash in log pane
Traceback (most recent call last):
  File "c:\leo.repo\trunk\leo\core\leoCommands.py", line 366, in doCommand
    val = command(event)
  File "c:\leo.repo\trunk\leo\core\leoKeys.py", line 284, in autoComplete
    k.masterCommand(event,func=None,stroke=None,commandName=None)
  File "c:\leo.repo\trunk\leo\core\leoKeys.py", line 2606, in masterCommand
    val = k.handleDefaultChar(event,stroke)
  File "c:\leo.repo\trunk\leo\core\leoKeys.py", line 2664, in handleDefaultChar
    if stroke.lower() == 'return': stroke = '\n'
AttributeError: 'NoneType' object has no attribute 'lower'
#@+node:ekr.20101124102457.5151: *8* Fixed at-auto-rst bug
#@+node:ekr.20101124102457.5152: *8* Fixed erroneous error message in at-auto-rst read logic
#@+node:ekr.20101124102457.5153: *8* Fixed crasher in openFileForReading
#@+node:ekr.20101124102457.5154: *8* Fixed Java import problem
On Windows, using Leo trunk from a few days ago, I get "error: class
class does not end in a newline; one will be added [nl]" on what seems
to be every imported java chunk.

This issue seems to be line-ending related and I duplicated it with a
simple test.  When I run the following code from within a Leo node, I
get the same error as when I tried to import the file.
#@+node:ekr.20101124102457.5155: *8* Fixed gloto-global-line
#@+node:ekr.20101124102457.5156: *8* Fixed rst3 bug with docutils on py3k
#@+node:ekr.20101124102457.5157: *8* fixed bug 618474: show_leo_directives
https://bugs.launchpad.net/leo-editor/+bug/618474

in core/leoRst the method removeLeoDirectives seems not to remove the leo directives.
which results in @leo directives inside generated rst code.

The problematic code line is the statement "g.match_word(s, 0,key)" in the following block:

                for key in self.leoDirectivesList:
                    if g.match_word(s, 0,key):
                        #g.trace('removing %s' % s)
                        break

As far as I understand the function match_word, it returns 1 if s contains key at index 0,
The self.leoDirectivesList contains all directive like color, language, ... (without @) but
s is a complete body line that looks like:
@language rest

That means language starts at index 1 not at 0.
changing the line to
  g.match_word(s, 1,key)

let it work correctly in my installation (4.7.1)
#@+node:ekr.20101124102457.5158: *8* fixed bug 618482: code-mode line feeds
https://bugs.launchpad.net/leo-editor/+bug/618482

in leoRst.py:

the method "handleCodeMode" does not preserve line linefeeds of the original code. While this is only annoying for code
parts it is fatal for doc parts, because rst directives does not work anymore.

The problem is in the line "elif not z.rstrip(): pass" of the following code block at the end of the method
        for z in result:
            if z == '': result2.append('\n\n')
            elif not z.rstrip(): pass
            elif z.endswith('\n\n'): result2.append(z) # Leave alone.
            else: result2.append('%s\n' % z.rstrip())

Commenting this line out, preserves the linefeeds in the doc part but doubles them in the code part.

The method "rstripList" is responsible for the doubling linefeeds:
   The lines arguments is a list of lines with (!) trailing linefeeds (\n),

   The statement s = '\n'.join(theList).rstrip() doubles therefore the linefeeds
    replacing the line with s = ''.join(theList).rstrip() works.
#@+node:ekr.20101124102457.5159: *8* Fixed weave (and many similar) commands
#@+node:ekr.20101124102457.5160: *8* Shorter warnings about incompatible gui type
#@+node:ekr.20101124102457.5161: *8* Improved @enabled-plugins: ignore lines starting with '@'
Also give calmer messages for non-existent plugins.
#@+node:ekr.20101124102457.5162: *8* Fixed bug in runUnitTestLeoFile
Replace ';' by os.pathsep.
#@+node:ekr.20101124102457.5163: *8* Fixed crasher with del in minibuffer
Changed w to self in leoQLineEditWidget.setInsertPoint.
#@+node:ekr.20101124102457.5164: *8* Ignore F-Keys & Ins in the minibuffer.
k.fullCommand now ignores fkeys and Ins.
#@+node:ekr.20101124102457.5165: *8* Fixed bug 618570: leoRst: option strip_at_file_prefixes...
leoRst: option strip_at_file_prefixes does not strip file prefixes in leo 4.7.1

The problematic code is in method underline of class rstCommands.
The last statement:

  return '%s\n%s\n\n' % (p.h.strip(),ch*n)

returns the full heading and not stripped one, (in the s parameter)
#@+node:ekr.20101124102457.5166: *8* Fixed bug 622802: Go to clone" switches to the first chapter
If one or more chapters exist (other than main), "Go to clone" switches to the
first chapter, whether or not the clone is in that chapter.

The new code always selects the main chapter.
This is the simplest thing that could possibly work.
Other approaches are fraught with difficulties.
#@+node:ekr.20101124102457.5167: *8* Fixed unicode bug in files
I created a file time.leo. When it's in the dir d:/Dmitry it's being
opened fine. But when I put it into the dir with Russian characters:
D:/Личное/Время leo prints squares at the window header and doesn't
open the file correctly. This problem existed in one of the revisions,
then it was fixed in the last official release. Now it emerged again
in my Leo 4.8 devel, build 3005

Traceback (most recent call last):
  File "c:\leo.repo\trunk\leo\core\leoGlobals.py", line 3307, in pr
    sys.stdout.write(s2)
  File "c:\python31\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]

UnicodeEncodeError: 'charmap' codec can't encode character '\xc2' in position
31: character maps to <undefined> path changed for @thin
Unicode-Â-folder/unicode-Â-test2.txt created:
C:\Users\edreamleo\Unicode-Â-folder\unicode-Â-test2.txt
#@+node:ekr.20101124102457.5168: *8* Eliminated check python syntax commands, but retained code
@nocolor-node

Removed the check-all-python-code and check-python code commands
(and removed the references to these commands in menus.)

- Retained the actual code for scripts.
- Retained automatic syntax checking of python files on saves

The problem with separate commands is that they don't necessarily check an
entire file: things like 'return' in a node that doesn't look it is in a
function.

Directives and section references are not the problem:
they get translated to comments before the check.
#@+node:ekr.20101124102457.5169: *8* Improved handling of history
nav_qt.py just uses these:

    c.goPrevVisitedNode()
    c.goNextVisitedNode()

and these subsequently use leoCommand.py / class nodeHistory.

The fix would have to happen in leoFrame.py / selectHelper() which does this:

    c.nodeHistory.update(p) # Remember this position.

It shouldn't call update() there. Rather, the call should be moved to
wherever body focus code is.

The fix was to leoTree.selectHelper and qtBody.onFocusIn.

#@+node:ekr.20101124102457.5170: *8* Remember whether @asis/@nosent existed at read time
Removed all traces of the "significant change" logic. The read code remembers
whether a node existed when Leo loaded the outline.

Leo will warn when writing a node that didn't previously exist. This is a nice
simplification of the code.
#@+node:ekr.20101124102457.5171: *8* Added g.app.config.config_iter
This simplifies the print-settings command.
#@+node:ekr.20101124102457.5172: *6* Code features
#@+node:ekr.20101124102457.5173: *7* Added g.findTestScript
http://groups.google.com/group/leo-editor/browse_thread/thread/a108d70400b28dc9#

g.findTestScript is an important new pattern for sharing code in Leo scripts,
including scripts in @test nodes.

Suppose there is common code that I want to include in several unit tests::

    class Hello():
        def __init__(self,name='john'):
            self.name=name
            print('hello %s' % name)

I put this in a node called 'Common test code'.

The unit tests can "import" the code as follows::

    exec(g.findTestScript('Common test code'))

Now class Hello is available the test code!

This is something that I've wanted to do forever.  It's almost too
easy.  I suppose it's a small security problem, but so is every other
@test node!
#@+node:ekr.20101124102457.5174: *7* Added p.deletePositionsInList
http://groups.google.com/group/leo-editor/browse_thread/thread/e3c736bc9f545b7e#

This is an important new helper.
#@+node:ekr.20101124102457.5175: *7* Leo is more clever in putting up the Leo id dialog
g.app.setLeoID now calls createDefaultGui instead of createTkGui.

We can *not* put up the LeoID dialog later: it is needed to set
g.app.nodeIndices, which is used in the read logic for outlines, so it *must* be
set before we load any Leo file!

#@+node:ekr.20101124102457.5176: *7* Simplified leoPlugins code
There are some tricky issues here:

http://groups.google.com/group/leo-editor/browse_thread/thread/4da36f0d897a25e8

Important: g.loadOnePlugin calls the plugins onCreate method to make up for
events that have already been generated. pc.loadOnePlugin does not.
#@+node:ekr.20101124102457.5177: *7* Patched @test logic
# Begin patch

=== modified file 'leo/core/leoTest.py'
@@ -697,9 +696,10 @@

     # 2010/03/05: set the current directory so that importing leo.core.whatever works.
     leoDir = g.os_path_finalize_join(g.app.loadDir,'..','..')
-    os.chdir(leoDir)
-
-    os.spawnve(os.P_NOWAIT,sys.executable,args,os.environ)

+    #os.chdir(leoDir)
+    env = dict(os.environ)
+    env['PYTHONPATH'] = env.get('PYTHONPATH', '')+';'+leoDir
+    os.spawnve(os.P_NOWAIT,sys.executable,args,env)
#@+node:ekr.20101124102457.5178: *6* Commands
#@+node:ekr.20101124102457.5179: *7* Added legend for print-settings command
#@+node:ekr.20101124102457.5180: *7* Added code-to-rst command
# And deprecated code mode.
#@+node:ekr.20101124102457.5181: *7* Removed mark-clones command
It is useless in the one-node world.
#@+node:ekr.20101124102457.5182: *7* Improved abbreviation commands
http://groups.google.com/group/leo-editor/browse_thread/thread/24cb88a8c2a20a07#

- Space activates abbreviations.
- Multi-line abbreviations handled properly.
- add-global-abbrev command uses entire selected text as the value of the abbreviation.
- Inserted abbreviations are undoable.
- Added support for @data abbreviations and @data global-abbreviations.
- Added support for @bool enable-abbreviations.

apropos-abbreviations
=====================

When abbreviation mode is on (abbrev-mode toggles this mode) Leo will expand
abbreviations as you type. Type the name of an abbreviation, followed by a
space. As soon as you type the space, Leo will replace the name by the
abbreviations value. You can undo the replacement as usual.

Note that defining any abbreviation automatically turns on abbreviation mode.

The add-global-abbreviation command (<alt-x>add-gl<tab><return>) takes the
selected text as the replacement value of the abbreviation. The minibuffer
prompts you for the name of the abbreviation.
#@+node:ekr.20101124102457.5183: *7* Completed cascade-windows and minimize-all-windows commands
#@+node:ekr.20101124102457.5184: *7* Created head-to-prev-node and tail-to-next-node commands
@nocolor-node

https://bugs.launchpad.net/leo-editor/+bug/611413

These work around the lack of AI in Python's importer.

Added leoImport.findClass helper.

The head-to-prev-node command moves non-empty text preceding a class, method or
function definition to the end of the previous sibling node.

The tail-to-next-node command moves non-empty text following a class, method or
function definition to the start of the next sibling node.
#@+node:ekr.20101124102457.5189: *6* Documentation
#@+node:ekr.20101124102457.5190: *7* Created introductory slide shows
#@+node:ekr.20101124102457.5191: *7* Reorganized Users Guide
http://groups.google.com/group/leo-editor/browse_thread/thread/d02df89c0b831a7c

I created my own copy of the home page:

    Files-->@edit leo_toc.html

This allows me to group items without creating special pages.
#@+node:ekr.20101124102457.5192: *6* Features
#@+node:ekr.20101124102457.5193: *7* New sentinels
#@+node:ekr.20101124102457.5194: *7* Don't create @chapter node for new file
I think @chapters node shouldn't be in a new leo file, but it should
be created when the first chapter is created.

Ditto for the chapter selector toolbar button.
#@+node:ekr.20101124102457.5195: *7* Improved install instructions & logic
http://groups.google.com/group/leo-editor/browse_thread/thread/a5a47afa65af9a37

The following changes are on the trunk, and also on Leo's web site:

- In home page, added link to Install page, just above the Beginner's Guide.

- Added more explicit instructions for installing Tk and Qt.

- In step 6 of the Windows install steps, the "assoc .leo=LeoFile"
  is on a line by itself.

- Updated home page to indicate that Leo requires Python and PyQt.
  I also revised and simplified the introduction in other ways.
  Ditto for description of Leo on SourceForge.

- Changed "%1" to "%*" throughout the installation instructions.

- Made batch files given in Installing Leo and Running Leo the same.

- The dialogs that ask for the Leo ID now tells why Leo needs it.

- Just before raising the dialog that asks for the Leo ID, Leo attempts
  to create the Qt Gui first, and then the Tk Gui if Qt does not exist.
  This should make it much less likely that a prompt for the id
  will be sent to the console.


2. The readme.txt file for 4.7.1-final does not mention that Python and PyQt is
   required.

readme.txt does say it has a new Windows installer. This
led me to believe -- erroneously -- that the Windows installer is all
I would need to download and install, since it's typical for most open
source programs I've used to have everything needed for the install
(for example. .NET) in the single Windows download.

2b. And perhaps the readme.txt file as well?

Can the [install] page be updated to make this clearer?

4. When I first went to the Install page, I clicked on the link for
"Installing Leo on Windows", got to the end of the steps and saw the
next section was "Tracking the development version" which I wasn't
interested in doing so I didn't read any further.

Clicking on the installer-created Windows link for Leo on the Start
Menu did nothing. Eventually I found the Windows section under
"Running Leo" and learned it was required to run Leo the first time
from a console window and not by launching it from Windows.
#@+node:ekr.20101124102457.5196: *7* DnD outline nodes
DnD creates @file or @auto nodes if appropriate
#@+node:ekr.20101124102457.5197: *7* write @edit nodes like @nosent nodes
#@+node:ekr.20101124102457.5198: *7* Leo now uses PyEnchant to check spelling
http://groups.google.com/group/leo-editor/browse_thread/thread/62ac1977b3704590#

#@+node:ekr.20101124102457.5199: *7* Improved @url nodes
Having to type the url after @url in headline is annoying.

The @url handler should look into the first line of body for url, if the text in
the headline is not an url. This way, the headline could actually be
descriptive.

I know some plugin does this, but there is no reason why this couldn't be the
default behavior.
#@+node:ekr.20101124102457.5200: *7* Made sure that all @auto nodes end with a newline
The fix was to the "if not trailingNewlineFlag:" code at the end of at.putBody.
#@+node:ekr.20101124102457.5201: *7* Improved language support
- improved support for elisp.

    - Use @language lisp instead of @language elisp.

- added importer for .ini files.
#@+node:ekr.20101124102457.5202: *6* Settings
#@+node:ekr.20101124102457.5203: *7* Allow multiple files on the command line
Refactored g.app.config.readSettingsFiles.

Settings now honored in workbook.

* Window size not honored when opened from menu.
#@+node:ekr.20101124102457.5204: *7* Allow proportional fonts in plain text
http://groups.google.com/group/leo-editor/browse_thread/thread/e6075a699909db53

You can now set a proportional font to use in all "@language plain" nodes

Specify fonts in @font nodes:

@font plain null font

plain_null_font_family = Times New Roman
plain_null_font_size = 16
plain_null_font_slant = roman
plain_null_font_weight = bold

That is, the actual font specs are in the body text.  Everything
except @font is ignored in the headline.

Specify colors in @color nodes:

@color plain null color = black
#@+node:ekr.20101124102457.5205: *7* Allow changing minibuffer colors
Added the following options with the indicated defaults.

\@color minibuffer_background_color = lightblue
\@color minibuffer_warning_color = lightgrey
#@+node:ekr.20101124102457.5206: *7* Added support for @string qt-toolbar-location
Valid values are top,bottom,left,right
#@+node:ekr.20101124102457.5207: *7* Support @bool write_expansion_bits_in_leo_files
#@+node:ekr.20101124102457.5208: *7* Added support for slideshow plugin
Command-line args
#@+node:ekr.20101124102457.5209: *7* New settings for abbreviations
@bool enable-abbreviations (default: False)

  When true, enables substitution of abbreviations.

@data global-abbreviations
@data abbreviations

  In both cases, body text contains lines of
  the form::

   name=value

  name is the abbreviation name, value is the substituted text. Whitespace is
  ignore around the name, but is significant in the value. Abbreviation names
  may contain only alphabetic characters, but may start with the '@' sign.

  By *convention* @data global-abbreviations setting should be defined in
  myLeoSettings.leo, while @data abbreviations should be defined in other .leo
  files. Regardless of where they are defined, abbreviations in @data
  abbreviation nodes will override settings (with the same name) in @data
  global-abbreviations nodes.
#@+node:ekr.20101124102457.5210: *5* New in 4.8 b1
#@+node:ekr.20101124102457.5211: *6* Bugs
#@+node:ekr.20101124102457.5212: *7* Fixed bug 603720: @auto parsing error on dedented triple quote string
The code that calculates the end of a block of indented Python code now takes
take more care with backslashes.
#@+node:ekr.20101124102457.5213: *7* Fixed bug 597757: c.frame.body.getSelectedText() doesn't work in added editors
#@+node:ekr.20101124102457.5214: *7* Fixed bug 604115: chapter-{clone,copy}-node-to broken
- Added better prompts for move/copy/clone commands.

- Undo/redo of these commands select the main chapter.
#@+node:ekr.20101124102457.5215: *7* Made sure proper install.txt appears
@nocolor-node

http://groups.google.com/group/leo-editor/browse_thread/thread/dea95cd8ab976cac


> > * The file 'INSTALL.TXT' contains the outline text with sentinels from
> > 'Chapter 1: Installing Leo'

There are *two* files called install.txt: the one that should
contain installation instructions and the one that contains the
"Installing Leo" chapter.

The solution was to change install.txt to installing.txt in the users guide.
#@+node:ekr.20101124102457.5216: *6* Completed cascade-windows and minimize-all-windows commands
#@+node:ekr.20101124102457.5217: *6* Improved present autocompleter
Allow "always on" operation:

- Ctrl-space is now bound to force-auto-completion

- Remove Alt-1 and Alt-2 default bindings.
#@+node:ekr.20101124102457.5218: *6* Created head-to-prev-node and tail-to-next-node commands
http://bugs.launchpad.net/leo-editor/+bug/611413

These work around the lack of AI in Python's importer.

The head-to-prev-node command moves non-empty text preceding a class, method or
function definition to the end of the previous sibling node.

The tail-to-next-node command moves non-empty text following a class, method or
function definition to the start of the next sibling node.
#@+node:ekr.20101124102457.5219: *6* Put non-def code in their own node
Fixed wishlist bug 670744: add a setting to put inter-def code in its own node

Added support for @bool at_auto_separate_non_def_nodes option.
The default (legacy mode) is False.
#@+node:ekr.20101124102457.5220: *5* New in 4.8 rc1
#@+node:ekr.20101124102457.5221: *6* Revised many plugins
@nocolor-node

Removed the keybindings.py plugin.  The print-bindings command should suffice.

The plugins_menu.py has been renamed old_plugin_menu.py to indicate that it
needs a lot of work to become functional.

The following plugins are now gui-independent (the used to be Tk only):

at_produce.py
chapter_hoist.py
import_cisco_config.py
macros.py
mod_read_dir_outline.py
multifile.py
read_only_nodes.py
word_count.py
xsltWithNodes.py

I also registered the menu2 event instead of the open2 event in all plugins that
use this event to create menus. This is required because a relatively recent
change creates menus *after* the open2 event happens.
#@+node:ekr.20101124102457.5222: *6* Fixed crasher in UNL.py: recursiveUNLSearch
#@+node:ekr.20101124102457.5223: *6* Big improvement to execute-script command
execute-script now calls execfile (or its equivalent when using Python 3k)
when @bool write_script_file = True.

This allows pdb to show the text of scripts!
#@+node:ekr.20101124102457.5224: *6* Added extract-python-method command
This should have been done *ages* ago. The command makes it easy to put python
methods in separate nodes.

Select a range of text, the first line of which starts with 'def foo (...)'

Do alt-x extract-python-method (or ctrl-p if you are repeating the command).

What happens:

- Creates a new child node whose headline is 'foo'.

- The body of foo contains all the selected text, properly indented.

The command is undoable.
#@+node:ekr.20101124102457.5225: *6* Open the default leo file if possible
Leo opens the file specified by the default_leo_file setting if it exists.

New in 4.8 rc1: if default (workbook) file does not exist Leo will
open an empty file and name is to be the default file.
#@+node:ekr.20101124102457.5226: *6* Fixed problems with installer
The installer now makes proper entries in the Windows start menu.
#@+node:ekr.20101124102457.5227: *5* New in 4.8 final
- Fixed key redefinition message.
#@+node:edream.110203163054.63: ** Latest version
#@+node:ekr.20110531155858.19246: *3* Leo 4.9 Release notes
@language rest

Leo 4.9 final              June 21, 2011

Leo 4.9 final is now available at:
http://sourceforge.net/projects/leo/files/

Leo is a text editor, data organizer, project manager and much more.
See: http://webpages.charter.net/edreamleo/intro.html

The highlights of Leo 4.9:
--------------------------

- The Qt gui completely replaces the Tk gui--Qt gui now has all essential
  features of Tk, including plugins.

- Completed Leo's autocompleter.

- The rendering pane can now display movies, html, svg images, etc.

- The scrolledmessage plugin can now use the rendering pane.

- Nodes may contain multiple @language directives.

- Leo highlights URL's everywhere. Ctrl-click URL's opens them in your web
  browser. 

- Leo uses an @file node's extension by default if there is no @language
  directive in effect.
  
- Unified extract and import commands.

- Leo can now colorize multiple @language directives in a single node.

- Plain up/down arrow keys in headline-editing mode select a new node.

- New commands to insert, delete, change or print uA's.

- Added namespace directive to .leo files.

- Fixed many bugs, some important, most quite minor.

Links:
------
Leo:      http://webpages.charter.net/edreamleo/front.html
Forum:    http://groups.google.com/group/leo-editor
Download: http://sourceforge.net/projects/leo/files/
Bzr:      http://code.launchpad.net/leo-editor/
Quotes:   http://webpages.charter.net/edreamleo/testimonials.html
#@+node:ekr.20110601105631.19359: *4* Deprecated/removed features
- Leo no longer supports the Tk gui. The Qt gui now does everything
  the Tk gui did, and more, and better.

- Removed show/hide/toggle minibuffer commands. The minibuffer is an essential
  part of Leo.
  
- These settings are no longer used::
    
    @string selected-background-color
    @string selected-command-background-color
    
- The import-at-root command is no longer supported.
#@+node:ekr.20110531155858.19830: *4* Bugs fixed in b1
#@+node:ekr.20110604043410.17811: *5* Numbered bugs
- Fixed bug 682561: pyenchant install problem.

  https://bugs.launchpad.net/leo-editor/+bug/682561

- Fix bug 690260: g.es sends to wrong tabbed pane.

  https://bugs.launchpad.net/leo-editor/+bug/690260

- Fixed bug 783617: Can't enter text directly in the Find panel

  https://bugs.launchpad.net/leo-editor/+bug/783617

- Fixed bug 681797: Shift-Delete not working in Qt

  https://bugs.launchpad.net/leo-editor/+bug/681797

- Fixed bug 622819: Ctrl-Shift movement is incorrect

  https://bugs.launchpad.net/leo-editor/+bug/622819

  Ctrl-Shift movement (back-word-extend-selection, forward-word-extend-selection)
  was incorrect when there is an existing selection, which was created by some
  method other than Ctrl-Shift movement.

- Resolved bug 323967: leo overrides minibuffer background color.

  https://bugs.launchpad.net/leo-editor/+bug/323967

- Fixed actionscript colors for parens.

  http://groups.google.com/group/leo-editor/browse_thread/thread/ee09fb2c2a5316f2/490fa7cddab36fab

- Fixed Bug 760531:Spurious overwrite warnings.

  https://bugs.launchpad.net/leo-editor/+bug/760531

- Fixed important bug involving orphan nodes

  http://groups.google.com/group/leo-editor/browse_thread/thread/861a0d156b16090f

  This was an important bug. It's been around for a very long time. What I did:
        
    - putVnode no longer clears the orphan bit.
    
    - at.read issues a warning and does not read the external file if the orphan bit is set.

- Fixed bug: show-invisibles now correctly shows blank lines.

- Fixed bug 766747: fill-paragraph doesn't respect setting from set-fill-column.

  https://bugs.launchpad.net/leo-editor/+bug/766747

  The fill-paragraph, center-line and center-region now all use the fill column
  if it has been explicitly set (and greater than zero). Otherwise, these
  commands use the @pagewidth value. Previously, the fill-paragraph command used
  the page width set by the @pagewidth directive, or an initial value from a
  @setting if no @pagewidth directive was in effect.

- Fixed bug 583878: Leo should warn about @comment/@delims clashes.

  https://bugs.launchpad.net/leo-editor/+bug/583878

  Leo now warns when a node contains both @comment and @delims directives.

- Fixed bug 778204: @verbatim not forbidden in body text.

  https://bugs.launchpad.net/leo-editor/+bug/778204

  Leo now generates an error for sentinels that look like @verbatim.

- Fixed bug 784920: @raw mode does not ignore directives.

  https://bugs.launchpad.net/leo-editor/+bug/784920

- Fixed bug 527717: Qt gui should enable/disable menu items.

  https://bugs.launchpad.net/leo-editor/+bug/527717

- Fixed bug 580328: c.frame.toggleSplitDirection() doesn't preserve existing ratio.

  https://bugs.launchpad.net/leo-editor/+bug/580328

- Fixed bug 581031: Scrollbar position is not preserved when
  c.frame.toggleSplitDirection() is executed.

  https://bugs.launchpad.net/leo-editor/+bug/581031

  toggleSplitDirection new ensures that both the selected outline node *and* the
  cursor in the body pane are visible.


- Fixed bug 525004: bash code not colored properly.

    https://bugs.launchpad.net/leo-editor/+bug/525004

    1. Fixed an off-by-one error in getNextToken. This was causing the havoc in
       the shell coloring.
    
    2. match_mark_following now does *nothing* (fails) if there is no next token.
       This is a major change, and it allows more rules to match in the shell
       colorer.
       
- Fixed bug 626587: Menus & dialogs now say "Flatten Selected Outline".

  https://bugs.launchpad.net/leo-editor/+bug/626587
#@+node:ekr.20110604043410.17812: *5* Other bugs
** Changing @language directives now forces a recoloring.

  This fixed the most annoying hangnail remaining in Leo.

** Removed remaining tk-isms from Leo's core.

  These were real bugs: they prevent emacs commands from working.

  Completely rewrote transposeWords.
  
** mod_autosave plugin no longer registers redundant idle-time handlers.

** Fixed mod_http plugin.

** Mark external file dirty when dragging node.

- Disabled the rst button in the contextmenu.

- Fixed horizontal scroll glitch in log pane (Python 2.x).
  qtLog.put sets horizontal scrolling to zero.
  This is a workaround to a glitch (Python 2.x only),
  but in fact it's generally useful.

- Fixed bug: auto-rst gives spurious overwrite message.

- Added bindings to all text widgets in the tab frame.

- Fixed goto-global-line problems.

- Restore positions of non-tabbed windows.

- Fixed Python 3.2 ua problems.

- Fixed bug in p._adjustPostionBeforeUnlink and simplified code.

- Fixed crash in archivedPositionToPosition.

- Fixed top-level uA's. There was a misspelling of 'unknownAttributes' in
  putVnode. This caused the uA for the first top level node in the outline to be
  cleared on save and by some copy paste ops.

- Fixed bug: Leo now ignores f-keys in find/replace patterns.

- c.bringToFront now activates the window.

- Fixed nav_qt plugin.

- Fixed completer focus problems.

- Fixed MacOS Command-C bug.

- Fixed major problem with multiple body editors
#@+node:ekr.20110602091552.16903: *4* Major improvements
- Leo highlights URL's everywhere. Ctrl-click URL's opens them in your web
  browser.
  
- Nodes may contain multiple @language directives.

- Use @file extension by default if there is no @language directive in effect.
  This is oh so useful.

- Unified extract commands.  This command creates a child node from the selected
  body text as follows:
    
    1. If the selection starts with a section reference, the section name become the
       child's headline. All following lines become the child's body text. The
       section reference line remains in the original body text.
       
    2. If the selection looks like a Python class or definition line, the
       class/function/method name becomes child's headline and all selected lines
       become the child's body text.
       
    3. Otherwise, the first line becomes the child's headline, and all selected
       lines become the child's body text.

    Note that the extract-section-names command remains.
    The extract-section and extract-python-method commands are gone.

- The import-file commands replaces all the following commands::
    
    import-at-file                    
    import-cweb-files         
    import-derived-file       
    import-flattened-outline      
    import-noweb-files
    
  Leo chooses one of the above commands as follows.  First, if the file looks
  like an external file that Leo wrote, the command works like
  import-derived-file command.  Otherwise, the file's extension determines the
  importer::
        
        .cw, .cweb:     import-cweb-files
        .nw, .noweb:    import-noweb-files
        .txt:           import-flattened-outline
        all others:     import-at-file
    
  The import-at-root command is no longer supported.
#@+node:ekr.20110602091552.16904: *5* Completed Leo's autocompleter
Terminology: the *legacy* (aka tabbed) autocompleter shows completions in Leo's
tabbed pane. The *new* (aka qcompleter) autocompleter shows completions in or
near the body pane.

Appearance
==========

There is little change to the legacy completer, except that no text is
highlighted in the body pane during completion. This is calmer than before.
Furthermore, there is no longer any need for highlighting, because when the user
types a backspace the legacy completer now simply deletes a single character
instead of the highlighted text.

One minor change: the legacy completer now *does* insert characters that do
not match the start of any possible completion. This is an experimental feature,
but it might play well with using codewise completions as a fallback to
leo-related completions.

Function and design
===================

Both the legacy and new completer now work *exactly* the same way, because they
both use the AutoCompleterClass to compute the list of completions.

The strict "stateless" requirement means that the "intermediate" completions
must be entered into the body pane while completion is active. It works well as
a visual cue when using the tabbed completer: indeed, the tabbed completer would
be difficult to use without this cue.

The situation is slightly different with the qcompleter. Adding code before the
user accepts the completion might be considered an "advanced" feature. However,
it does have two important advantages, especially when "chaining" across
periods: it indicates the status of the chaining and it limits what must appear
in the qcompleter window.

Codewise completions
====================

The codewise-oriented completions appear to work well. In large part,
this is due to adding the global "self." completions to all class-related
completions (kind == 'class' in ac.get_codewise_completions). This looks like a
really good hack, and it eliminates the need for the ContextSniffer class.

Performance
===========

Performance of leo-related completions is *much* better than before. The old
code used Python's inspect module and was horribly complex. The new code uses
eval and is perfectly straightforward.

The present codewise-related code caches completions for all previously-seen
prefixes. This dramatically speeds up backspacing. Global caching is possible
because completions depend *only* one the present prefix, *not* on the presently
selected node. If ContextSniffer were used, completions would depend on the
selected node and caching would likely be impractical. Despite these
improvements, the performance of codewise-oriented completions is noticeably
slower than leo-related completions.

Performance notes
=================

The ac.get_cached_options cuts back the prefix until it finds a cached prefix.
ac.compute_completion_list then uses this (perhaps-way-too-long-list) as a
starting point, and computes the final completion list by calling
g.itemsMatchingPrefixInList.

This may not be absolutely the fastest way, but it is much simpler and more
robust than attempting to do "prefix AI" based on comparing old and new
prefixes. Furthermore, this scheme is completely independent of the how
completions are actually computed. The autocompleter now caches options lists,
regardless of whether using eval or codewise.

In most cases the scheme is extremely fast: calls to get_completions replace
calls to g.itemsMatchingPrefixInList. However, for short prefixes, the list that
g.g.itemsMatchingPrefixInList scans can have thousands of items. Scanning large
lists can't be helped in any case for short prefixes.

Happily, the new scheme is still *completely* stateless: the completionDict does
*not* define state (it is valid everywhere) and no state variables had to be
added. In short, the new caching scheme is much better than before, and it
probably is close to optimal in most situations.

#@+node:ekr.20110602091552.16905: *5* Greatly improved the viewrendered plugin
The viewrendered plugin creates a window for *live* rendering of images, movies,
sounds, rst, html, etc. 

Commands
========

viewrendered.py creates the following (``Alt-X``) commands:

``viewrendered (abbreviated vr)``
    Opens a new rendering window.
    
    By default, the rendering pane renders body text as reStructuredText, with
    all Leo directives removed. However, if the body text starts with ``<``
    (after removing directives), the body text is rendered as html.
    
    **Important**: The default rendering just described does not apply to nodes
    whose headlines begin with @image, @html, @movie, @networkx, @svg and @url.
    See the section called **Special Renderings** below.

    Rendering sets the process current directory (os.chdir()) to the path
    to the node being rendered, to allow relative paths to work in ``.. image::`` directives.

``hide-rendering-pane``
    Makes the rendering pane invisible, but does not destroy it.

``lock-unlock-rendering-pane``
    Toggles the locked state of the rendering pane. When unlocked (the initial
    state), the rendering pane renders the contents of the presently selected
    node. When locked, the rendering pane does not change when other nodes are
    selected. This is useful for playing movies in the rendering pane.
    
``pause-play-movie``
    This command has effect only if the rendering pane is presently showing a movie.
    It pauses the movie if playing, or resumes the movie if paused.

``show-rendering-pane``
    Makes the rendering pane visible.

``toggle-rendering-pane``
    Shows the rendering pane if invisible, otherwise hides it.
    
``update-rendering-pane``
    Forces an update of the rendering pane. This is especially useful for
    @graphics-script nodes: such nodes are update automatically only when
    selected, not when the body text changes.
    
Rendering reStructuredText
==========================

For example, both::

    Heading
    -------

    `This` is **really** a line of text.

and::

    <h1>Heading<h1>

    <tt>This</tt> is <b>really</b> a line of text.

will look something like:

    **Heading**

    `This` is **really** a line of text.
    
**Important**: reStructuredText errors and warnings will appear in red in the rendering pane.

Special renderings
===================

This plugin renders @image, @html, @movie, @networkx, @svg and @url nodes in
special ways.

For @image, @movie and @svg nodes, either the headline or the first line of body
text may contain a filename.  If relative, the filename is resolved relative to
Leo's load directory. 

- ``@graphics-script`` executes the script in the body text in a context containing
  two predefined variables:
      
    - gs is the QGraphicsScene for the rendering pane.
    - gv is the QGraphicsView for the rendering pane.
    
  Using these variables, the script in the body text may create graphics to the
  rendering pane.

- ``@image`` renders the file as an image.


- ``@html`` renders the body text as html.


- ``@movie`` plays the file as a movie.  @movie also works for music files.

- ``@networkx`` is non-functional at present.  It is intended to
  render the body text as a networkx graph.
  See http://networkx.lanl.gov/


- ``@svg`` renders the file as a (possibly animated!) svg (Scalable Vector Image).
  See http://en.wikipedia.org/wiki/Scalable_Vector_Graphics
  **Note**: if the first character of the body text is ``<`` after removing Leo directives,
  the contents of body pane is taken to be an svg image.

- ``@url`` is non-functional at present.

Settings
========

- ``@color rendering-pane-background-color = white``
  The background color the rendering pane when rendering text.

- ``@bool view-rendered-auto-create = False``
  When True, show the rendering pane when Leo opens an outline.
  
- ``@bool view-rendered-auto-hide = False``
  When True, hide the rendering pane for text-only renderings.

- ``@string view-rendered-default-kind = rst``
  The default kind of rendering.  One of (big,rst,html)

- ``@bool scrolledmessage_use_viewrendered = True``
  When True the scrolledmessage dialog will use the rendering pane,
  creating it as needed.  In particular, the plugins_menu plugin
  will show plugin docstrings in the rendering pane.
  
Acknowledgments
================

Terry Brown created this initial version of this plugin,
and the free_layout and NestedSplitter plugins used by viewrendered.

Edward K. Ream generalized this plugin and added communication and coordination
between the free_layout, NestedSplitter and viewrendered plugins.
#@+node:ekr.20110531155858.20246: *4* New and improved features
#@+node:ekr.20110602091552.16907: *5* Colorizing improvements
- Support multiple @language directives in a single node
  As with @color directives, only unambiguous @language directives affect the
  default coloring of descendant nodes.

- Colorize url's in the body text. You can open url's by control-clicking on
  them, or by using the open-url command.

- Added support for cython colorizing.

- Leo ignores (and does not color) @language directive for unknown languages.

- Leo completely recolors nodes when you change @language directives by typing.
#@+node:ekr.20110602091552.16909: *5* New command-line arguments & settings
- The --no-splash command-line option suppresses the splash screen.
  Leo puts up no splash screen when the --silent
  or --script command-line options are given.

- Added @bool view-rendered-auto-create setting.
    
- Added @bool use_qcompleter setting.

- Added @bool auto_tab_complete setting.

- Added @bool single_click_auto_edits_headline setting.

- Removed @bool use_codewise setting.

- You now may set icon button colors in the Qt stylesheet.
#@+node:ekr.20110602091552.16913: *5* Gui improvements
- If you type a *plain* up/down arrow key while editing a headline, Leo will act
  as if you had typed the corresponding *alt*- arrow key. That is, Leo will end
  editing of the headline and go to the next previous node. Leo will end editing
  even if there is no next/ previous node, which is convenient.

- A single click on an already-selected tree node edits the headline
  Enabled only if @bool single_click_auto_edits_headline = True.

- Added a splash screen

  The --no-splash command-line option suppresses the splash screen. In addition,
  Leo puts up no splash screen when the --silent or --script command-line
  options are given. To change the splash screen, replace
  leo\Icons\SplashScreen.jpg with another image.

- The apropos commands now print in a separate area if possible. The commands use
  the scrolledmessage plugin if possible, which in turn uses the viewrendered
  plugin by default. This makes the apropos messages much more visible.

- Handle click events like alt-x or ctrl-g Clicking in the minibuffer now is
  equivalent to alt-x, provided that the minibuffer is not in use. Clicking most
  places outside the minibuffer is equivalent to ctrl-g. Catching clicks is much
  safer than catching focus events.

- The first loaded file sets tabbed gui size

- Enter insert mode after ctrl-h.  This is a vim-related improvement.

- Disabled find/change text areas in find panel.  This is less confusing.
#@+node:ekr.20110602091552.16915: *5* Improved commands
- Improved the clone-find-all command. The descendants of previously found
  (cloned) nodes don't get added again. The clone-find-all pattern now defaults
  to find text.

- Improved the forward and backward by sentences commands Leo's sentence related
  functions now stop at empty lines, skip periods within words, stop at
  sentences ending in non-periods and stop at the end or beginning of the
  buffer.

- Improved the print-bindings command; it now shows were bindings came from.

- Improved the reformat-paragraph command. The command detects paragraphs more
  reliably. The next line is now visible, which is a big improvement.

- Added patch to g.wrap_lines from José Rojas Echenique
  It regularizes the number of spaces after periods.

- Improved expansion of abbreviations. Abbreviations are checked any time a
  non-word character is typed. In particular, newlines trigger abbreviations,
  which I find very helpful, although I did then have to remove newlines from my
  abbreviations. Control sequences do not trigger expansions.

- Improved handling of @url nodes. The new rule is simple: if the body text
  contains any text the first line of the body text is taken to be the url.
  There is no longer any need to put '--' in the headline. More importantly, you
  can put anything you like in the body text following the first line. Other
  url's, notes, even .. graphics:: directives for the viewrendered plugin.

- Improved the clean-all-lines command. It is now much faster and has better
  feedback.
#@+node:ekr.20110602091552.16911: *5* File handling improvements
- Added namespace and Leo comment lines to .leo files

- Leo opens leoSettings.leo only once

- Fixed Bug 745824: @doc duplicates comment delims in html files
  https://bugs.launchpad.net/leo-editor/+bug/745824e
  
- Leo no longer wraps @doc lines. This ensures that Leo does not change files
  unnecessarily.
#@+node:ekr.20110602091552.16917: *5* Scripting improvements
.. _`Runwith class`: http://groups.google.com/group/leo-editor/browse_thread/thread/b8e8fbf6d97fa9f2/a4537fafaf2442ba

- Added namespace arg in c.executeScript

- Put Kent Tenney's `Runwith class`_ in scripts.leo and contrib.

  Kent writes, "I've had endless problems with interpreter versioning, leading
  me create the Runwith class. It writes a file to disk, makes it executable,
  runs it, captures exitcode, err and output, removes the files, provides
  reports. This provides complete decoupling from Leo."

- Call os.chdir when executing scripts.
#@+node:ekr.20110604043410.17808: *4* New in 4.9 b2
- Double-clicking a headline now colorizers the headline exactly the same way as
  when editing the headline with ctrl-H. This was a serious problem for those
  with dark window-color schemes.
  
- The distribution script now ensures that leo\plugins\spellpyx.txt contains
  Linux-style newlines. This prevents crashes in the PyEnchant spell checker.
  
- Leo imports .cfg files just like .ini files.

- Fixed crasher in graphcanvas plugin caused by a bug in CommandChainDispatcher.add.
#@+node:ekr.20110611055444.16617: *4* New in 4.9 b3
#@+node:ekr.20110611055444.16618: *5* Bugs fixed
- Fixed ancient, major bug: F3 now makes sure to save headline changes

- Fixed old bug: set-find-x commands no longer abort find commands

  The commands that switch find scope, set-find-xxx, no longer terminate the
  find command, if one is active.  This is an old bug, and it's good to fix it. 

- Fixed recent bugs in the viewrendered and scrolledmessage plugins

  An earlier rev fixed a bug that effectively destroyed the viewrendered plugin.
  It was caused by the new convention that alleviates the need for many
  \@language directives. The fix was simply to enable the update_rst method if
  the massaged p.b is not empty.

  ScrolledMessageDialog.convertMessage now renders rst by default, unless
  *either* the html or text button is pressed.  There really should be three
  radio buttons: text, html or rST, but that's a tiny interface glitch.  The
  actual bug however, was much more serious: rst was never being rendered. 

- Fixed chapters problems

    http://groups.google.com/group/leo-editor/browse_thread/thread/3f15a855ca38b26e
    
    The new code is more relaxed about where @chapter nodes may reside.  They
    are always *created* as the last child of the first @chapters node in the
    outline (the @chapters, plural, node is created as needed).  However, you may
    move them while in the "main" chapter, with no ill effects.  In fact, you could
    swap @chapter nodes with the same name: when you select a chapter, Leo will use
    (show) the first node it finds. 
    
    The new code is now both more careful and more tolerant of @chapter nodes
    deleted by hand.  The chapter will still appear in the dropdown list: if you
    select it you will give a polite warning.  That's all.  In particular, the
    deleted chapter will *remain* in the dropdown list until you use the proper
    chapter-remove command.  That's about the only sane alternative: it allows you
    to resurrect the chapter, by hand or with an undo. 
    
    This is all made possible because the new code is almost completely stateless.
    The only exception is the saved position used to select a node when selecting a
    chapter. The old position-based findPositionInChapter method has been simplified
    to make it work more reliably. It first looks for a "perfect" match using
    positions, and then degrades to looking for a vnode match. In practice, most
    matches are, in fact, perfect. The "imperfect" case typically happens when the
    user alters nodes in @chapter trees by hand in the "main" chapters.
    
    Technical highlights:
        
    - The check for c.positionExists(p) in c.setCurrentPosition continues to fail
      when deleting @chapter nodes. However, the code now simply falls back to
      c.rootPosition, without any apparent harm.
      
    - The chapterController and chapter classes are now completely stateless, except
      for chapter.p.
      
        A. chapter.findPositionInChapter has been simplified and generalized. It now
           falls back to a reasonable value, based on p.v, if chapter.p does not
           exist.
           
        B. All chapterController code now recomputes the location of @chapters and
           @chapter nodes whenever those locations are needed.
           
        C. All chapter commands are unchanged in their actual workings, but all contain
           a care "preamble" of checking code.
           
- Added unit test for all chapter commands.  All interactive commands now have
  an xByName helper for use by unit tests.
  
- Added lockout to leoQtTreeTab.  This prevents flash during the rename chapter command.

- Rewrote chapter.chapterSelectHelper.  This reduces, but does not eliminate, the
  number of warnings given by c.setCurrentPosition.


- Fixed recent bug: handle 'Escape' character properly

  The fix was a last-minute adjustment in leoQtEventFilter.create_key_event.


- Fixed caps-lock problem

  The fix was yet another last-minute fix leoQtEventFiler.create_key_event.

- Made sure all keys contribute to lossage
#@+node:ekr.20110611055444.16654: *5* Simplified Leo's key handling
This was a major simplification of Leo's core.

- Eliminated event.keysym from Leo's core: test only ev.char and ev.stroke.

- Replaced all dummy (g.bunch) events in Leo's core and in unitTest.leo.
    
- Replaced w.event_generate by g.app.gui.event_generate everywhere.
    
- Rewrote leoGui.leoKeyEvent.

- Created leoGui.create_key_event and leoQtEventFilter.create_key_event.

- Removed some ugly last-minute hacks in leoQtEventFilter.create_key_event.
#@+node:ekr.20110611055444.16726: *5* Features
- Changed names of commands so they have common prefixes

    Any custom key bindings (none are bound by default) will have to change.
    
    The new prefixes are::
    
        abbrev-     abbreviation commands
        buffer-     buffer command
        directory-  director commands
        file-       file commands
        gc-         garbage collection
        macro-      macro expansion
        rectangle-  rectangle commands
        register    register commands
        
    The already existing prefixes are::
    
        apropos-    help
        ddabrev-    dynamic abbreviations
        find-       find commands
        isearch-    incremental search
        print-      print information
        run-        run unit tests
        toggle-     toggle settings
        yank-       yank
        

- Finished macros

    The macro-load and macro-save are as simple as possible.

    No further work will be done on macros unless somebody really wants these commands.


- Added support for word-only option for regular expressions

When the word-only option is in effect, Leo ensures that the search pattern
begins and ends with the '\b' anchor.

- Leo's startup code now forces the qt gui: it changes qttabs to qt.

- Added support for expanded sections in plugin.  Added three new options:

    expand_noweb_references
    
       True: Replace references by definitions.
       Definitions must be descendants of the referencing node.
    
    ignore_noweb_definitions
    
        True: ignore section definition nodes.
    
    expand_noweb_recursively
    
        True: recursively expand definitions by expanding any
        references found in definitions.
        
Notes:

- This is an experimental feature: all aspects might changed.

- The code ensures that unbounded expansions can not happen. While expanding any
  section, the rst3 will not expand again any sections that have already
  occurred in the expansion.

- All rst3 options apply to the entire node in which they appear (and all
  descendant nodes until over-ridden), but by splitting nodes one can change the
  settings on an expansion-by-expansion basis. It is easy to split nodes without
  creating new sections using @rst-no-head in the headline.
#@+node:ekr.20110611092035.16493: *5* Removed settings
The following Tk settings have been removed from leoSettings.leo::

    @bool center_selected_tree_node
    @bool expanded_click_area
    @bool idle_redraw
    @bool initialClickExpandsOrContractsNode
    @bool invisible_outline_navigation
    @bool look_for_control_drag_on_mouse_down
    @bool outline_pane_scrolls_horizontally
    @bool use_minibuffer
    
The following setting was not active, and has also been removed::

    @bool ignore_caps_lock
#@+node:ekr.20110613172008.14775: *4* New in 4.9 b4
Old bugs fixed
--------------

- Fixed an ancient bug: everything after @all was put in the wrong node!

- Fixed an ancient bug: wrap-around search now restarts when find pattern changes

- Fixed an ancient bug: F-keys end incremental searches.

Recent bugs fixed
-----------------

- Fixed a recent problem with commands dispatched from menus The Shift modifier
  was deleted from all commands executed by selecting an item in menus! A new
  unit test checks that menus behave as expected.

- Dismiss splash screen before putting up the dialog that asks for an ID.

Other changes
-------------

- Running all unit tests leaves all files unchanged. This was a major annoyance.

- Leo now does a keyboard-quit when deactivating a window.
#@+node:ekr.20110616100929.14794: *4* New in 4.9 rc1
- When running on MacOS, Leo uses the qt gui when the qttabs gui is requested.

- Leo now looks in home/.leo/Icons directory for icons before looking in the
  leo/Icons directory.
  http://groups.google.com/group/leo-editor/browse_thread/thread/80163aec96b8ea45/4f58418924172252

- Fixed bug 797470: File data sometimes silently erased when the tangler fails.
  https://bugs.launchpad.net/leo-editor/+bug/797470 This was a serious bug, but
  it could happen only when saving an errorneous file twice.

- Fixed bug 798194: --maximized has no effect
  https://bugs.launchpad.net/leo-editor/+bug/798194
  
- Added the @bool forbid_invalid_completions setting.

- Non-plain keys, such as Ctrl-s, abort auto-completion and are interpreted as
  usual.

- Don't mark the .leo file as changed when setting orphan bit. There is no need:
  the orphan bits will ensure errors get reported if the file is saved.

- Disabled the open-compare-window command. It is/was a Tk only command.

- The open-python-window command fails more gracefully It issues a message
  instead of crashing if idlelib does not exist.
#@+node:ekr.20110620083705.14902: *4* New in 4.9 final
Fixed crash on mouse clicks in minibuffer.
#@-all
#@-leo
