This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author taleinat
Recipients gpolo, kbk, taleinat, terry.reedy, weeble
Date 2014-02-05.09:55:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391594102.12.0.422425141647.issue3068@psf.upfronthosting.co.za>
In-reply-to
Content
(This is a bit long; there's a TL;DR at the end.)

You'd be surprised how many of IDLE's features are implemented as extensions. These are simply included in idlelib, enabled by default and configured with reasonable values.

Take a look at Lib/idlelib/config-extensions.def, and you'll see all of the bundled extensions' configuration values. (Every extension must have a section in config-extensions.def or a user's config-extensions.cfg to be enabled.)

So, for example, auto-completion is an extension. Besides disabling it completely, a user can also change the delay before the completion list appears automatically by setting 'popupwait', and customize the key bindings for the 'autocomplete' and 'force-open-completions' events. 

The 'ParenMatch' and 'CodeContext' extensions also each have several configurable settings. And most extensions have at least one event to which keyboard shortcuts can be bound.

If after all of the above you look again at the 'FormatParagraph' extension, you'll see that it's breaking the convention. The maximum line width is configurable, but isn't found in config-extensions.def! Instead of using the normal extension configuration mechanism, FormatParagraph reads the 'maxformatwidth' config value from IDLE's main configuration on every call to format_paragraph_event().

Why was this done? To allow users to configure this setting using the GUI instead of editing a config file! If a config dialog for extensions had existed, this hack wouldn't have been necessary.


So what does my patch achieve?

* It makes many more of IDLE's settings easy to discover, set and fiddle with. Some of these are actually useful, e.g. AutoComplete's 'popupwait' setting.
* Makes it reasonable to tell a user "just disable auto-completions from the extension config dialog". (Without this patch: "find your .idlerc folder; open the config-extensions.cfg file or create one if it doesn't exist; find the [AutoComplete] section; make sure enable=0 is written directly under it".)
* Removes the inconsistent hack in FormatParagraph.format_paragraph_event().
* Makes it more reasonable to bundle more extensions with IDLE (such as my Squeezer extension; see issue1529353).
History
Date User Action Args
2014-02-05 09:55:02taleinatsetrecipients: + taleinat, terry.reedy, kbk, gpolo, weeble
2014-02-05 09:55:02taleinatsetmessageid: <1391594102.12.0.422425141647.issue3068@psf.upfronthosting.co.za>
2014-02-05 09:55:02taleinatlinkissue3068 messages
2014-02-05 09:55:01taleinatcreate