Page 1 of 1

WISH: Scoping most configuration to Document Classes

Posted: Sat Mar 29, 2003 7:44 pm
by jeffy
:idea:

Depending on what type of file you're editing, based upon Document Classes, TextPad should completely transform personalities. No one personality is anything different than what TextPad provides today, but this would make TextPad almost infinitely flexible.

(I can't quite wrap my brain around this yet, but I'm a lot closer than when I started thinking about it two-plus years ago.)

What do you think? Clearly it's a big deal as far as how configuration is managed and what user interface would be required to make it a reality, but it would not change how configuration is used by the editor itself.

Here's what TextPad's configuration is currently:
  • General
  • File
  • Editor
  • View
  • Document Classes
    • My very own document class
      • Colors
      • Font
      • Printing
      • Syntax
      • Tabulation
  • Associated Files
  • Backup
  • File Name Filters
  • Keyboard
  • Language
  • Macros
  • Spelling
  • Tools
So, when TextPad is opened, global configuration is "loaded" into memory. When individual files are opened, the Document Class specific configuration is "loaded" into memory and "applied" to documents "associated" to Document Classes ("DC"). It should stay that way, except move a lot more of the "global" stuff to DCs. So, now you could have:
  • General
  • File
  • Editor
  • Associated Files
  • Document Classes
    • GLOBAL SETTINGS
      • View
      • File Name Filters
      • Backup
      • Keyboard
      • Language
      • Macros
      • Spelling
      • Tools
      • Colors
      • Font
      • Printing
      • Syntax
      • Tabulation
    • My very own document class
      • View
      • File Name Filters
      • Backup
      • Keyboard
      • Language
      • Macros
      • Spelling
      • Tools
      • Colors
      • Font
      • Printing
      • Syntax
      • Tabulation
  • All Macros
  • All Tools
"GLOBAL SETTINGS" are those used in every DC, and cannot be overridden (nor even specified) in any other DC. Only what you want to truly be global, throughout every other DC, is specified here. Any and all other configuration would be specified in the individual DCs.

Any DC could be duplicated as a whole, and any branch's values could be copied to another DC.

So, we still have the "Macros" and "Tools" branches (now called "All Macros" and "All Tools") but, in each DC, we can associate some macros and tools to each DC. For example, I'd associate HTML-specific macros and tools to just the HTML and Java (for JavaDoc) DCs. I'd associate generic navigation macros to the special GLOBAL SETTINGS DC, and generic coding macros (like single-line commenting and () {...}) to Java, JavaScript, Perl, PHP, PL/SQL. And so on.

And each DC could have tailored key-commands, "extending" upon the GLOBAL SETTINGS. Now how freakin' cool is that?! :twisted:

(By the way, I got this "scoping" idea from Eclipse, who's newest version allows key-commands to be scoped--I have no idea how, because I've never seen the editor--the newest version was just released, and the site is way overloaded. Anyhoo, that's what triggered this.)

Like I said, I can't quite wrap my brain completely around this, but the possibilities are exciting. Hopefully others can help flesh this out.


Thanks! :)