AutoHotkey Community

It is currently May 26th, 2012, 12:14 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 

Allow Multiple CommentFlags
yes
no
You may select 1 option

View results
Author Message
PostPosted: September 12th, 2008, 8:03 am 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
I wanted to use org-mode for emacs to do code folding in .ahk scripts
I thought being able to change the #Directives flag from # to something else would help, so the wish for multiple comment flags... probably wouldn't help.

Anyways, I solved the issue by combining ahk-mode with org-mode into ahk-org-mode. Git repository here: also includes related lisp-org-mode.

;; *** FEATURES***
;; - syntax highlighting
;; - indention, completion and command help (bound to "C-c TAB")
;; - lookup the docs on a command via w3m with F1
;; - search and browse ahk-forums in w3m with F2
;; - code folding using ';' as the headline delimiter instead of '*'
;; - integration with w3m for browsing the ahk-documentation and forums


Last edited by tinku99 on April 23rd, 2009, 1:47 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2008, 4:37 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
helpfile wrote:
#CommentFlag

--------------------------------------------------------------------------------

Changes the script's comment symbol from semicolon to some other string.

#CommentFlag NewString

Parameters
NewString One or more characters that should be used as the new comment flag. Up to 15 characters may be specified.


greets
dR

or did u mean something else?

btw i doubt its a wise thing to use * as a commentchar by itself, since it would break following code

Code:
msgbox % "The result of the current multiplication of 5x5 is " 5
             * 5 " whereas 5x6 is " 5*6


remarks: #commentflag does not allow * being used as a commentchar (at least it doesnt work on my pc)

greets
dR

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject: #CommentFlag
PostPosted: September 12th, 2008, 4:59 pm 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
Hi DerRaphael,
Thanks for the response.
I did mean #CommentFlag

This works:
#CommentFlag `*
* this is a comment
msgbox % "The result of the current multiplication of 5x5 is " 5
* 5 " whereas 5x6 is " 5*6

This doesn't work:
#CommentFlag `*;
* this is a comment
; this is a comment also * this line gives an error

The #CommentFlag allows a single CommentFlagString. Note, its not #CommentFlags or #CommentFlagStrings, which is my wish.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2008, 7:05 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
This works but gets rather confusing
Code:
#CommentFlag ; `*

MsgBox % "blah " 5
       * 5 " = 5x5 " 10
* comment      
      ; test
      
comment := 10

MsgBox % "blah " 5
       * 5 " = 5x5 " 10
* comment      


1st msgbox displays blah 25 = 5x5 and the 2nd one displays blah 25 = 5x5 100

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Operator Symbols
PostPosted: September 12th, 2008, 8:10 pm 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
Yeah, the results do seem undefined / difficult to predict.

I guess to allow "*" as a CommentFlag, ahk would have to allow changing symbols of operators:

Code:
#MultiplyOperator  ~
CommentFlag *
result := 3 ~ 5             ;; result = 15


Changing the headline flag in org-mode to ";" is not perfect, but I'll explore:
(add-hook 'org-mode-hook '(lambda () (setq outline-regexp ";+")))


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 22nd, 2008, 5:42 am 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
http://emacs.wordpress.com/2007/01/16/quick-and-dirty-code-folding/


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 24th, 2008, 7:34 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
tinku99 wrote:
What does this have to do with the topic at all??

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 1st, 2011, 4:45 pm 
Frankie wrote:
tinku99 wrote:
What does this have to do with the topic at all??


hello, this is not working. I downloaded the copy from git, but it still doesn't work.

the orginal ahk-mode script works fine for me. some ideas why this is the case?


Report this post
Top
  
Reply with quote  
PostPosted: April 1st, 2011, 5:18 pm 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
download autocomplete mode first.
you can also try using the syntax directory included in the git repo if you still have problems.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2011, 8:12 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
How do I install this? Where?

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2011, 8:23 pm 
Frankie wrote:
How do I install this? Where?

http://www.emacswiki.org/emacs/AutoComplete


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2011, 8:28 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
I read through the whole page. It didn't mention installation. Can you tell me the path to install to? I want syntax highlighting mainly. Auto-complete is cool, but I might remove it at a later time.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2011, 10:52 pm 
Frankie wrote:
I read through the whole page. It didn't mention installation. Can you tell me the path to install to? I want syntax highlighting mainly. Auto-complete is cool, but I might remove it at a later time.
There is nothing to install, you just add the folder to your load-path, and
(load-file ahk-org-mode.el)
and then load an ahk file in emacs, or turn on ahk-org-mode, by running
M-x ahk-org-mode

its in the readme:
Code:
;; Place this file somewhere in your load-path, byte-compile it and add the
;; following line to your ~/.xemacs/init.el resp. ~/.emacs:
;;
;; (setq ahk-syntax-directory "PATHTO/AutoHotkey/Extras/Editors/Syntax/")
;; (add-to-list 'auto-mode-alist '("\\.ahk$" . ahk-org-mode))
;; (autoload 'ahk-org-mode "ahk-org-mode")


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: jyloup and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group