File: opascal.el.html

To enter OPascal mode when you find an Object Pascal source file, one must override the auto-mode-alist to associate OPascal with
.pas (and .dpr and .dpk) files. Emacs, by default, will otherwise
enter Pascal mode. For example:

(add-to-list 'auto-mode-alist
             '("\\\\.\\\\(pas\\\\|dpr\\\\|dpk\\\\)\\\\'" . opascal-mode))

When you have entered OPascal mode, you may get more info by pressing C-h m.

This OPascal mode implementation is fairly tolerant of syntax errors, relying as much as possible on the indentation of the previous statement. This also makes it faster and simpler, since there is less searching for properly constructed beginnings.

Defined variables (54)

delphi-case-label-indentExtra indentation for case statement labels. E.g.
delphi-compound-block-indentExtra indentation for blocks in compound statements. E.g.
delphi-indent-levelIndentation of OPascal statements with respect to containing block.
delphi-mode-hookHook run after entering ‘opascal-mode’.
delphi-search-pathDirectories to search when finding external units.
delphi-tab-always-indentsNon-nil means ‘opascal-tab’ should always reindent the current line.
delphi-verboseIf true then OPascal token processing progress is reported to the user.
opascal-begin-enclosing-tokensTokens that a begin token indents from.
opascal-begin-previous-tokensTokens that a begin token aligns with, but only if not part of a nested routine.
opascal-binary-opsOPascal binary operations.
opascal-block-statementsStatements that contain multiple substatements.
opascal-body-expr-statementsStatements that have either a single statement or a block as a body and also
opascal-body-statementsStatements that have either a single statement or a block as a body.
opascal-case-label-indentExtra indentation for case statement labels. E.g.
opascal-class-typesClass types.
opascal-commentsTokens that represent comments.
opascal-composite-typesTypes that contain declarations within them.
opascal-compound-block-indentExtra indentation for blocks in compound statements. E.g.
opascal-debugNon-nil if in debug mode.
opascal-debug-bufferBuffer to write OPascal mode debug messages to. Created on demand.
opascal-debug-mode-mapKeystrokes for OPascal mode debug commands.
opascal-decl-delimitersStatements that a declaration statement should align with.
opascal-decl-matchersStatements that should match to declaration statement indentation.
opascal-decl-sectionsDenotes the start of a declaration section.
opascal-directivesOPascal4 directives.
opascal-enclosing-statementsDelimits an enclosing statement.
opascal-end-block-statementsStatements that end block sections.
opascal-expr-delimitersExpression delimiter tokens.
opascal-expr-statementsExpression statements contain expressions after their keyword.
opascal-font-lock-defaultsOPascal mode font-lock defaults. Syntactic fontification is ignored.
opascal-indent-levelIndentation of OPascal statements with respect to containing block.
opascal-interface-typesInterface types.
opascal-keywordsOPascal4 keywords.
opascal-match-block-statementsStatements that match the indentation of the parent block.
opascal-mid-block-statementsStatements that mark mid sections of the enclosing block.
opascal-mode-abbrev-tableAbbrev table in use in OPascal mode buffers.
opascal-mode-hookHook run after entering ‘opascal-mode’.
opascal-mode-mapKeymap used in OPascal mode.
opascal-mode-syntax-tableSyntax table for ‘opascal-mode’.
opascal-parsing-progress-stepNumber of chars to process before the next parsing progress report.
opascal-previous-enclosing-statementsDelimits a previous enclosing statement.
opascal-previous-statementsDelimits a previous statement.
opascal-previous-terminatorsExpression/statement terminators that denote a previous expression.
opascal-progress-last-reported-pointThe last point at which progress was reported.
opascal-routine-statementsMarks the start of a routine, or routine-ish looking expression.
opascal-scanning-progress-stepNumber of chars to process before the next scanning progress report.
opascal-search-pathDirectories to search when finding external units.
opascal-tab-always-indentsNon-nil means ‘opascal-tab’ should always reindent the current line.
opascal-unit-sectionsUnit sections within which the indent is 0.
opascal-unit-statementsStatements indented at level 0.
opascal-use-clausesStatements that refer to foreign symbols.
opascal-verboseIf true then OPascal token processing progress is reported to the user.
opascal-visibilitiesClass visibilities.
opascal-whitespaceTokens that are considered whitespace.

Defined functions (75)

delphi-mode()
opascal--scan-non-whitespace-backward(TOKEN-VAR LAST-VAR &rest PCASES)
opascal-block-start(FROM-TOKEN &optional STOP-ON-CLASS)
opascal-char-token-at(P CHAR KIND)
opascal-charset-token-at(P CHARSET KIND)
opascal-column-of(P)
opascal-comment-block-end(COMMENT)
opascal-comment-block-start(COMMENT)
opascal-comment-content-start(COMMENT)
opascal-comment-indent-of(COMMENT)
opascal-composite-type-start(TOKEN LAST-TOKEN)
opascal-debug-goto-point(P)
opascal-debug-log(FORMAT-STRING &rest ARGS)
opascal-debug-show-current-string(FROM TO)
opascal-debug-token-string(TOKEN)
opascal-debug-tokenize-region(FROM TO)
opascal-else-start(FROM-ELSE)
opascal-enclosing-indent-of(FROM-TOKEN)
opascal-ensure-buffer(BUFFER-VAR BUFFER-NAME)
opascal-explicit-token-at(P TOKEN-STRING KIND)
opascal-fill-comment()
opascal-find-current-body()
opascal-find-current-def()
opascal-find-current-xdef()
opascal-find-unit(UNIT)
opascal-find-unit-file(UNIT)
opascal-find-unit-in-directory(UNIT DIR)
opascal-group-end(FROM-TOKEN)
opascal-group-start(FROM-TOKEN)
opascal-in-token(P TOKEN)
opascal-indent-line()
opascal-indent-of(TOKEN &optional OFFSET)
opascal-is-block-after-expr-statement(TOKEN)
opascal-is-directory(PATH)
opascal-is-file(PATH)
opascal-is-literal-end(P)
opascal-is-simple-class-type(AT-TOKEN LIMIT-TOKEN)
opascal-is-use-clause-end(AT-TOKEN LAST-TOKEN LAST-COLON FROM-KIND)
opascal-line-indent-of(FROM-TOKEN &optional OFFSET &rest TERMINATORS)
opascal-literal-kind(P)
opascal-literal-start-pattern(LITERAL-KIND)
opascal-literal-stop-pattern(LITERAL-KIND)
opascal-literal-token-at(P)
opascal-log-msg(TO-BUFFER THE-MSG)
opascal-looking-at-string(P S)
opascal-match-token(TOKEN LIMIT)
opascal-mode()
opascal-new-comment-line()
opascal-next-line-start(&optional FROM-POINT)
opascal-next-token(TOKEN)
opascal-next-visible-token(TOKEN)
opascal-on-first-comment-line(COMMENT)
opascal-open-group-indent(TOKEN LAST-TOKEN &optional OFFSET)
opascal-point-token-at(P KIND)
opascal-previous-indent-of(FROM-TOKEN)
opascal-previous-token(TOKEN)
opascal-progress-done(&rest MSGS)
opascal-save-excursion(&rest FORMS)
opascal-search-directory(UNIT DIR &optional RECURSE)
opascal-section-indent-of(SECTION-TOKEN)
opascal-set-token-end(TOKEN END)
opascal-set-token-kind(TOKEN TO-KIND)
opascal-set-token-start(TOKEN START)
opascal-space-token-at(P)
opascal-step-progress(P DESC STEP-SIZE)
opascal-stmt-line-indent-of(FROM-TOKEN &optional OFFSET)
opascal-string-of(START END)
opascal-tab()
opascal-token-at(P)
opascal-token-end(TOKEN)
opascal-token-kind(TOKEN)
opascal-token-of(KIND START END)
opascal-token-start(TOKEN)
opascal-token-string(TOKEN)
opascal-word-token-at(P)

Defined faces (0)