Function: meta-common-mode

meta-common-mode is an interactive and byte-compiled function defined in meta-mode.el.gz.

Signature

(meta-common-mode)

Documentation

Common initialization for Metafont or MetaPost mode.

In addition to any hooks its parent mode prog-mode might have run, this mode runs the hook meta-common-mode-hook, as the final or penultimate step during initialization.

C-M-a meta-beginning-of-defun
C-M-e meta-end-of-defun
C-M-h meta-mark-defun
C-M-i completion-at-point
C-M-q meta-indent-defun
C-c % meta-comment-defun
C-c : meta-uncomment-region
C-c ; meta-comment-region
C-c C-q b meta-indent-buffer
C-c C-q e meta-indent-defun
C-c C-q r meta-indent-region

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/meta-mode.el.gz
;;; Initialization.

(define-derived-mode meta-common-mode prog-mode "-Meta-common-"
  "Common initialization for Metafont or MetaPost mode."
  :abbrev-table meta-mode-abbrev-table
  (setq-local paragraph-start (concat page-delimiter "\\|$"))
  (setq-local paragraph-separate (concat page-delimiter "\\|$"))

  (setq-local paragraph-ignore-fill-prefix t)

  (setq-local comment-start-skip "%+[ \t\f]*")
  (setq-local comment-start "%")
  (setq-local comment-end "")
  (setq-local comment-multi-line nil)

  ;; We use `back-to-indentation' but \f is no indentation sign.
  (modify-syntax-entry ?\f "_   ")

  (setq-local parse-sexp-ignore-comments t)

  (add-hook 'completion-at-point-functions #'meta-completions-at-point nil t)
  (setq-local comment-indent-function #'meta-comment-indent)
  (setq-local indent-line-function #'meta-indent-line)
  ;; No need to define a mode-specific 'indent-region-function.
  ;; Simply use the generic 'indent-region and 'comment-region.

  ;; Set defaults for font-lock mode.
  (setq-local font-lock-defaults
              '(meta-font-lock-keywords
                nil nil ((?_ . "w")) nil
                (font-lock-comment-start-regexp . "%"))))