© J.C. Kessels 2009
MyDefrag Forum
May 25, 2013, 06:25:38 pm
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
MyDefrag Forum
>
MyDefrag v4 Forum
>
Scripts, and other contributions
>
[Tool] MyDefrag script syntax highlighting generator
Pages: [
1
]
2
3
...
5
« previous
next »
Print
Author
Topic: [Tool] MyDefrag script syntax highlighting generator (Read 29102 times)
jonib
JkDefrag Hero
Posts: 810
[Tool] MyDefrag script syntax highlighting generator
«
on:
June 07, 2009, 08:16:54 pm »
Updated to support MyDefrag 4.2.9
. Last update adds
Vim
support, more info in this
post
. Minor update to the Generator fixing a conflict with operators and comments in Notepad++.
This is a
preview/beta
release, its not quite finished but should be testable/usable.
So this is the
MyDefrag script syntax highlighting generator
that I have mentioned in some threads, it uses the
Formal script grammar
that describes the syntax of MyDefrag scripts, and creates config files supported editors can use to highlight MyDefrag scripts, so it's easier to see syntax errors and just nicer when making a script.
The idea behind the generator is that when a new version of MyDefrag is released you can just run the generator again to update the syntax highlighting to use any new syntax, but if there are big changes to MyDefrag syntax that my generator can't handle I will release a new version.
This is the main window for the installer/generator part:
I have tried to make the generator flexible to be able to add support for many editors/highlighting formats, right now it supports any editor that can use
Colorer library
including
Eclipse
,
FAR manager
(My editor of choice) via a plugin and
Freddy
, possibly others. also
TextPad
,
Notepad++
,
PSPad editor
,
gVim
and
jEdit
support is almost finished.
Some examples Eclipse and FAR manager.
Here is the download:
Generator
What is needed:
The generator needs the
Manual.chm
file from the MyDefrag install directory, it tries to find it but if it can't you can specify it in the left editbox.
If installing Colorer support the generator also needs to find the
catalog.xml
that Colorer uses for it's configuration, that is specified in the right editbox.
I'm using 7z.exe and 7z.dll from
www.7-zip.org
that uses the GNU LGPL license.
Comments, suggestions and bug reports are welcome.
«
Last Edit: July 09, 2010, 08:45:33 pm by jonib
»
Logged
MyDefrag script syntax highlighting generator
.
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #1 on:
June 10, 2009, 03:06:39 pm »
I have made a small update to the program please redownload if you have downloaded before.
I have fixed a bug when the program tried to clean temporary files in the
%TEMP%
directory, if you tried the first release check to see if you have any directories named
Generator+(numbers)
in your
%TEMP%
directory those are OK to delete.
jonib
Logged
MyDefrag script syntax highlighting generator
.
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #2 on:
August 02, 2009, 07:03:45 pm »
I have updated the first page with a new version.
It should now support all new syntax in MyDefrag 4.1.2.
I have added
TextPad
support.
If anybody is using this tool? I would like some feedback both positive or negative.
jonib
Logged
MyDefrag script syntax highlighting generator
.
jeroen
Administrator
JkDefrag Hero
Posts: 7155
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #3 on:
August 02, 2009, 09:59:52 pm »
Thanks for your contribution, I appreciate it. But it is not quite clear to me what your tool does. I have downloaded it and started it, and I get the screen as the snapshot here on the forum shows. But then what? What do I have to do? And more importantly, what does the program do? I have clicked the "Start" button and I see some windows and a progress bar flashing by, but then everything just closes. What has the program done?
Logged
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #4 on:
August 02, 2009, 10:38:13 pm »
Quote from: jeroen on August 02, 2009, 09:59:52 pm
But it is not quite clear to me what your tool does.
My tool will use the
Formal script grammar
from MyDefrag and generate/create a syntax highlighting config file that will be installed to any supported editor that is selected when pressing the start button.
Quote
I have downloaded it and started it, and I get the screen as the snapshot here on the forum shows.
Are any of the check marks checked?
Quote
But then what? What do I have to do? And more importantly, what does the program do? I have clicked the "Start" button and I see some windows and a progress bar flashing by, but then everything just closes. What has the program done?
I believe you use TextPad? When you press the start button and provided there ware no errors, there should be a
MyDefrag.syn
file in the same directory where the .exe was run that will also have been copied to
"TextPad install directory"\system
and if there was already a file with that name it would have been renamed
MyDefrag.syn.bak
, now in TextPad you need to add a new
Document Class
and the add MyDefrag.syn in the Syntax setting in the new document class, unfortunately there are no default syntax colors in TextPad you would need to define them in the new document class.
Hope this helps at least a little.
Edit: When the program has finished generating I'll add a popup with instructions how to activate the syntax highlighting in the specific editor.
jonib
«
Last Edit: August 02, 2009, 10:59:11 pm by jonib
»
Logged
MyDefrag script syntax highlighting generator
.
jeroen
Administrator
JkDefrag Hero
Posts: 7155
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #5 on:
August 02, 2009, 11:09:34 pm »
Quote from: jonib on August 02, 2009, 10:38:13 pm
Edit: When the program has finished generating I'll add a popup with instructions how to activate the syntax highlighting in the specific editor.
Yes, that would be very useful.
I have found the "MyDefrag.syn" file in the directory where I ran your tool. It has not copied the file to the textpad installation directory (in my case the default "c:\Program Files (x86)\TextPad 5" directory), but I have managed to do it myself. I already had an old .syn file from before, and have now replaced it with the new file from your tool. Thanks!
I notice that the tool creates keywords multiple times, if they occur in the grammar multiple times. For example the "All" keyword.
Logged
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #6 on:
August 02, 2009, 11:26:45 pm »
Quote from: jeroen on August 02, 2009, 11:09:34 pm
I have found the "MyDefrag.syn" file in the directory where I ran your tool. It has not copied the file to the textpad installation directory (in my case the default "c:\Program Files (x86)\TextPad 5" directory), but I have managed to do it myself. I already had an old .syn file from before, and have now replaced it with the new file from your tool. Thanks!
Great it works then
, If you had run my tool as administrator it would probably have worked.
It is beta so I'll need to refine it more to consider security settings and stuff, and my primary system still is Windows XP sp2 so I'll do some testing in Vista/W7.
Quote
I notice that the tool creates keywords multiple times, if they occur in the grammar multiple times. For example the "All" keyword.
Yes I know, There don't seem to be a problem with duplicate keywords in TextPad, so I don't know if it's worth the trouble to remove them.
jonib
Logged
MyDefrag script syntax highlighting generator
.
gemisigo
JkDefrag Hero
Posts: 110
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #7 on:
August 04, 2009, 12:15:05 am »
Could you perhaps include Notepad++ into the list of editors, please?
Logged
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #8 on:
August 04, 2009, 05:14:04 pm »
Quote from: gemisigo on August 04, 2009, 12:15:05 am
Could you perhaps include Notepad++ into the list of editors, please?
I have looked at Notepad++ and adding support should be no problem.
jonib
Logged
MyDefrag script syntax highlighting generator
.
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #9 on:
August 04, 2009, 09:02:02 pm »
Just a small bug alert.
jeroen and anybody else that installed the TextPad syntax highlighting with this tool, you probably have a extra path "
D:\Program\Util\TextPad 5\system
" with a
MyDefrag.syn
file, it's OK to delete this, I had forgotten
to change the fixed path to TextPad when adding support for it.
Edit: Looks like I overreacted, there probably won't be a path or file created.
jonib
«
Last Edit: August 04, 2009, 10:40:40 pm by jonib
»
Logged
MyDefrag script syntax highlighting generator
.
jeroen
Administrator
JkDefrag Hero
Posts: 7155
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #10 on:
August 04, 2009, 10:23:02 pm »
Thanks for the warning, but no such file on my computer. There isn't even a "D:\Program\" folder. Also no "MyDefrag.syn" file anywhere else on the D: disk, also not the C: disk.
Logged
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #11 on:
August 04, 2009, 10:37:44 pm »
Quote from: jeroen on August 04, 2009, 10:23:02 pm
Thanks for the warning, but no such file on my computer. There isn't even a "D:\Program\" folder. Also no "MyDefrag.syn" file anywhere else on the D: disk, also not the C: disk.
Heh, OK I checked the code and you would have gotten the "MyDefrag.syn" there if you already had a path "D:\Program\Util\TextPad 5\system", so not really a problem.
jonib
Logged
MyDefrag script syntax highlighting generator
.
jonib
JkDefrag Hero
Posts: 810
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #12 on:
August 11, 2009, 05:05:48 am »
I have update the Generator in the first post, still very much beta.
I have added
Notepad++
support both syntax and word completion.
Now it will try to put the TextPad syntax file in the correct install path and not the fixed path I used when adding it.
And it seems the previous versions ware not complete they ware missing a required dll 7z.dll that is needed to extract "Formal script grammar" from MyDefrags help file, so unless it was installed separately the Generator was unable to use the latest "Formal script grammar" from MyDefrag.
I also have tried to make any messages that may be displayed to be more informative.
Now there should not be anymore duplicate keywords in TextPads syntax file.
The Generator will try to install any created syntax files automatically when finished, but some Windows versions will block access to the "Program files" directory, so unless you run the Generator as administrator you would have to install the syntax files manually, check the documentation for your specific editor where to put the files, I will add better instructions later.
jonib
«
Last Edit: August 11, 2009, 05:11:03 am by jonib
»
Logged
MyDefrag script syntax highlighting generator
.
gemisigo
JkDefrag Hero
Posts: 110
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #13 on:
August 11, 2009, 08:58:18 am »
I downloaded the generator but it is exactly the same that I downloaded a few days ago, but it shows Textpad only, no Notepad++ included. Are you sure the link/file is updated?
Logged
torned
JkDefrag Senior
Posts: 22
Re: [Tool] MyDefrag script syntax highlighting generator
«
Reply #14 on:
August 11, 2009, 11:24:46 am »
thx Jonib, it works fine !
Logged
Pages: [
1
]
2
3
...
5
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
MyDefrag v4 Forum
-----------------------------
=> Announcements
=> Questions and help
=> Bugs and problems
=> Requests for new features
=> Scripts, and other contributions
-----------------------------
JkDefrag v3 Forum
-----------------------------
=> Announcements
=> Questions and help
=> Bugs and problems
=> Requests for new features
=> Programming with the library
Loading...