Page 1 of 1

Scoping most configuration to Document Classes

Posted: Tue Apr 29, 2003 1:46 am
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! :)

Posted: Wed Jul 16, 2003 7:10 pm
by Tyriel
So basically you're suggesting that textpad implement "profiles", where you can have several "versions" of all your (normally global) options, and the ability to flip between these sets of options?

That sounds cool but it also sounds like it would take a total overhaul of textpad. Way to think big, but I think 5 small features > 1 huge feature such as this.

Posted: Sat Aug 02, 2003 3:45 pm
by jeffy
I agree this idea, as I have stated it above, is too broad. But, as I said, I can't get my mind around it yet.

I really do think that associating things (macros, supplemental dictionaries, tools) to specific Document Classes, while declaring some to be global to all document classes, would make TextPad infinitely flexible.

Think about it, from my point of view as a Java programmer... Only Java specific macros would be associated to my Java Document Class. Only Java tools (compiling/building), only Java *dictionaries*.

Maybe I'd have 25 macros globally associated to every Document Class. The rest would be Document Class specific. This would eliminate issues relating to "too many macros in the menu", "not enough key commands to go around"...

So freakishly cool. I think this is only the beginning, and just this much would be plenty for me.

Yes, taking this idea to its extreme, this would replace much of the global configuration settings with Document Class based configuration. And this is exactly what would make TextPad a completely different editor, depending on what document you're editing. Which is exactly what we want a text editor to be.

As I said, I can't quite get my mind around this, as far as how to deal with tricky issues, such as saving keyboard-commands for all these document classes, without going crazy dealing with conflicts...

(Also, beyond just "global", you might want to have user-configurable groups of Document Classes. Such as "programming", which would include Java, JavaScript, PL/SQL, ..., so you could globally associate programming-related macros to all programming-based Document Classes... Hmm...)

But this *is* an idea worth discussing. Perhaps a subset of it could be realistically implemented for version 5--it's been, what?, thirteen years since the last major TextPad release?, and at least we can work towards future ideas and flexibility...