AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ahk-org-mode for EMACS (was Allow Multiple CommentFlags)

 
Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  

Allow Multiple CommentFlags
yes
33%
 33%  [ 3 ]
no
66%
 66%  [ 6 ]
Total Votes : 9

Author Message
tinku99



Joined: 03 Aug 2007
Posts: 399
Location: Houston, TX

PostPosted: Fri Sep 12, 2008 8:03 am    Post subject: ahk-org-mode for EMACS (was Allow Multiple CommentFlags) Reply with quote

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 Thu Apr 23, 2009 1:47 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DerRaphael



Joined: 23 Nov 2007
Posts: 738
Location: ~/.

PostPosted: Fri Sep 12, 2008 4:37 pm    Post subject: Reply with quote

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
_________________
    Code:
    /* no comment */
Back to top
View user's profile Send private message
tinku99



Joined: 03 Aug 2007
Posts: 399
Location: Houston, TX

PostPosted: Fri Sep 12, 2008 4:59 pm    Post subject: #CommentFlag Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DerRaphael



Joined: 23 Nov 2007
Posts: 738
Location: ~/.

PostPosted: Fri Sep 12, 2008 7:05 pm    Post subject: Reply with quote

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
_________________
    Code:
    /* no comment */
Back to top
View user's profile Send private message
tinku99



Joined: 03 Aug 2007
Posts: 399
Location: Houston, TX

PostPosted: Fri Sep 12, 2008 8:10 pm    Post subject: Operator Symbols Reply with quote

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 ";+")))
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tinku99



Joined: 03 Aug 2007
Posts: 399
Location: Houston, TX

PostPosted: Mon Dec 22, 2008 5:42 am    Post subject: code folding in emacs with selective display Reply with quote

http://emacs.wordpress.com/2007/01/16/quick-and-dirty-code-folding/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frankie



Joined: 02 Nov 2008
Posts: 828

PostPosted: Wed Dec 24, 2008 7:34 pm    Post subject: Re: code folding in emacs with selective display Reply with quote

tinku99 wrote:
http://emacs.wordpress.com/2007/01/16/quick-and-dirty-code-folding/
What does this have to do with the topic at all??
_________________
Click here to join #AHK channel in IRC for general chat and quick help.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group