[OS X Emacs] NCL mode in Aquamacs
david.reitter at gmail.com
Fri Jun 3 10:11:56 EDT 2011
This looks pretty good to me. You've done everything right. Perhaps the mode doesn't work correctly (is this chosen as the major mode when you load an NCL file? What happens when you do M-x ncl-mode RET?)
Let's use the mailing list (cc'ed) for further discussion please, so that other people can benefit.
On Jun 3, 2011, at 10:08 AM, Luis Cesáreo Cana Cascallar wrote:
> I've made the following changes:
> 1.- Added this piece of code in ~/Library/Preferences/Aquamacs Emacs/Preferences.el
> (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 "/Library/Application Support/Aquamacs Emacs/ncl.el") ; <<<<<<<<<pointing to the right place
> ; 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.
> ; highlight comments
> (set-face-foreground font-lock-comment-face "FireBrick")
> ; highlight strings
> (set-face-foreground font-lock-string-face "Salmon")
> ; highlight keywords, array descriptors, and tests
> (set-face-foreground font-lock-keyword-face "Purple")
> ; highlight built-in functions
> (set-face-foreground font-lock-builtin-face "Blue")
> ; highlight gsn* functions
> (set-face-foreground font-lock-variable-name-face "SteelBlue")
> ; highlight shea_util and contributed functions
> (set-face-foreground font-lock-function-name-face "CadetBlue")
> ; highlight resources
> (set-face-foreground font-lock-constant-face "ForestGreen")
> 2.- and I've placed ncl.el in ~/Library/Application Support/Aquamacs Emacs
> Then I restart Aquamacs -without any kind of warnings or so- but it seems that it doesn't recognize the ncl files. For example, I've opened a file called WPS_terrain.ncl but it doesn't change the 'look' of the code (no highlightes any part of the code). Am I doing something wrong or missing something?
> Or is it possible to pass this options and settings to Aquamacs through the Preferences panel (customize menu) on the right side?
More information about the MacOSX-Emacs