;;; cl-mode.el --- major mode for editing IRAF CL script files ;; ;; Copyright (C) 1998 Gregory D. Wirth ;; ;; Author: Gregory D. Wirth (wirth@keck.hawaii.edu) ;; Keywords: languages ;; Version: 1.0 dated 11 Mar 1998 ;; ;; This file is not part of the GNU Emacs distribution but is ;; intended for use with GNU Emacs. ;;; To enable use of this package, place the following lines in ;;; your .emacs file and uncomment them: ;; (autoload 'cl-mode ;; "cl-mode" ;; "Major mode for editing IRAF CL scripts" t) ;; (setq auto-mode-alist ;; (append ;; '(("\\.cl$" . cl-mode)) ;; '(("\\.x$" . cl-mode)) ;; '(("mkpkg" . cl-mode)) ;; auto-mode-alist)) ;;; Commentary: ;; This package provides commands for editing IRAF CL script files. ;;; Code: (defvar cl-mode-map () "Keymap used in CL mode.") (if cl-mode-map () (setq cl-mode-map (make-sparse-keymap)) (define-key cl-mode-map "\M-;" 'indent-for-comment) (define-key cl-mode-map "\C-c;" 'comment-region) (define-key cl-mode-map "\C-c-" 'cl-insert-separator) ) (defun cl-mode () "Major mode for editing IRAF Command Language scripts. Basically like Fundamental mode, with support for comments. Key definitions: \\{cl-mode-map} Turning on Cl mode calls the value of the variable `cl-mode-hook', if that value is non-nil." (interactive) (kill-all-local-variables) (setq mode-name "Cl") (setq major-mode 'cl-mode) (use-local-map cl-mode-map) (make-local-variable 'require-final-newline) (setq require-final-newline t) (make-local-variable 'comment-start) (setq comment-start "# ") (make-local-variable 'comment-end) (setq comment-end "") (make-local-variable 'comment-column) (setq comment-column 32) (make-local-variable 'comment-start-skip) (setq comment-start-skip "#+ *") (setq tab-width 4) (run-hooks 'cl-mode-hook)) ;;; Define a command to insert my standard separator (defun cl-insert-separator () "Insert a comment separator line in the current buffer." (interactive "*") (insert "#-----------------------------------------------------------------------\n")) ;;; cl-mode.el ends here