Computer Science Canada Xemacs, lisp help |
Author: | MrUmunhum [ Sun Apr 27, 2008 4:28 pm ] |
Post subject: | Xemacs, lisp help |
Hi group, I need some help with my init.el. I am trying to call a mod for Rexx when I load a rexx file. I don't want to use the file type option (prog.rex). I want to define a rexx file as:
File name does not end with .c, .cpp, .h or .hpp
(if (looking-at "\[/* ]") 'display-warning :warning "Rexx") (if (looking-at "^\/\* ") 'display-warning :warning "hello") ![]() I forgot, I am using FC8. |
Author: | btiffin [ Sun Apr 27, 2008 10:16 pm ] | ||||
Post subject: | Re: Xemacs, lisp help | ||||
I'm not a regex guru, but try [/][*][ ] as your pattern. regex square brackets are ANY ONE OF tests, so [/* ] (aside from the escaping looking-at may need) would match / or * or space, not the three chars as a sequence. If I remember correctly, the only thing that needs to be escaped in square brackets is caret, and then whatever may be the regex delimiters. For example in perl
There are other re expressions that would work, but I like simple, quick grok, than brain backtracking over escapes when possible. Cheers |