Is there an emacs mode?? [message #4097] |
Mon, 24 April 1995 00:00  |
phil
Messages: 15 Registered: April 1995
|
Junior Member |
|
|
I was wondering if anyone out there had an emacs mode for writing IDL .pro files.
/*********************************************************** ****************/
Phil Williams
Postdoctoral Researcher "One man gathers what
MRI Facility another man spills..."
The Ohio State University -The Grateful Dead
email: phil@peace.med.ohio-state.edu
URL: http://justice.med.ohio-state.edu:1525
/*********************************************************** ****************/
|
|
|
|
|
|
Re: Is there an emacs mode?? [message #4192 is a reply to message #4097] |
Fri, 05 May 1995 00:00  |
davis
Messages: 15 Registered: March 1995
|
Junior Member |
|
|
The latest version of JED (emacs-like editor) is now able to do color syntax
highlighting in its idl mode. It happens automatically when .pro files are
loaded. Below, I have appended `idl.sl' which sets up the syntax
highlighting. You can get the latest version of JED from
space.mit.edu:/pub/davis/jed. The latest version is 0.97-7.
----- idl.sl ------------
% idl mode color syntax highlighting. Requires 0.97-6 or later
create_syntax_table ("IDL");
define_syntax (";", "", '%', "IDL");
define_syntax ("([{", ")]}", '(', "IDL");
define_syntax ('"', '"', "IDL");
define_syntax ('\'', '\'', "IDL");
define_syntax ('\\', '\\', "IDL");
define_syntax ("0-9a-zA-Z_", 'w', "IDL"); % words
define_syntax ("-+0-9a-fA-F.xXL", '0', "IDL"); % Numbers
define_syntax (",.?:", ',', "IDL");
define_syntax ("%-+/&*=<>|!~^", '+', "IDL");
define_syntax ('@', '#', "IDL");
set_syntax_flags ("IDL", 1); % case insensitive
% These are IDL reserved words
() = define_keywords ("IDL", "doeqgegtifleltneofor", 2);
() = define_keywords ("IDL", "andendformodnotproxor", 3);
() = define_keywords ("IDL", "caseelsegotothen", 4);
() = define_keywords ("IDL", "beginendifuntilwhile", 5);
() = define_keywords ("IDL", "commonendforendrependwhirepeatreturn", 6);
() = define_keywords ("IDL", "endcaseendelse", 7);
() = define_keywords ("IDL", "endwhilefunctionon_error", 8);
() = define_keywords ("IDL", "ennrepeat", 9);
() = define_keywords ("IDL", "on_ioerror", 10);
define idl_mode ()
{
variable idl = "IDL";
setmode (idl, 0);
use_syntax_table (idl);
runhooks ("idl_mode_hook");
% This is called after the hook to give the hook a chance to load the
% abbrev table.
if (abbrev_table_p (idl)) use_abbrev_table (idl);
}
|
|
|
Re: Is there an emacs mode?? [message #4198 is a reply to message #4097] |
Fri, 05 May 1995 00:00  |
chase
Messages: 62 Registered: May 1993
|
Member |
|
|
>>>> > "Tim" == Tim Patterson <patterso@astrosun.tn.cornell.edu> writes:
In article <3o8atn$2qr@newsstand.cit.cornell.edu> patterso@astrosun.tn.cornell.edu (Tim Patterson) writes:
Tim> Does anybody also know of a "hilite" setup for IDL in Emacs - one
Tim> that will show my wonderful program in pretty colours?
Here are the hilit patterns used by idl.el:
(defvar idl-hilit-patterns
'(("\\s ;.*" nil comment)
("^;.*" nil comment)
("\"[^\\\"\\\n]*\"" nil string)
("'[^'\\\n]*'" nil string)
("\\< \\(and\\|begin\\|case\\|common\\|do\\|else\\|end\\|endcase\\ |endelse\\|endfor\\|endif\\|endrep\\|endwhile\\|eq\\|for\\|f unction\\|ge\\|goto\\|gt\\|if\\|le\\|lt\\|mod\\|ne\\|not\\|o f\\|on_ioerror\\|or\\|pro\\|repeat\\|return\\|then\\|until\\ |while\\|xor\\)\\ >" nil keyword)
)
"List of patterns and associated font faces for hilit.el.
See hilit19.el for documentation. ")
The following code sets the above patterns for idl-mode buffers:
(if (featurep 'hilit19)
(hilit-set-mode-patterns 'idl-mode idl-hilit-patterns nil t))
Change 'idl-mode in the above to whatever mode you use for editing IDL
".pro" files. You would probably place the above in your .emacs file.
Chris
--
===============================
Bldg 24-E188
The Applied Physics Laboratory
The Johns Hopkins University
Laurel, MD 20723-6099
(301)953-6000 x8529
chris.chase@jhuapl.edu
|
|
|