NCL Emacs Mode
Functionality includes
- Indents two spaces between begin and end statments
- Indents two spaces within do loops and if statments
- Highlighting (chose your colors)
- NCL Reserved words
- gsn_csm plot templates
- Select NCL built-in functions
- Select Contributed fucntions
- Shea_util functions
- Comments
Issues that remain
- If you don't like the colors, choose your own.
- Not all built-in functions are included
Controlling your emacs window:
Add and modify the following to your .Xdefaults if desired
Emacs.geometry: 80x38+250+10
Emacs*background: antique white
Emacs*foreground: black
Emacs.pane.menubar.background: peachpuff
Emacs.menu*.background: peachpuff
Emacs.cursorColor: red3
Emacs.font: 10x20
Emacs.pane.menubar.font: 10x20
Steps
- Download the ncl.el file and put it on your system.
- Put the following text in your .emacs file: (note, if you do not want my colors, you can change them here or not include this portion in your .emacs file)
(setq auto-mode-alist (cons '("\.ncl$" . ncl-mode) auto-mode-alist))
; this line associates ncl-mode with the lisp package that defines it.
(autoload 'ncl-mode "~murphys/bin/ncl.el")
; a hook is a list of functions that get executed under certain
; conditions.
(add-hook 'ncl-mode-hook
(lambda () ; lambda is an anonymous function. e.g. has no name.
;;setup display colors for font-lock
(set-face-foreground font-lock-comment-face "FireBrick")
(set-face-foreground font-lock-string-face "Salmon")
(set-face-foreground font-lock-keyword-face "Purple")
; select built-in functions
(set-face-foreground font-lock-function-name-face "Blue")
; gsn* functions
(set-face-foreground font-lock-variable-name-face "SteelBlue")
; shea_util and contributed functions
(set-face-foreground font-lock-reference-face "CadetBlue")
)
)