Page 1 of 1

Syntax File Definition Enhancement

Posted: Thu Nov 20, 2003 10:11 pm
by MarqueIV
Any chance rather than just saying 'Keywords 1', 'Keywords 2', etc. that you could give them a friendly name when using the color preferences? Many times I have no idea what words are in 'Keywords 1' as opposed to two without opening them.

As an example, here's what I'm thinking...

Keywords 1: Base Words
Keywords 2: Data Types
Keywords 3: Built-in Functions

with the text being shown in the actual selector (like 'Comments', 'Strings' , 'Operators', etc.) making it much easier to work with.

As an additional enhancement, what about the ability to--right from that same list--right-click and say 'Show entries' which would pop open a window that you can view, or even better yet, edit the contents of each section. In other words, rather than just selecting an entry and only changing the colors, you basically would be creating an interactive editor for the syntax files.

You should also be able to specify the default colors that you suggest when the user clicks the 'Defaults' button.

Anyone agree?

Mark

Posted: Fri Nov 21, 2003 5:04 am
by bluntelk
the keywords thing is good as it is, as not all sytax definitions are the same - and some files have 2 or 3 languages in them (eg php, html, javascript)

so it would be irrelavant for some cases.

making an interactive sytax editor would be nice - but all they are is text files... and surprise - textpad is a text editor.

you can also get a syntax definitions file for syntax definitions files..

Posted: Fri Nov 21, 2003 6:20 am
by Bob Hansen
You can do that now, yourself.

The following sections show some excerpts from my syntax file for Macro Scheduler. Note that I have added comments starting with ";". For each group of keywords, I make reference of the color settings, and the type of functions in that group. In this section you can see that Keywords 2 are for Press Key and Mouse functions and are colored "light blue" (RGB color values are included).
[Keywords 2]
;Lt Blue (0,0,255)- PRESS KEY /MOUSE functions
Press
Backspace
Tab
Enter
Esc
F1
.....
.....
In this area beneath the Keywords, I have added my own sections. TextPad ignores them, but they are handy for me. I have made note of the color settings for this Document Class. The colors are there so I can get the same colors defined when I use this on a different system. And these colors were selected to be as close to colors in Macro Scheduler Editor also. And I added another section to record my preferred font for this class. Just using a ";" in front of each line or else this gets included as part of the last Keyword group.
;[Colors]
;Bookmarks = Teal
;Brackets = Red
;Characters = Teal
;Comments = Navy Blue
;Comments2 = Grey
.....
.....
.....
;Selected (No Focus) = Dark Green on Green
;Strings = green
;Text = Black
;URL = Bright Blue
;Visible Spaces = Red
;
;[Font]
;Comic Sans Serif, Bold, 10
Note: If you keep your syntax files in TextPad 4\User\ folder, you don't have to worry about upgrades overwriting the syntax files you have modified for your own use. This is also the best place to keep your clipboard and macro files, shortcuts and dictionaries, also for the same reason. Even better is keeping them on a shared resource and pointing all users to that location in the configuration so you only have to keep one copy that multiple users can share.

Posted: Fri Nov 21, 2003 7:10 am
by MarqueIV
Quite the contrary bluntelk... you're proving my point exactly! I'm saying you should be able to describe what each set of keywords is *in the syntax file itself* beacuse each tcl can be (and usually is) different. Then show that description in the color picker. I am not stating a fixed definition at all. Again, you just proved my point.

As far as Bob's idea, in reference to the commenting of the colors, again that's a great idea but you still have to manually open the TCL file to see what each section's color should be, then go back to the color picker and select the colors. I'm suggesting that TextPad automatically read some sort of default color for the sections, again specified directly in the TCL file. Think about it... you move TextPad to a new machine or have to reinstall it or you simply want to reset your colors to YOUR colors, and they're automatically set... from the TCL file.

...and as for TextPad already being a text editor... that's more reason to enhance the in-place editing. All you have to do is click on a button and a mini window of TextPad opens up showing you the selected section's entries. Sure TextPad is a text editor (Duh! I mean come on people!) but you can't set the colors and edit the keywords at the same time. The editor is under the modal preferences window and when you close it to edit the actual file, you then have to navigate the menu back to preferences, then scroll the colors to where you want to change. Seems a lot of steps to edit things that are related. After all, TCL files exist *for* the color coding. Shouldn't you be able to edit them both at the same time without having to keep closing and opening windows? Makes sense to me!

As for the logic that 'Surprise... it's already a text editor' well I'll give the poster the benefit of the doubt they were having a bad day. I mean using that logic, why bother with a preferences dialog at all and instead just move all settings into text files? And for that matter, why use TextPad at all and instead just use Notepad? I mean that's a no-brainer! Because the Preferences dialog to preferences, just like TextPad to text files, makes things a lot easier to work with, hence my suggestion... to make it easier to work with! After all, an editor for customizing the environment you work with I think is a natural extension of a well-designed program.

But... if you still don't think there's a need for an editor, then hopefully you will at least agree being able to specify the colors directly in the TCL would make things really easy. I just hate having to go to multiple places to modify my syntax files. These are all things that I do regularly that I feel can be a lot easier with a more featureful editor.

Now am I making any sense? Not trying to ruffle any feathers but again, I'm just trying to make a great product even better.

Posted: Fri Nov 21, 2003 8:03 am
by CyberSlug
I agree with MarqueIV!
Whenever I create a custom SYN file, I make comments in it about what colors I need to set in the preferences... Storing color info in the SYN file makes a lot more sense.

I have a "spell-checking" syntax file that highlights misspelled words.
http://www.textpad.com/forum/viewtopic.php?t=4721
Sometimes I temporarly apply the syntax file to other files (filetypes besides txt), but I wish the color scheme would also change so that misspelled words would always appear red (instead of blue which I use for most other color schemes).