]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/meta-mode.el
Changed version to 1.2.1.
[gnu-emacs] / lisp / progmodes / meta-mode.el
index 61753c9ef86a947adff2548b7afc8eca6252d126..fff1a39e7a527f27d698cd73cfaf70ae50650af9 100644 (file)
 ;; package or as a separate Emacs Lisp package.
 
 ;; Installation:
-;;
-;; Install this file (meta-mode.el) in your personal or system-wide
-;; Emacs Lisp directory and add these lines to your startup files:
-;;
-;;  (autoload 'metafont-mode "meta-mode" "Metafont editing mode." t)
-;;  (autoload 'metapost-mode "meta-mode" "MetaPost editing mode." t)
-;;
-;;  (setq auto-mode-alist
-;;        (append '(("\\.mf\\'" . metafont-mode)
-;;                  ("\\.mp\\'" . metapost-mode)) auto-mode-alist))
 ;; 
 ;; An interface to running Metafont or MetaPost as a shell process
 ;; from within Emacs is currently under development as a separate
 
 (require 'easymenu)
 
+(defgroup meta-font nil
+  "Major mode for editing Metafont or MetaPost sources."
+  :group 'languages)
+
 ;;; Fontification.
 
 (defvar meta-font-lock-keywords
          (cons (concat "\\<" input-keywords "\\>"
                        "[ \t]+\\(\\sw+\\)")
                '((1 font-lock-keyword-face)
-                 (2 font-lock-reference-face)))
+                 (2 font-lock-constant-face)))
          ;; embedded Metafont/MetaPost code in comments
          (cons "|\\([^|]+\\)|" 
-               '(1 font-lock-reference-face t))
+               '(1 font-lock-constant-face t))
      ))
   "Default expressions to highlight in Metafont or MetaPost mode.")
 
@@ -539,35 +533,50 @@ If the list was changed, sort the list and remove duplicates first."
 \f
 ;;; Indentation.
 
-(defvar meta-indent-level 2
-  "*Indentation of begin-end blocks in Metafont or MetaPost mode.")
+(defcustom meta-indent-level 2
+  "*Indentation of begin-end blocks in Metafont or MetaPost mode."
+  :type 'integer
+  :group 'meta-font)
 
 
-(defvar meta-left-comment-regexp "%%+"
-  "*Regexp matching comments that should be placed on the left margin.")
+(defcustom meta-left-comment-regexp "%%+"
+  "*Regexp matching comments that should be placed on the left margin."
+  :type 'regexp
+  :group 'meta-font)
 
-(defvar meta-right-comment-regexp nil
-  "*Regexp matching comments that should be placed to the right margin.")
+(defcustom meta-right-comment-regexp nil
+  "*Regexp matching comments that should be placed to the right margin."
+  :type '(choice regexp
+                (const :tag "None" nil))
+  :group 'meta-font)
 
-(defvar meta-ignore-comment-regexp "%[^%]"
-  "*Regexp matching comments that whose indentation should not be touched.")
+(defcustom meta-ignore-comment-regexp "%[^%]"
+  "*Regexp matching comments that whose indentation should not be touched."
+  :type 'regexp
+  :group 'meta-font)
 
 
-(defvar meta-begin-environment-regexp
+(defcustom meta-begin-environment-regexp
   (concat "\\(begin\\(char\\|fig\\|gr\\(aph\\|oup\\)\\|logochar\\)\\|"
           "def\\|for\\(\\|ever\\|suffixes\\)\\|if\\|mode_def\\|"
           "primarydef\\|secondarydef\\|tertiarydef\\|vardef\\)")
-  "*Regexp matching the beginning of environments to be indented.")
+  "*Regexp matching the beginning of environments to be indented."
+  :type 'regexp
+  :group 'meta-font)
 
-(defvar meta-end-environment-regexp
+(defcustom meta-end-environment-regexp
   (concat "\\(end\\(char\\|def\\|f\\(ig\\|or\\)\\|gr\\(aph\\|oup\\)\\)"
           "\\|fi\\)")
-  "*Regexp matching the end of environments to be indented.")
+  "*Regexp matching the end of environments to be indented."
+  :type 'regexp
+  :group 'meta-font)
 
-(defvar meta-within-environment-regexp
+(defcustom meta-within-environment-regexp
 ; (concat "\\(e\\(lse\\(\\|if\\)\\|xit\\(if\\|unless\\)\\)\\)")
   (concat "\\(else\\(\\|if\\)\\)")
-  "*Regexp matching keywords within environments not to be indented.")
+  "*Regexp matching keywords within environments not to be indented."
+  :type 'regexp
+  :group 'meta-font)
 
 
 (defun meta-comment-indent ()
@@ -764,14 +773,18 @@ and initial semicolons."
 \f
 ;;; Editing commands.
 
-(defvar meta-begin-defun-regexp
+(defcustom meta-begin-defun-regexp
   (concat "\\(begin\\(char\\|fig\\|logochar\\)\\|def\\|mode_def\\|"
           "primarydef\\|secondarydef\\|tertiarydef\\|vardef\\)")
-  "*Regexp matching beginning of defuns in Metafont or MetaPost mode.")
+  "*Regexp matching beginning of defuns in Metafont or MetaPost mode."
+  :type 'regexp
+  :group 'meta-font)
 
-(defvar meta-end-defun-regexp
+(defcustom meta-end-defun-regexp
   (concat "\\(end\\(char\\|def\\|fig\\)\\)")
-  "*Regexp matching the end of defuns in Metafont or MetaPost mode.")
+  "*Regexp matching the end of defuns in Metafont or MetaPost mode."
+  :type 'regexp
+  :group 'meta-font)
 
 
 (defun meta-beginning-of-defun (&optional arg)
@@ -977,16 +990,24 @@ The environment marked is the one that contains point or follows point."
 \f
 ;;; Hook variables.
 
-(defvar meta-mode-load-hook nil
-  "*Hook evaluated when first loading Metafont or MetaPost mode.")
-
-(defvar meta-common-mode-hook nil
-  "*Hook evaluated by both `metafont-mode' and `metapost-mode'.")
-
-(defvar metafont-mode-hook nil
-  "*Hook evaluated by `metafont-mode' after `meta-common-mode-hook'.")
-(defvar metapost-mode-hook nil
-  "*Hook evaluated by `metapost-mode' after `meta-common-mode-hook'.")
+(defcustom meta-mode-load-hook nil
+  "*Hook evaluated when first loading Metafont or MetaPost mode."
+  :type 'hook
+  :group 'meta-font)
+
+(defcustom meta-common-mode-hook nil
+  "*Hook evaluated by both `metafont-mode' and `metapost-mode'."
+  :type 'hook
+  :group 'meta-font)
+
+(defcustom metafont-mode-hook nil
+  "*Hook evaluated by `metafont-mode' after `meta-common-mode-hook'."
+  :type 'hook
+  :group 'meta-font)
+(defcustom metapost-mode-hook nil
+  "*Hook evaluated by `metapost-mode' after `meta-common-mode-hook'."
+  :type 'hook
+  :group 'meta-font)
 
 
 \f