Welcome Guest.   Make a donation to an author on the site October 22, 2014, 08:41:14 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Autohotkey added to geshi syntax highlighting feature on forum  (Read 6064 times)
mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: June 01, 2010, 07:21:45 PM »

Autohotkey has been added to the list of languages the forum knows how to color syntax highlight in posts.

To highlight code for a language, select the text and then choose the language from the "Code Highlighting" drop down combo box, on the Post form.

ps. thanks to dc member ewemoa for getting me to update to latest version of geshi that supports ahk; huge thanks to the geshi open source project.
Logged
skwire
Global Moderator
*****
Posts: 4,113



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: June 01, 2010, 07:30:06 PM »

Nice.
Logged

ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #2 on: June 01, 2010, 07:46:02 PM »

Thank you, mouser, for the update and your continued efforts  Thmbsup
Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: June 01, 2010, 08:11:41 PM »

Thanks for taking the trouble to implement that!
Logged

Chris
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: June 01, 2010, 08:55:26 PM »

Thank you to both, mouser and ewemoa for their efforts.. Thmbsup
Logged

mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: June 01, 2010, 09:00:42 PM »

all thanks should go to geshi -- i didn't do much more than download the latest zip file smiley
Logged
mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: June 01, 2010, 09:15:33 PM »

following ewemoa's suggestion i made a meager $10 donation to geshi's sourceforge donation account on behalf of dc members.
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #7 on: June 01, 2010, 09:35:22 PM »

Thanks Thmbsup
Logged
skwire
Global Moderator
*****
Posts: 4,113



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: June 01, 2010, 09:48:54 PM »

Is there any way we can adjust the colours used for that AHK highlighter?  I much prefer the colours used for the AutoIt highlighter.
Logged

ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #9 on: June 02, 2010, 12:15:22 AM »

I'm comparing GeSHi's autoit.php with autohotkey.php:

autoit.php
Formatted for PHP with the GeSHI Syntax Highlighter [copy or print]
  1.       'KEYWORDS' => array(
  2.            1 => 'color: #0000FF; font-weight: bold;',
  3.            2 => 'color: #800000; font-weight: bold;',
  4.            3 => 'color: #000080; font-style: italic; font-weight: bold;',
  5.            4 => 'color: #0080FF; font-style: italic; font-weight: bold;',
  6.            5 => 'color: #F000FF; font-style: italic;',
  7.            6 => 'color: #A00FF0; font-style: italic;'
  8.            ),
  9.        'COMMENTS' => array(
  10.            'MULTI' => 'font-style: italic; color: #669900;',
  11.            0 => 'font-style: italic; color: #009933;',
  12.            1 => 'font-style: italic; color: #9977BB;',
  13.            ),
  14.        'ESCAPE_CHAR' => array(
  15.            0 => ''
  16.            ),
  17.        'BRACKETS' => array(
  18.            0 => 'color: #FF0000; font-weight: bold;'
  19.            ),
  20.        'STRINGS' => array(
  21.            0 => 'font-weight: bold; color: #9977BB;'
  22.            ),
  23.        'NUMBERS' => array(
  24.            0 => 'color: #AC00A9; font-style: italic; font-weight: bold;'
  25.            ),
  26.        'METHODS' => array(
  27.            1 => 'color: #0000FF; font-style: italic; font-weight: bold;'
  28.            ),
  29.        'SYMBOLS' => array(
  30.            0 => 'color: #FF0000; font-weight: bold;'
  31.            ),
  32.        'REGEXPS' => array(
  33.            0 => 'font-weight: bold; color: #AA0000;'
  34.            ),

autohotkey.php
Formatted for PHP with the GeSHI Syntax Highlighter [copy or print]
  1.       'KEYWORDS' => array(
  2.            1 => 'color: #AAAAFF; font-weight: bold;',       // reserved #blue
  3.            2 => 'color: #88FF88;',                         // BIV yellow
  4.            3 => 'color: #FF00FF; font-style: italic;',       // commands purple
  5.            4 => 'color: #888844; font-weight: bold;',       // functions #0080FF
  6.            5 => 'color: #000000; font-style: italic;',    // directives #black
  7.            6 => 'color: #FF0000; font-style: italic;',      // hotkeys #red
  8.            7 => 'color: #000000; font-style: italic;',    // gui commands #black
  9.            8 => 'color: #000000; font-style: italic;'      // gui controls
  10.            ),
  11.        'COMMENTS' => array(
  12.            'MULTI' => 'font-style: italic; color: #669900;',
  13.            1 => 'font-style: italic; color: #009933;'
  14.            ),
  15.        'ESCAPE_CHAR' => array(
  16.            0 => ''
  17.            ),
  18.        'BRACKETS' => array(
  19.            0 => 'color: #00FF00; font-weight: bold;'
  20.            ),
  21.        'STRINGS' => array(
  22.            0 => 'font-weight: bold; color: #008080;'
  23.            ),
  24.        'NUMBERS' => array(
  25.            0 => 'color: #0000dd;'
  26.            ),
  27.        'METHODS' => array(
  28.            1 => 'color: #0000FF; font-style: italic; font-weight: italic;'
  29.            ),
  30.        'SYMBOLS' => array(
  31.            0 => 'color: #000000; font-weight: italic;'
  32.            ),
  33.        'REGEXPS' => array(
  34.            0 => 'font-weight: italic; color: #A00A0;',
  35.            1 => 'color: #CC0000; font-style: italic;',
  36.            2 => 'color: #DD0000; font-style: italic;',
  37.            3 => 'color: #88FF88;'
  38.            ),

Perhaps the following would work as a change:

Formatted for PHP with the GeSHI Syntax Highlighter [copy or print]
  1.       'KEYWORDS' => array(
  2.            1 => 'color: #0000FF; font-weight: bold;', // reserved
  3.            2 => 'color: #800000; font-weight: bold;', // BIV
  4.            3 => 'color: #000080; font-style: italic; font-weight: bold;', // commands
  5.            4 => 'color: #0080FF; font-style: italic; font-weight: bold;', // functions
  6.            5 => 'color: #F000FF; font-style: italic;', // directives
  7.            6 => 'color: #FF0000; font-style: italic;', // hotkeys #red
  8.            7 => 'color: #000000; font-style: italic;', // gui commands #black
  9.            8 => 'color: #000000; font-style: italic;'  // gui controls
  10.            ),
  11.        'COMMENTS' => array(
  12.            'MULTI' => 'font-style: italic; color: #669900;',
  13.            1 => 'font-style: italic; color: #009933;'
  14.            ),
  15.        'ESCAPE_CHAR' => array(
  16.            0 => ''
  17.            ),
  18.        'BRACKETS' => array(
  19.            0 => 'color: #FF0000; font-weight: bold;'
  20.            ),
  21.        'STRINGS' => array(
  22.            0 => 'font-weight: bold; color: #9977BB;'
  23.            ),
  24.        'NUMBERS' => array(
  25.            0 => 'color: #AC00A9; font-style: italic; font-weight: bold;'
  26.            ),
  27.        'METHODS' => array(
  28.            1 => 'color: #0000FF; font-style: italic; font-weight: bold;'
  29.            ),
  30.        'SYMBOLS' => array(
  31.            0 => 'color: #FF0000; font-weight: italic;'
  32.            ),
  33.        'REGEXPS' => array(
  34.            0 => 'font-weight: italic; color: #A00A0;',
  35.            1 => 'color: #CC0000; font-style: italic;',
  36.            2 => 'color: #DD0000; font-style: italic;',
  37.            3 => 'color: #88FF88;'
  38.            ),

It looks like autohotkey.php groups 'while', 'if', 'else', and 'return' separately from commands though they are listed as commands in the AHK docs.

Also, autohotkey.php doesn't appear to mention 'static', 'global', 'local', or 'ByRef'.

Perhaps it's worth checking out the content of Extras\Editors\Syntax\...
« Last Edit: June 02, 2010, 12:19:17 AM by ewemoa » Logged
mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: June 02, 2010, 06:57:13 PM »

