Editor enhancement for Aquamacs

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 06 2011 - 10:00:05 MDT

Hi all,

Luis Cana sent me an email with information on how to enhance the Mac
"Aquamacs" editor for NCL scripts. He gave me permission to repost his
message below, and I've included this contribution on the editor
enhancements page:

http://www.ncl.ucar.edu/Applications/editor.shtml#aquamacs

----------------------------------------------------------------------------------------------------------------------------------

This is my contribution to the Editor Enhancements page. I currently
use Aquamacs ( see http://aquamacs.org), a free editor based on the
GNU Emacs but with a deep integration in Mac OSX. These are the steps
following some recommendations of David Reiter, the main developer and
maintainer of Aquamacs:

1. Download ncl.el file(the same for Emacs) and put it on the system.

        David Reiter's suggestion: /YOUR-HOME-DIRECTORY/Library/Application
Support/Aquamacs Emacs

2. Add the following piece of code in /YOUR-HOME-DIRECTORY/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 "/YOUR-HOME-DIRECTORY/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")
           )
      )
  ;====================================

And that's all!

If there is any problem, one should check first which is the Major Mode:

Mode Line (at bottom of screen).

M-x ncl-mode RET will enter the mode manually

Another possibility is just adding to the FIRST LINE of the ncl script
this single line:

; -*- mode: ncl;-*-

This trick switch the mode to NCL. Finally, attached I send you the
Aquamacs NCL mode screenshot (using the SkewT script):

Regards,

Luis

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 6 10:00:22 2011

This archive was generated by hypermail 2.1.8 : Thu Jun 09 2011 - 14:56:48 MDT