Tal Einat added the comment: (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). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3068> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com