i've uploaded ewemoa's modification -- the colors look a lot better now.
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #11 on: June 02, 2010, 07:09:05 PM »

Here are some sample shots:







Note: colors were not the only things changed -- some additions (e.g. global, local, etc were missing) and deletions (e.g. there was both a While and a while, so I removed the latter -- and similar things) were made too.  Perhaps discussion with the author of autohotkey.php might be worthwhile...
Logged
skwire
Global Moderator
*****
Posts: 4,113



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #12 on: June 03, 2010, 12:15:15 AM »

Agreed, that's a helluva lot better.  Thanks, ewemoa & mouser.
Logged

nudone
Cody's Creator
Columnist
***
Posts: 4,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: June 03, 2010, 01:48:51 AM »

lovely. any idea if i can port this to notepad++ without lots of editing?
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #14 on: June 03, 2010, 04:33:42 AM »

Sorry, no idea.
Logged
nudone
Cody's Creator
Columnist
***
Posts: 4,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: June 03, 2010, 04:56:34 AM »

Sorry, no idea.
okay, thanks. i'll see if i can figure it out.
Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: June 03, 2010, 05:55:50 AM »

maybe this could help with AHK syntax highlighting in Notepad++.

http://www.autohotkey.com...rum/viewtopic.php?t=58792
Logged

ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #17 on: June 03, 2010, 06:13:38 AM »

Interesting find, lanux128  thumbs up

I tried it out:


Logged
nudone
Cody's Creator
Columnist
***
Posts: 4,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: June 03, 2010, 06:54:41 AM »

i've got some kind of autohotkey syntax highlighting currently working in Notepad++ but it doesn't look like the image above. it must have been from a different ahk forum thread, so i'll try the one you've mentioned, lanux128.

i'm almost happy with the one i'm using but it doesn't appear to know when to colour match curly braces { }.
Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: June 03, 2010, 06:58:27 AM »

thanks, ewemoa. do you use Notepad++ as well? for editors with well formed syntax highlighters, one could try SciTE4AutoHotkey, PSPad or Notepad2 but NPP is slowly getting there.. smiley


@nudone: this is a newer version, tweaked by the uploader from that thread because as he put it, "I am a notepad++ user and was totally disappointed with the userDefined.xml lexer because it has certain limitations that the user cant overcome, and on top of that adding a language is a pain."  you should try it.. smiley
Logged

nudone
Cody's Creator
Columnist
***
Posts: 4,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: June 03, 2010, 07:44:00 AM »

found the one i'm using: http://www.autohotkey.com/forum/topic53288.html



not tried anything else yet.
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #21 on: June 03, 2010, 04:17:14 PM »

thanks, ewemoa. do you use Notepad++ as well?
What comes to mind at the moment, concerning my Notepad++ usage is:

  • Replacing across multiple files via regular expressions
  • Quick view of a file


Quote
for editors with well formed syntax highlighters, one could try SciTE4AutoHotkey
Thanks for the SciTE4AutoHotkey link!  When I looked this time, I spotted the portable version, so may be I will give it a try.  Somehow I had the impression that there wasn't a portable version so I had not tried it before.  Reminds me of the potential value of continuing to check for some things -- things change, and things can be missed Wink

I have tried PSPad and Notepad2 as well.  The former I had various difficulties with so when Notepad++ appeared on the radar...The latter I didn't end up using enough to give a fair assessment.

Update: Saw the following text regarding the non-zip download for SciTE4AutoHotkey:

Quote
Despite being an installer, the installation can be portable (uncheck the default editor box).

Sounds nice  thumbs up
« Last Edit: June 03, 2010, 05:55:26 PM by ewemoa » Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #22 on: June 03, 2010, 05:29:25 PM »

Thanks for the SciTE4AutoHotkey link!  When I looked this time, I spotted the portable version, so may be I will give it a try.
I have tried it now.  It looks quite interesting.


Update: Sorry, forgot to post some shots of the highlighting (below is what I got by default):







Now for some with the included psp style:





« Last Edit: June 03, 2010, 06:27:18 PM by ewemoa » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.3s | Server load: 0.09 ]