File: js.el.html

This is based on Karl Landstrom's barebones javascript-mode. This is much more robust and works with cc-mode's comment filling
(mostly).

The main features of this JavaScript mode are syntactic highlighting (enabled with font-lock-mode(var)/font-lock-mode(fun) or global-font-lock-mode(var)/global-font-lock-mode(fun)), automatic indentation and filling of comments, and C preprocessor fontification.

General Remarks:

XXX: This mode assumes that block comments are not nested inside block XXX: comments

Exported names start with "js-"; private names start with
"js--".

Defined variables (91)

js--available-frameworksList of available JavaScript frameworks symbols.
js--basic-type-reRegular expression matching any predefined type in JavaScript.
js--cache-endLast valid buffer position for the ‘js-mode’ function cache.
js--class-stylesList of JavaScript class definition styles.
js--constant-reRegular expression matching any future reserved words in JavaScript.
js--cpp-name-reRegexp matching a C preprocessor name.
js--declaration-keyword-reRegular expression matching variable declaration keywords.
js--dotted-name-reRegexp matching a dot-separated sequence of JavaScript names.
js--extjs-class-decl-re-1Regexp matching an ExtJS class declaration (style 1).
js--extjs-class-decl-re-2Regexp matching an ExtJS class declaration (style 2).
js--font-lock-keywordsFont lock keywords for ‘js-mode’. See ‘font-lock-keywords’.
js--font-lock-keywords-1Level one font lock keywords for ‘js-mode’.
js--font-lock-keywords-2Level two font lock keywords for ‘js-mode’.
js--font-lock-keywords-3Level three font lock for ‘js-mode’.
js--function-heading-1-reRegexp matching the start of a JavaScript function header.
js--function-heading-2-reRegexp matching the start of a function entry in an associative array.
js--function-heading-3-reRegexp matching a line in the JavaScript form "var MUMBLE = function".
js--indent-operator-reRegexp matching operators that affect indentation of continued expressions.
js--keyword-reRegexp matching any JavaScript keyword.
js--last-parse-posLatest parse position reached by ‘js--ensure-cache’.
js--line-terminating-arrow-reRegexp matching the last "=>" (arrow) token on a line.
js--macro-decl-reRegexp matching a CPP macro definition, up to the opening parenthesis.
js--mochikit-class-reRegexp matching a MochiKit class declaration.
js--name-reRegexp matching a JavaScript identifier, without grouping.
js--name-start-reRegexp matching the start of a JavaScript identifier, without grouping.
js--objfield-reRegexp matching the start of a JavaScript object field.
js--opt-cpp-startRegexp matching the prefix of a cpp directive.
js--plain-class-reRegexp matching a JavaScript explicit prototype "class" declaration.
js--plain-method-reRegexp matching an explicit JavaScript prototype "method" declaration.
js--possibly-braceless-keyword-reRegexp matching keywords optionally followed by an opening brace.
js--prettify-symbols-alistAlist of symbol prettifications for JavaScript.
js--quick-match-reAutogenerated regexp used by ‘js-mode’ to match buffer constructs.
js--quick-match-re-funcAutogenerated regexp used by ‘js-mode’ to match constructs and functions.
js--state-at-last-parse-posParse state at ‘js--last-parse-pos’.
js--symbol-historyHistory of entered JavaScript symbols.
js--syntax-propertize-regexp-regexpRegular expression matching a JavaScript regexp literal.
js--treesit-font-lock-settingsTree-sitter font-lock settings.
js--treesit-jsdoc-beginning-regexpRegular expression matching the beginning of a jsdoc block comment.
js--treesit-keywordsJavaScript keywords for tree-sitter font-locking.
js--treesit-lhs-identifier-queryQuery that captures identifier and query_identifier.
js--treesit-operatorsJavaScript operators for tree-sitter font-locking.
js--treesit-sentence-nodesNodes that designate sentences in JavaScript.
js--treesit-sexp-nodesNodes that designate sexps in JavaScript.
js--unary-keyword-reRegexp matching unary operator keywords.
js-base-mode-abbrev-tableAbbrev table for ‘js-base-mode’.
js-base-mode-hookHook run after entering ‘js-base-mode’.
js-base-mode-mapKeymap for ‘js-base-mode’.
js-base-mode-syntax-tableSyntax table for ‘js-base-mode’.
js-chain-indentUse "chained" indentation.
js-comment-lineup-funcLineup function for ‘cc-mode-style’, for C comments in ‘js-mode’.
js-curly-indent-offsetNumber of additional spaces for indenting expressions in curly braces.
js-enabled-frameworksFrameworks recognized by ‘js-mode’.
js-expr-indent-offsetNumber of additional spaces for indenting continued expressions.
js-flat-functionsTreat nested functions as top-level functions in ‘js-mode’.
js-indent-align-list-continuationAlign continuation of non-empty ([{ lines in ‘js-mode’.
js-indent-first-initNon-nil means specially indent the first variable declaration’s initializer.
js-indent-levelNumber of spaces for each indentation step in ‘js-mode’.
js-js-switch-tabsWhether ‘js-mode’ should display tabs while selecting them.
js-js-timeoutReply timeout for executing commands in Mozilla via ‘js-mode’.
js-js-tmpdirTemporary directory used by ‘js-mode’ to communicate with Mozilla.
js-json-mode-abbrev-tableAbbrev table for ‘js-json-mode’.
js-json-mode-hookHook run after entering ‘js-json-mode’.
js-json-mode-mapKeymap for ‘js-json-mode’.
js-jsx--attribute-name-reLike ‘js--name-re’, but matches “-” as well.
js-jsx--font-lock-keywordsJSX font lock faces and multiline text properties.
js-jsx--indent-attribute-lineLine relative to which indentation uses JSX as a baseline.
js-jsx--indent-colBaseline column for JS indentation within JSX.
js-jsx--self-closing-reRegexp matching the end of a self-closing JSXOpeningElement.
js-jsx--tag-start-reRegexp unambiguously matching a JSXOpeningElement.
js-jsx--text-propertiesPlist of text properties added by ‘js-syntax-propertize’.
js-jsx-align->-with-<When non-nil, “>” will be indented to the opening “<” in JSX.
js-jsx-attribute-offsetSpecifies a delta for JSXAttribute indentation.
js-jsx-detect-syntaxWhen non-nil, automatically detect whether JavaScript uses JSX.
js-jsx-indent-levelWhen non-nil, indent JSX by this value, instead of like JS.
js-jsx-mode-abbrev-tableAbbrev table for ‘js-jsx-mode’.
js-jsx-mode-hookHook run after entering ‘js-jsx-mode’.
js-jsx-mode-mapKeymap for ‘js-jsx-mode’.
js-jsx-mode-syntax-tableSyntax table for ‘js-jsx-mode’.
js-jsx-regexpsCase-sensitive regexps for detecting JSX in JavaScript buffers.
js-jsx-syntaxWhen non-nil, parse JavaScript with consideration for JSX syntax.
js-mode-abbrev-tableAbbrev table for ‘js-mode’.
js-mode-hookHook run after entering ‘js-mode’.
js-mode-mapKeymap for ‘js-mode’.
js-mode-syntax-tableSyntax table for ‘js-mode’ and ‘js-ts-mode’.
js-paren-indent-offsetNumber of additional spaces for indenting expressions in parentheses.
js-square-indent-offsetNumber of additional spaces for indenting expressions in square braces.
js-switch-indent-offsetNumber of additional spaces for indenting the contents of a switch block.
js-syntactic-mode-nameIf non-nil, print enabled syntaxes in the mode name.
js-ts-mode-abbrev-tableAbbrev table for ‘js-ts-mode’.
js-ts-mode-hookHook run after entering ‘js-ts-mode’.
js-ts-mode-mapKeymap for ‘js-ts-mode’.

Defined functions (137)

copy-js--pitem(ARG)
javascript-mode()
js--array-comp-indentation(BRACKET FOR-KWD)
js--backward-syntactic-ws(&optional LIM)
js--backward-text-property(PROPNAME)
js--beginning-of-defun-flat()
js--beginning-of-defun-nested()
js--beginning-of-defun-raw()
js--beginning-of-macro(&optional LIM)
js--broken-arrow-terminates-line-p()
js--chained-expression-p()
js--class-decl-matcher(LIMIT)
js--continued-expression-p()
js--ctrl-statement-indentation()
js--debug(&rest ARGUMENTS)
js--end-of-defun-flat()
js--end-of-defun-nested()
js--end-of-do-while-loop-p()
js--ensure-cache(&optional LIMIT)
js--ensure-cache--pop-if-ended(OPEN-ITEMS PAREN-DEPTH)
js--ensure-cache--update-parse()
js--fill-c-advice(JS-FUN)
js--find-newline-backward()
js--flush-caches(&optional BEG IGNORED)
js--fontify-template-string(NODE OVERRIDE START END &rest _)
js--forward-destructuring-spec(&optional FUNC)
js--forward-expression()
js--forward-function-decl()
js--forward-syntactic-ws(&optional LIM)
js--forward-text-property(PROPNAME)
js--function-prologue-beginning(&optional POS)
js--get-all-known-symbols()
js--get-c-offset(SYMBOL ANCHOR)
js--guess-function-name(POSITION)
js--imenu-create-index()
js--imenu-to-flat(ITEMS PREFIX SYMBOLS)
js--indent-in-array-comp(BRACKET)
js--inside-dojo-class-list-p()
js--inside-param-list-p()
js--inside-pitem-p(PITEM)
js--looking-at-operator-p()
js--make-framework-matcher(FRAMEWORK &rest REGEXPS)
js--make-merged-item(ITEM CHILD NAME-PARTS)
js--maybe-goto-declaration-keyword-end(PARSE-STATUS)
js--maybe-join(PREFIX SEPARATOR SUFFIX &rest LIST)
js--maybe-make-marker(LOCATION)
js--multi-line-declaration-indentation()
js--parse-state-at-point()
js--pitem-add-child(PITEM CHILD)
js--pitem-b-end(CL-X)
js--pitem-b-end--cmacro(CL-WHOLE-ARG CL-X)
js--pitem-children(CL-X)
js--pitem-children--cmacro(CL-WHOLE-ARG CL-X)
js--pitem-format(PITEM)
js--pitem-goto-h-end(PITEM)
js--pitem-h-begin(CL-X)
js--pitem-h-begin--cmacro(CL-WHOLE-ARG CL-X)
js--pitem-name(CL-X)
js--pitem-name--cmacro(CL-WHOLE-ARG CL-X)
js--pitem-paren-depth(CL-X)
js--pitem-paren-depth--cmacro(CL-WHOLE-ARG CL-X)
js--pitem-strname(PITEM)
js--pitem-type(CL-X)
js--pitem-type--cmacro(CL-WHOLE-ARG CL-X)
js--pitems-to-imenu(PITEMS UNKNOWN-CTR)
js--proper-indentation(PARSE-STATUS)
js--pstate-is-toplevel-defun(PSTATE)
js--re-search-backward(REGEXP &optional BOUND NOERROR COUNT)
js--re-search-backward-inner(REGEXP &optional BOUND COUNT)
js--re-search-forward(REGEXP &optional BOUND NOERROR COUNT)
js--re-search-forward-inner(REGEXP &optional BOUND COUNT)
js--read-symbol(SYMBOLS-TABLE PROMPT &optional INITIAL-INPUT)
js--regexp-opt-symbol(LIST)
js--same-line(POS)
js--skip-term-backward()
js--skip-terms-backward()
js--splice-into-items(ITEMS CHILD NAME-PARTS)
js--split-name(STRING)
js--syntactic-context-from-pstate(PSTATE)
js--syntactic-mode-name-part()
js--syntax-propertize-extend-region(START END)
js--treesit-defun-name(NODE)
js--treesit-font-lock-compatibility-definition-feature()
js--treesit-fontify-assignment-lhs(NODE OVERRIDE START END &rest _)
js--treesit-valid-imenu-entry(NODE)
js--unary-keyword-p(STRING)
js--update-quick-match-re()
js--variable-decl-matcher(LIMIT)
js--which-func-joiner(PARTS)
js-base-mode()
js-beginning-of-defun(&optional ARG)
js-c-fill-paragraph(&optional JUSTIFY)
js-end-of-defun(&optional ARG)
js-fill-paragraph(&optional JUSTIFY)
js-find-symbol(&optional ARG)
js-font-lock-syntactic-face-function(STATE)
js-indent-line()
js-json-mode()
js-jsx--at-enclosing-tag-child-p()
js-jsx--comment-region(BEG END &optional ARG)
js-jsx--context()
js-jsx--contextual-indentation(LINE CONTEXT)
js-jsx--detect-after-change(BEG END LEN)
js-jsx--detect-and-enable(&optional ARBITRARILY)
js-jsx--enclosing-curly-pos()
js-jsx--enclosing-tag-pos()
js-jsx--expr-attribute-pos(START LIMIT)
js-jsx--expr-indentation(PARSE-STATUS POS COL)
js-jsx--goto-outermost-enclosing-curly(LIMIT)
js-jsx--indentation(PARSE-STATUS)
js-jsx--looking-at-start-tag-p()
js-jsx--looking-back-at-end-tag-p()
js-jsx--match-attribute-name(LIMIT)
js-jsx--match-expr(LIMIT)
js-jsx--match-tag-beg(LIMIT)
js-jsx--match-tag-end(LIMIT)
js-jsx--match-tag-name(LIMIT)
js-jsx--match-text(LIMIT)
js-jsx--matched-tag-type()
js-jsx--matching-close-tag-pos()
js-jsx--syntax-propertize-extend-region(START END)
js-jsx--syntax-propertize-tag(END)
js-jsx--syntax-propertize-tag-text(END)
js-jsx--text-range(BEG END)
js-jsx--treesit-indent-compatibility-bb1f97b()
js-jsx-enable()
js-jsx-indent-line()
js-jsx-mode()
js-mode()
js-syntactic-context()
js-syntax-propertize(START END)
js-syntax-propertize-regexp(END)
js-ts--syntax-propertize(BEG END)
js-ts-mode()
js-use-syntactic-mode-name()
make-js--pitem
make-js--pitem--cmacro

Defined faces (0)