From owner-help-octave at bevo dot che dot wisc dot edu Wed Nov 8 09:18:36 1995 Subject: Re: Emacs mode for octave From: "John C. Campbell" To: help-octave at che dot utexas dot edu Date: Wed, 08 Nov 95 09:18:26 -0600 "Hr. Meier" wrote: | Hello, | | does anybody know if there exists an emacs-mode for octave ? | There is an octave-mode.el distributed with octave-1.1.1.tar.gz. I do not know if it was distributed with earlier version. I looked at the tar file on our machines (ftp.che.wisc.edu) to make sure it was there. I have also started using emacs font-lock-mode for octave. I'm no lisp expert (hell, I'm no lisp novice), but I found some help to do this. See the code below. As you can imagine from the colors I chose that my clothes rarely match. I did have to change the octave-mode.el to ignore ' as a quote character. That means that I have to use " for quotes for the colors to work. This is not MATLAB compatible so I sent them a message and complained. Version 5.0 will accept both ' and " as a quote (all right, maybe not, but it would be nice if MATLAB would try to get Octave compatible). If you have a better color scheme send it to me. John (autoload 'octave-mode "octave" nil t) (setq auto-mode-alist (cons '("\\.m$" . octave-mode) auto-mode-alist)) (setq octave-mode-hook (list 'turn-on-abbrevs 'turn-on-auto-fill 'turn-on-font-lock)) (defun turn-on-font-lock () (if (eq window-system 'x) (progn (font-lock-mode) (set-face-foreground 'font-lock-function-name-face "LightSkyBlue") (set-face-foreground 'font-lock-keyword-face "Wheat") (set-face-foreground 'font-lock-reference-face "Aquamarine") (set-face-foreground 'font-lock-string-face "Salmon") (set-face-foreground 'font-lock-type-face "PaleGreen") (set-face-foreground 'font-lock-variable-name-face "LightGoldenrod") (set-face-foreground 'font-lock-comment-face "IndianRed")))) -------- John C. Campbell : Dept. of Chemical Engineering jcc at bevo dot che dot wisc dot edu : University of Wisconsin-Madison phone: (608)265-2378 : 1415 Engineering Dr. fax: (608)262-5434 : Madison, WI 53706-1691