| Xemacs, lisp help 
 
	 
	
		| Author | Message |   
		| MrUmunhum 
 
 
 
 
 | 
			
				|  Posted: 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:
 
 First line of file will start with "/* ". 
I have tried these test without success:File name does not end with .c, .cpp, .h or .hpp
 
   (if (looking-at "\/\* ") 'display-warning :warning "Rexx") 
Does anyone have any URLs that could help me with my problem?(if (looking-at "\[/* ]") 'display-warning :warning "Rexx")
 (if (looking-at "^\/\* ") 'display-warning :warning "hello")
 
   
 I forgot, I am using FC8.
 |  
				|  |  |   
		|  |  |  
	  
		|  |   
		| Sponsor Sponsor
 
  
   |  |   
		|  |   
		| btiffin 
 
  
 
 
 | 
			
				|  Posted: 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
 would work, but	  | code: |  	  | $str = "/* ";
if ($str =~ m%[/][*][ ]%) {print "$str is comment";}
 | 
 would be required if you were using the usual slash delim.	  | code: |  	  | $str = "/* ";
if ($str =~ m/[\/][*][ ]/) {print "$str is comment";}
 | 
 
 There are other re expressions that would work, but I like simple, quick grok, than brain backtracking over escapes when possible.
 
 Cheers
 |  
				|  |  |   
		|  |  |  
	  
		|  |   
		|  |  
 |