Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!haven!uvaarpa!mmdf From: cadence!gda!dovich@uunet.uu.net (Steven J. Dovich) Newsgroups: comp.lang.perl Subject: Re: perl-mode in elisp Message-ID: <1990Mar20.171458.8213@uvaarpa.Virginia.EDU> Date: 20 Mar 90 17:14:58 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: cadence!gda!dovich@uunet.uu.net Organization: The Internet Lines: 42 I have a perl-mode.el for GNU Emacs that I have derived from the c-mode.el distributed with the sources. Because of its derivation, this elisp source is copylefted. Features: * use of c-mode style parameters, for C-like indentation. * calls both 'c-mode-hook, and 'perl-mode-hook. From my .emacs file: (setq perl-mode-hook '(lambda () (goto-line 2) (if (not (re-search-backward "^#!/util/bin/perl" nil t)) (progn (goto-char 1) (insert "#!/util/bin/perl") (newline) (goto-char 1) )) )) This hook function installs the interpreter exec directive into the script file, if it isn't already there. Caveats: * The '$' character is treated as an ESCAPE syntax class, to remove comment status from the '#' charater in array length expressions. * Regular expressions are still an open issue for this perl-mode (since the RE delimiters can be nearly any character). The good news is that perl-mode does the right thing most of the time. -- Steven J. Dovich Cadence Design Systems 2 Lowell Research Center Dr. Lowell, MA 01852-4995 Phone: (508) 458-1900 x272