summaryrefslogtreecommitdiff
path: root/test/manual/indent
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Fix typosStefan Kangas2023-01-151-1/+1
|
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* ; Fix typosStefan Kangas2022-07-141-1/+1
|
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | perl-mode: Recognize "when"/"given" keywordsStefan Kangas2021-12-271-0/+12
|/ | | | | | | | * lisp/progmodes/perl-mode.el (perl-font-lock-keywords-2): Add keywords "when", "given" and "default". (Bug#10560) (perl--syntax-exp-intro-keywords): Add "printf". * test/manual/indent/perl.perl: Add test for "when"/"given".
* Update SCSS test file syntax.Philipp Stephani2021-06-181-2/+4
| | | | | | | | | | | According to https://sass-lang.com/documentation/breaking-changes/slash-div, the slash operator should be replaced by 'math.div'. Fixed using the migration tool mentioned at https://sass-lang.com/documentation/breaking-changes/slash-div#automatic-migration. * test/manual/indent/scss-mode.scss: Remove slash operator.
* * lisp/files.el (file-modes-number-to-symbolic): Add `filetype` arg.Stefan Monnier2021-04-121-0/+23
| | | | | * lisp/tar-mode.el (tar-header-block-summarize): Use it. (tar-grind-file-mode): Declare obsolete.
* * lisp/progmodes/sh-script.el (sh-smie-sh-rules): Tweak indent of new `for`Stefan Monnier2021-01-261-0/+7
| | | | | The new `for (TEST) { BODY }` syntax introduces various challenges. This patch just fixes a trivial subcase.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* * lisp/progmodes/perl-mode.el: Fix handling of s'foo'bar'Stefan Monnier2020-12-051-0/+14
| | | | | | | | | | (perl-syntax-propertize-function): Don't put a syntax-property on regexp-op delimiters if they're already handled correctly by the normal syntax tables. (perl-syntax-propertize-special-constructs): Mark the middle quote of s'foo'bar' as punctuation. * test/manual/indent/perl.perl: Add new test cases.
* * test/manual/indent/tcl.tcl: Add string interpolation caseStefan Monnier2020-11-201-0/+4
|
* * lisp/progmodes/tcl.el: Better match Tcl string formation rules (bug#39277)Stefan Monnier2020-10-291-0/+22
| | | | | | | | | (tcl--word-delimiters): New const. (tcl--syntax-of-quote): New function. (tcl-syntax-propertize-function): Use them. (tcl-mode): Enable `syntax-propertize-multiline`. * test/manual/indent/tcl.tcl: New file.
* Convert manual js indent tests to unit testsStefan Kangas2020-10-1813-740/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/progmodes/js-tests.el (ert-x): Require. (js-deftest-indent): New macro. Use it to define tests for indenting the below files. * test/manual/indent/js-chain.js: * test/manual/indent/js-indent-align-list-continuation-nil.js: * test/manual/indent/js-indent-init-dynamic.js: * test/manual/indent/js-indent-init-t.js: * test/manual/indent/js.js: * test/manual/indent/jsx-align-gt-with-lt.jsx: * test/manual/indent/jsx-comment-string.jsx: * test/manual/indent/jsx-indent-level.jsx: * test/manual/indent/jsx-quote.jsx: * test/manual/indent/jsx-self-closing.jsx: * test/manual/indent/jsx-unclosed-1.jsx: * test/manual/indent/jsx-unclosed-2.jsx: * test/manual/indent/jsx.jsx: Move from here... * test/lisp/progmodes/js-resources/js-chain.js: * test/lisp/progmodes/js-resources/js-indent-align-list-continuation-nil.js: * test/lisp/progmodes/js-resources/js-indent-init-dynamic.js: * test/lisp/progmodes/js-resources/js-indent-init-t.js: * test/lisp/progmodes/js-resources/js.js: * test/lisp/progmodes/js-resources/jsx-align-gt-with-lt.jsx: * test/lisp/progmodes/js-resources/jsx-comment-string.jsx: * test/lisp/progmodes/js-resources/jsx-indent-level.jsx: * test/lisp/progmodes/js-resources/jsx-quote.jsx: * test/lisp/progmodes/js-resources/jsx-self-closing.jsx: * test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx: * test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx: * test/lisp/progmodes/js-resources/jsx.jsx: ...to here.
* Convert a manual test for nxml-mode to unit testStefan Kangas2020-09-211-10/+0
| | | | | | * test/manual/indent/nxml.xml: Delete file. * test/lisp/nxml/nxml-mode-tests.el (nxml-mode-test-comment-bug-17264): New test based on deleted file.
* Convert manual indent test for ruby-mode into unit testStefan Kangas2020-09-211-477/+0
| | | | | | | | | * test/manual/indent/ruby.rb: Move from here... * test/lisp/progmodes/ruby-mode-resources/ruby.rb: ...to here. * test/lisp/progmodes/ruby-mode-tests.el (ruby-mode-tests-data-dir): New variable. (ruby--indent/converted-from-manual-test): New test.
* Convert manual indent test for scheme-mode into unit testStefan Kangas2020-09-211-9/+0
| | | | | | * test/manual/indent/scheme.scm: Delete file. * test/lisp/progmodes/scheme-tests.el: New file with unit test for scheme-mode based on deleted file.
* Convert manual indent test for ps-mode into unit testStefan Kangas2020-09-211-14/+0
| | | | | | * test/manual/indent/ps-mode.ps: Delete file. * test/lisp/progmodes/ps-mode-tests.el (ps-mode-test-indent): New unit test based on deleted file.
* Convert manual indent test for opascal-mode into unit testStefan Kangas2020-09-211-12/+0
| | | | | | * test/manual/indent/opascal.pas: Delete file. * test/lisp/progmodes/opascal-tests.el: New file with unit test for oposcal-mode based on deleted file.
* Convert manual indent test for lisp-mode into unit testStefan Kangas2020-09-211-5/+0
| | | | | | * test/manual/indent/lisp.lisp: Delete file. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-defun): New unit test based on deleted file.
* Convert manual indent test for elisp-mode into unit testStefan Kangas2020-09-211-6/+0
| | | | | | * test/manual/indent/elisp.el: Delete file. * test/lisp/progmodes/elisp-mode-tests.el (elisp-indent-basic): New unit test based on deleted file.
* ; Fix more trivial typosStefan Kangas2020-09-211-1/+1
|
* Convert indent test for css-mode into automatic testStefan Kangas2020-09-101-100/+0
| | | | | | | | * test/lisp/textmodes/css-mode-tests.el (css-mode-test-indent): New test. (css-mode-tests-data-dir): New variable. * test/manual/indent/css-mode.css: Move from here... * test/lisp/textmodes/css-mode-resources/test-indent.css: ...to here.
* ; * test/manual/indent/elisp.el: Use lexical-binding.Stefan Kangas2020-09-101-0/+1
|
* * lisp/emacs-lisp/lisp-mode.el: Add new indentation conventionakater2020-05-292-0/+10
| | | | | | (calculate-lisp-indent): To distinguish code and data when indenting, introduce the convention that a space between an open paren and a symbol indicate that this should be indented as a simple data list.
* Allow underscores in CSS variable namesSimen Heggestøyl2020-05-103-0/+18
| | | | | | | | | | | | | | * lisp/textmodes/css-mode.el (css-nmchar-re): Allow underscores in variable names (and in identifiers in general). * test/manual/indent/css-mode.css: Add some examples of variable names with underscores in them. * test/manual/indent/less-css-mode.less: Add some examples of variable names with underscores in them. * test/manual/indent/scss-mode.scss: Add some examples of variable names with underscores in them.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Ignore comments and strings when matching JSXJackson Ray Hamilton2019-12-071-0/+7
| | | | | | * lisp/progmodes/js.el (js-jsx--matching-close-tag-pos): Ignore comments and strings. * test/manual/indent/jsx-comment-string.jsx: New test.
* * lisp/progmodes/perl-mode.el (perl-calculate-indent): Indent qw(...)Stefan Monnier2019-11-151-0/+6
| | | | | Fix initialization of `state`. Special-case `qw(...)` because we do want to indent its contents.
* Ignore comments and strings when recognizing JSXJackson Ray Hamilton2019-09-221-0/+16
| | | | | | * lisp/progmodes/js.el (js-syntax-propertize): Ignore comments and strings. * test/manual/indent/jsx-comment-string.jsx: New test.
* * lisp/progmodes/opascal.el: Allow inline `var` decl in `for` (bug#36348)Stefan Monnier2019-07-221-0/+12
| | | | (opascal-enclosing-indent-of): Ignore decls "neutered" by delimiter.
* * test/manual/indent/octave.m (spmd): Add test for last changeStefan Monnier2019-07-201-0/+4
|
* * lisp/textmodes/tex-mode.el (latex-noindent-commands): New custom varStefan Monnier2019-06-241-0/+4
| | | | | (latex-find-indent): Obey it. (latex-noindent-environments): Make it into a defcustom as well.
* Add new defcustom js-jsx-align->-with-<Jackson Ray Hamilton2019-04-091-0/+12
| | | | | | | | | | | | | * lisp/progmodes/js.el (js-jsx-align->-with-<): New variable for users to control one opinionated aspect of JSX indentation. It defaults to the style seen in the React docs, which many users expected as the “correct” indentation. Still, the old SGML-style of indentation could be desirable too, especially since it was the old default. This ensures users have a way of getting back the old behavior. (js-jsx--contextual-indentation): Respect js-jsx-align->-with-<. * test/manual/indent/jsx-align-gt-with-lt.jsx: New test for js-jsx-align->-with-<.
* Add new defcustom js-jsx-indent-levelJackson Ray Hamilton2019-04-091-0/+13
| | | | | | | | | | * lisp/progmodes/js.el (js-jsx-indent-level): New variable for users to set JSX indentation differently than JS, like before. (js-jsx--contextual-indentation): Respect js-jsx-indent-level when it’s set. * test/manual/indent/jsx-indent-level.jsx: New test for js-jsx-indent-level.
* Permit non-ASCII identifiers in JSJackson Ray Hamilton2019-04-081-0/+7
| | | | | | | | | * lisp/progmodes/js.el (js--name-start-re): Generally allow identifiers to begin with non-ASCII letters. This is of particular importance to JSX parsing. * test/manual/indent/jsx-unclosed-2.jsx: Add test to ensure non-ASCII characters are parsed properly.
* Improve whitespace and unary keyword parsingJackson Ray Hamilton2019-04-081-0/+16
| | | | | | | | | | | | | | | | | | | | * lisp/progmodes/js.el (js--name-start-chars): Remove, adding these chars back to js--name-start-re. (js--name-start-re): Add chars back from js--name-start-chars. (js-jsx--tag-start-re): Improve regexp to capture the tag name (so it can be disambiguated from a unary keyword), to match newlines (which are common in this spot), and to require at least one whitespace character before the attribute name. (js-jsx--matched-tag-type): Ensure the “tag name” isn’t possibly a unary keyword. (js-jsx--self-closing-re, js-jsx--matching-close-tag-pos): Allow whitespace around “<” and “>”. * test/manual/indent/jsx-unclosed-2.jsx: Add tests for unary keyword and whitespace parsing.
* Optimize js-jsx--matching-close-tag-posJackson Ray Hamilton2019-04-081-1/+6
| | | | | | | | | | | | | | | | | This function’s performance was having a noticeable impact when editing large JSX structures. Improve its performance slightly (elapsed time will be cut in half according to ELP). * lisp/progmodes/js.el (js-jsx--tag-re): Remove. (js-jsx--matched-tag-type): Simplify implementation with respect to the new implementation of js-jsx--matching-close-tag-pos. (js-jsx--self-closing-re): Simplify regexp slightly in sync with a generally simpler matching algorithm. (js-jsx--matching-close-tag-pos): Optimize matching algorithm by using multiple simple regexp searches, rather than one big complex search. * test/manual/indent/jsx-unclosed-2.jsx: Use the term “inequality” and add a test for a possible parsing foible.
* Add tests for miscellaneous JSX parsing featsJackson Ray Hamilton2019-04-081-0/+26
| | | | | * test/manual/indent/jsx.jsx: Add tests for JSXMemberExpression names and JSXOpeningFragment/JSXClosingFragment support (already supported).
* Indent expressions in JSXAttributes relative to the attribute’s nameJackson Ray Hamilton2019-04-081-0/+25
| | | | | | | | | | | | | | | | | | | * lisp/progmodes/js.el (js-jsx--syntax-propertize-tag): Refer to the beginning of a JSXExpressionContainer’s associated JSXAttribute (so line numbers can be calculated later). (js-jsx--text-properties): Also clear the new text property js-jsx-expr-attribute. (js-jsx--indenting): Remove. (js-jsx--indent-col, js-jsx--indent-attribute-line): New variables. (js-jsx--indentation): Instead of alternating between two separate column calculations, neither necessarily correct, bind the JSX column such that the second call to js--proper-indentation can use it as a base column. (js--proper-indentation): Use JSX as the base column for some indents while indenting JSX. * test/manual/indent/jsx.jsx: Add more tests for expression indents.
* Fix counting of nested self-closing JSXOpeningElementsJackson Ray Hamilton2019-04-081-0/+13
| | | | | | | | | * lisp/progmodes/js.el (js-jsx--matching-close-tag-pos): Fix bug where self-closing JSXOpeningElements might be missed if one was nested within another. * test/manual/indent/jsx-self-closing.jsx: Add test for bug concerning self-closing JSXOpeningElement counting.
* Indent broken arrow function bodies as an N+1th argJackson Ray Hamilton2019-04-081-0/+5
| | | | | | | | | | | | | | * lisp/progmodes/js.el (js--line-terminating-arrow-re): Revise regexp for use with re-search-backward. (js--looking-at-broken-arrow-function-p): Remove. (js--broken-arrow-terminates-line-p): Replacement for js--looking-at-broken-arrow-function-p. Don’t consider whether an arrow appears at point (in an arglist); instead, just look for an arrow that terminates the line. (js--proper-indentation): Use js--broken-arrow-terminates-line-p. * test/manual/indent/js.js: Add test for a broken arrow as an N+1th arg.
* Rename tests to use the “.jsx” file extensionJackson Ray Hamilton2019-04-084-8/+0
| | | | | | | | | | | | | | | | * test/manual/indent/js-jsx-quote.js: Renamed to “jsx-quote.jsx”. * test/manual/indent/js-jsx-unclosed-1.js: Renamed to “jsx-unclosed-1.jsx”. * test/manual/indent/js-jsx-unclosed-2.js: Renamed to “jsx-unclosed-2.jsx”. * test/manual/indent/js-jsx.js: Renamed to “jsx.jsx”. * test/manual/indent/jsx-quote.jsx: Renamed from “js-jsx-quote.js”. * test/manual/indent/jsx-unclosed-1.jsx: Renamed from “js-jsx-unclosed-1.js”. * test/manual/indent/jsx-unclosed-2.jsx: Renamed from “js-jsx-unclosed-2.js”. * test/manual/indent/jsx.jsx: Renamed from “js-jsx.js”.
* Improve JSX syntax propertizationJackson Ray Hamilton2019-04-081-0/+8
| | | | | | | | | | * lisp/progmodes/js.el (js-jsx--attribute-name-re): New variable. (js-jsx--syntax-propertize-tag): Allow “-” in JSXAttribute names. Fix “out of range” error when typing at the end of a buffer. Fix/improve future propertization of unfinished JSXBoundaryElements. * test/manual/indent/js-jsx-unclosed-2.js: Add tests for allowed characters in JSX.
* Update expectations for JSX indentation in JSXAttribute spaceJackson Ray Hamilton2019-04-081-4/+10
| | | | | * test/manual/indent/js-jsx.js: Align expectations for dangling closing constructs with other places in the tests.
* js-syntax-propertize: Disambiguate JS from JSX, fixing some indentsJackson Ray Hamilton2019-04-081-0/+14
| | | | | | | | | | | | | | | | | | | | | Fix some JSX indentation bugs: - Bug#24896 / https://github.com/mooz/js2-mode/issues/389 - Bug#30225 - https://github.com/mooz/js2-mode/issues/459 * lisp/progmodes/js.el (js--dotted-captured-name-re) (js--unary-keyword-re, js--unary-keyword-p) (js--disambiguate-beginning-of-jsx-tag) (js--disambiguate-end-of-jsx-tag) (js--disambiguate-js-from-jsx): New variables and functions. (js-syntax-propertize): Additionally clarify when syntax is JS so that ‘(with-syntax-table sgml-mode-syntax-table …)’ does not mistake some JS punctuation syntax for SGML parenthesis syntax, namely ‘<’ and ‘>’. * test/manual/indent/js-jsx-unclosed-2.js: Add additional test for unary operator parsing.
* Add new (failing) unclosed JSX test and separate such testsJackson Ray Hamilton2019-04-083-9/+32
| | | | | | | | * test/manual/indent/js-jsx.js: Move test with intentional scan error to its own file, js-jsx-unclosed-1.js. * test/manual/indent/js-jsx-unclosed-1.js: New file. * test/manual/indent/js-jsx-unclosed-2.js: New file with test for regression caused by new ambiguous parsing of JS/JSX.
* Add failing tests for JSX indentation bugsJackson Ray Hamilton2019-04-082-0/+201
| | | | | | | | | * test/manual/indent/js-jsx.js: Add failing tests for all the js-mode and js2-mode JSX indentation bugs reported over the years that I could find. Some may be duplicates, so I have grouped similar reports together, for now; we’ll see for certain which distinct cases we need once we start actually implementing fixes. * test/manual/indent/js-jsx-quote.js: New file with a nasty test.
* Indent arrows’ expression bodies like function bodies (Bug#25904)Jackson Ray Hamilton2019-02-131-0/+9
| | | | | | | | | | | | | | | * lisp/progmodes/js.el (js--continued-expression-p): Don’t confuse ‘=>’ for a ‘>’ operator. (js--line-terminating-arrow-re): New variable. (js--looking-at-broken-arrow-function-p): New function. (js--proper-indentation): Don’t align arrow functions’ expression bodies starting on new lines like list continuations, instead align them like function bodies (js-indent-align-list-continuation need not be nil). * test/manual/indent/js.js: Add test for Bug#25904. Co-authored-by: Felipe Ochoa <felipe@fov.space>