     (define-key map "\C-c\M-\C-h" 'pir-mark-block)
     (define-key map "\C-c]" 'pir-close-block)
     (define-key map "\C-c\C-f" 'pir-insert-defun)
-    
     map)
   "Keymap for PIR major mode.")
 


Keybindings
===========
\\{octave-mode-map}

Variables you can use to customize PIR mode
===========================================

(defvar pir-register-regexp "[INPS]\\([12][0-9]\\|3[01]\\|[0-9]\\)")
(defvar pir-dollar-register-regexp "\\$[INPS][0-9]+")

(defvar pir-directives
  '("method" "non_prototyped" "prototyped" "@LOAD" "@MAIN"))

(defvar pir-dotted-directives
  '(".sub" ".pcc_sub" ".end" ".emit" ".eom" ".const" ".namespace"
    ".endnamespace" ".result" ".arg" ".return" ".include"
    ".pcc_begin" ".pcc_end" ".pcc_begin_return" ".pcc_end_return"
    ".pcc_begin_yield" ".pcc_end_yield"))

(defvar pir-variable-declarations
  '(".local" ".sym" ".param"))

(defvar pir-begin-keywords
  '(".sub" ".emit" ".pcc_begin_yield" ".pcc_begin_return"
    ".pcc_begin" ".namespace"))

(defvar pir-end-keywords
  '(".end" ".eom" ".pcc_end_yield" ".pcc_end_return"
    ".pcc_end" ".endnamespace"))

(defvar pir-block-match-alist
  '((".sub" ".end" 1)
    (".emit" ".eom" 1)
    (".pcc_begin_yield" ".pcc_end_yield" 0)
    (".pcc_begin_return" ".pcc_end_return" 0)
    (".pcc_begin" ".pcc_end" 0)
    (".namespace" ".endnamespace" 0))
  "Alist of IMCC's matching block keywords.
Has IMCC's begin keywords as keys and a list of the matching end keywords as
associated values.")

(defvar pir-block-offset-alist
  (mapcan (lambda (blockspec)
	    (let ((offset (caddr blockspec)))
	      `((,(car blockspec) . ,offset)
		(,(cadr blockspec) . ,offset))))
	  pir-block-match-alist))

(defvar pir-open-directives
  (mapcar #'car pir-block-match-alist))

(defvar pir-close-directives
  (mapcar #'cadr pir-block-match-alist))

(defvar pir-block-begin-regexp
  (regexp-opt pir-begin-keywords 'paren))

(defvar pir-block-end-regexp
  (regexp-opt pir-end-keywords 'paren))

(defvar pir-block-begin-or-end-regexp
  (concat "\\(?:" pir-block-begin-regexp "\\|"
	  pir-block-end-regexp "\\)"))

(defvar pir-function-header-regexp "\\.\\(.sub\\)\\s-+\\(\\sw+\\)"
  "Regexp to match a PIR function header.")

(defvar pir-font-lock-keywords
  `((,(concat "^\\s *\\(.sub\\)\\s +\\(\\sw+\\)"
	      "\\(\\s +" (regexp-opt pir-directives 'paren) "\\)?")
     (1 font-lock-keyword-face)
     (2 font-lock-function-name-face t t)
     (4 font-lock-keyword-face t t))
    (,(concat "\\s-*" (regexp-opt pir-variable-declarations 'paren)
	      "\\(?:\\s +" (regexp-opt pir-type-keywords 'paren)
	      "\\(?:\\s +\\(\\sw+\\)\\)?\\)?")
     (1 font-lock-keyword-face)
     (2 font-lock-type-face nil t)
     (3 font-lock-variable-name-face nil t))
    (,(concat "^\\s *\\(.const\\)\\s +"
	      (regexp-opt pir-type-keywords 'paren)
	      "\\(\\s +\\(\\sw+\\)\\)?")
     (1 font-lock-keyword-face)
     (2 font-lock-type-face nil t)
     (4 font-lock-constant-face nil t))
    (,pir-block-begin-or-end-regexp . font-lock-keyword-face)

    (,pir-dollar-register-regexp . font-lock-variable-name-face)
    (,pir-register-regexp . font-lock-variable-name-face)
    (,(regexp-opt pir-dotted-directives 'paren) . font-lock-keyword-face)
    (,(regexp-opt pir-ops 'words) . font-lock-keyword-face)
    ("\\s-*\\(\\sw+\\)\\s-*"
     (1 font-lock-variable-name-face)))
  "Expressions to highlight in PIR mode.")

(defvar pir-imenu-generic-expression
  (list
   (list nil pir-function-header-regexp 2))
  "Imenu expression for PIR mode.  See `imenu-generic-expression'.")

(defun pir-comment ()
  "Convert an empty comment to a `larger' kind, or start a new one.
These are the known comment classes:
