Function: pascal-mode

pascal-mode is an autoloaded, interactive and byte-compiled function defined in pascal.el.gz.

Signature

(pascal-mode)

Documentation

Major mode for editing Pascal code.TAB indents for Pascal code. Delete converts tabs to spaces as it moves back.

C-M-i (completion-at-point) completes the word around current point with respect to position in code M-? (completion-help-at-point) shows all possible completions at this point.

Other useful functions are:

C-M-h (pascal-mark-defun) - Mark function.
C-c C-b (pascal-insert-block) - insert begin ... end;
M-* (pascal-star-comment) - insert (* ... *)
C-c C-c (pascal-comment-area) - Put marked area in a comment, fixing nested comments.
C-c C-u (pascal-uncomment-area) - Uncomment an area commented with C-c C-c (pascal-comment-area).
C-M-a (pascal-beg-of-defun) - Move to beginning of current function.
C-M-e (pascal-end-of-defun) - Move to end of current function.
C-c C-d (pascal-goto-defun) - Goto function prompted for in the minibuffer.
C-c C-o (pascal-outline-mode) - Enter pascal-outline-mode(var)/pascal-outline-mode(fun).

Variables controlling indentation/edit style:

 pascal-indent-level(var)/pascal-indent-level(fun) (default 3)
    Indentation of Pascal statements with respect to containing block.
 pascal-case-indent (default 2)
    Indentation for case statements.
 pascal-auto-newline (default nil)
    Non-nil means automatically newline after semicolons and the punctuation
    mark after an end.
 pascal-indent-nested-functions (default t)
    Non-nil means nested functions are indented.
 pascal-tab-always-indent (default t)
    Non-nil means TAB in Pascal mode should always reindent the current line,
    regardless of where in the line point is when the TAB command is used.
 pascal-auto-endcomments (default t)
    Non-nil means a comment { ... } is set after the ends which ends cases and
    functions. The name of the function or case will be set between the braces.
 pascal-auto-lineup (default t)
    List of contexts where auto lineup of :'s or ='s should be done.

See also the user variables pascal-type-keywords, pascal-start-keywords and pascal-separator-keywords.

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

Probably introduced at or before Emacs version 19.29.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/pascal.el.gz
;;;###autoload
(define-derived-mode pascal-mode prog-mode "Pascal"
  "Major mode for editing Pascal code.\\<pascal-mode-map>
TAB indents for Pascal code.  Delete converts tabs to spaces as it moves back.

\\[completion-at-point] completes the word around current point with respect \
to position in code
\\[completion-help-at-point] shows all possible completions at this point.

Other useful functions are:

\\[pascal-mark-defun]\t- Mark function.
\\[pascal-insert-block]\t- insert begin ... end;
\\[pascal-star-comment]\t- insert (* ... *)
\\[pascal-comment-area]\t- Put marked area in a comment, fixing nested comments.
\\[pascal-uncomment-area]\t- Uncomment an area commented with \
\\[pascal-comment-area].
\\[pascal-beg-of-defun]\t- Move to beginning of current function.
\\[pascal-end-of-defun]\t- Move to end of current function.
\\[pascal-goto-defun]\t- Goto function prompted for in the minibuffer.
\\[pascal-outline-mode]\t- Enter `pascal-outline-mode'.

Variables controlling indentation/edit style:

 `pascal-indent-level' (default 3)
    Indentation of Pascal statements with respect to containing block.
 `pascal-case-indent' (default 2)
    Indentation for case statements.
 `pascal-auto-newline' (default nil)
    Non-nil means automatically newline after semicolons and the punctuation
    mark after an end.
 `pascal-indent-nested-functions' (default t)
    Non-nil means nested functions are indented.
 `pascal-tab-always-indent' (default t)
    Non-nil means TAB in Pascal mode should always reindent the current line,
    regardless of where in the line point is when the TAB command is used.
 `pascal-auto-endcomments' (default t)
    Non-nil means a comment { ... } is set after the ends which ends cases and
    functions. The name of the function or case will be set between the braces.
 `pascal-auto-lineup' (default t)
    List of contexts where auto lineup of :'s or ='s should be done.

See also the user variables `pascal-type-keywords', `pascal-start-keywords' and
`pascal-separator-keywords'."
  (setq-local local-abbrev-table pascal-mode-abbrev-table)
  (setq-local indent-line-function 'pascal-indent-line)
  (setq-local comment-indent-function 'pascal-indent-comment)
  (setq-local parse-sexp-ignore-comments nil)
  (setq-local blink-matching-paren-dont-ignore-comments t)
  (setq-local case-fold-search t)
  (setq-local comment-start "{")
  (setq-local comment-start-skip "(\\*+ *\\|{ *")
  (setq-local comment-end "}")
  (add-hook 'completion-at-point-functions 'pascal-completions-at-point nil t)
  ;; Font lock support
  (setq-local font-lock-defaults '(pascal-font-lock-keywords nil t))
  (setq-local syntax-propertize-function pascal--syntax-propertize)
  ;; Imenu support
  (setq-local imenu-generic-expression pascal-imenu-generic-expression)
  (setq-local imenu-case-fold-search t)
  ;; Pascal-mode's own hide/show support.
  (add-to-invisibility-spec '(pascal . t)))