summaryrefslogtreecommitdiff
path: root/test/indent
Commit message (Collapse)AuthorAgeFilesLines
...
* * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $'Stefan Monnier2014-04-021-0/+4
| | | | | | used as a variable. Fixes: debbugs:17174
* Fix bug#17097Dmitry Gutov2014-03-271-0/+5
| | | | | | * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't propertize `?' or `!' as symbol constituent when after colon.
* Fix bug#17050Dmitry Gutov2014-03-211-0/+17
| | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Add indentation rule for ` @ '.
* * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): HighlightDmitry Gutov2014-03-021-0/+4
| | | | | | regexp options. Fixes: debbugs:16914
* Spelling fix.Paul Eggert2014-02-251-1/+1
|
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle theDmitry Gutov2014-02-231-0/+7
| | | | | | | inconsistent second element of the list returned by `smie-indent--parent'. (ruby-font-lock-keywords): Disqualify any identifier before `=' as method call.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Don't indent speciallyDmitry Gutov2014-02-231-1/+7
| | | | | | after `=>'. Fixes: debbugs:16811
* Fix bug#16609Dmitry Gutov2014-02-011-0/+7
| | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Check for `:' before binary operators. Don't check for `:' before `[' and `(', or their syntax status. A percent literal can't end with either.
* Implement user option ruby-align-chained-callsDmitry Gutov2014-01-311-4/+4
| | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-align-chained-calls): New option. (ruby-smie-grammar): Make "." right-associative. Make its priority lower than the ternary and all binary operators. (ruby-smie-rules): Indent "(" relative to the first non-"." parent, or the first "." parent at indentation. Use `ruby-align-chained-calls' for indentation of "." tokens. * test/automated/ruby-mode-tests.el (ruby-align-chained-calls): New test. Fixes: debbugs:16593
* ruby-mode: Align def...end to the beginning of statementDmitry Gutov2014-01-171-0/+4
| | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-alignable-keywords): New constant. (ruby-align-to-stmt-keywords): Change the default value. Use `ruby-alignable-keywords' to generate the possible customization choices. (ruby-smie-rules): Instead of using a hardcoded list of alignable keywords, check against the value of `ruby-alignable-keywords' (http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01439.html).
* Spelling fixes.Paul Eggert2014-01-091-1/+1
| | | | | | * mail/unrmail.el (unrmail-mbox-format): Choice is mboxo, not mboxro. * woman.el (woman-mark-horizontal-position): Rename from woman-mark-horizonal-position. Use changed.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return tDmitry Gutov2013-12-221-0/+1
| | | | | after `{'. We need it after block openers, and it doesn't seem to hurt after hash openers.
* * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak theDmitry Gutov2013-12-221-0/+6
| | | | | docstring. (ruby-smie-rules): Indent plus one level after `=>'.
* * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): NewDmitry Gutov2013-12-201-21/+16
| | | | | | | | | | | | | | | | | | option. (ruby-smie--indent-to-stmt-p): Use it. (ruby-smie-rules): Revert the logic in the handling of `when'. Expand the `begin' clause to handle `ruby-align-to-stmt-keywords'. (ruby-deep-arglist, ruby-deep-indent-paren) (ruby-deep-indent-paren-style): Update docstrings to note that the vars don't have any effect with SMIE. * test/automated/ruby-mode-tests.el: Add tests for `ruby-align-to-stmt-keywords'. * test/indent/ruby.rb: Update examples to reflect the lack of change in default indentation of `begin' blocks. Fixes: debbugs:16182
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent middle-of-blockDmitry Gutov2013-12-191-0/+4
| | | | keywords to their parent.
* * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Allow theDmitry Gutov2013-12-191-6/+17
| | | | | | | | | | | | | | first arg to be a string (fixed dead code), or an operator symbol. (ruby-smie--forward-token): Tokenize ` @ ' before strings and operator symbols. (ruby-smie-rules): Remove parent token check in the `.' clause, it did nothing. Don't respond to `(:after ".")', it will be called with :before anyway. Remove the ` @ ' rule, it didn't seem to change anything. Only return indentation for binary operators when they are hanging. De-dent opening paren when its parent is `.', otherwise it looks bad when the dot is not at bol or eol. Fixes: debbugs:16182
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent ternary if.Dmitry Gutov2013-12-171-0/+4
|
* Fix bug#16116Dmitry Gutov2013-12-171-6/+3
| | | | | | | | | | * lisp/emacs-lisp/smie.el (smie-indent--rule): Extract `smie-indent--rule-1'. (smie-indent-close): Call `smie-indent--rule-1' with METHOD :close-all, to see which indentation method to use. (smie-rules-function): Document the method :close-all. * test/indent/ruby.rb: Update examples according to the change in `smie-indent-close'.
* Fix bug#16118Dmitry Gutov2013-12-141-4/+35
| | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Return nil before open-paren tokens when preceded by a open-paren, too. (ruby-smie-rules): Handle virtual indentation after open-paren tokens specially. If there is code between it and eol, return the column where is starts. * test/indent/ruby.rb: New examples.
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return tDmitry Gutov2013-12-091-0/+3
| | | | after the end of a percent literal.
* Mention test/indent/js.js, and restore one lost piece of itDmitry Gutov2013-12-081-1/+5
| | | | * test/indent/js.js: New file.
* Port indentation code from js2-mode to js-modeDmitry Gutov2013-12-081-0/+45
| | | | | | | | | | | | | * lisp/progmodes/js.el (js-auto-indent-flag): Remove, was unused. (js-switch-indent-offset): New option. (js--proper-indentation): Use it. And handle the case when "default" is actually a key in an object literal. (js--same-line): New function. (js--multi-line-declaration-indentation): Use it. (js--indent-in-array-comp, js--array-comp-indentation): New functions. (js--proper-indentation): Use them, to handle array comprehension continuations.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Disambiguate betweenDmitry Gutov2013-11-121-0/+3
| | | | | | | | | binary "|" operator and closing block args delimiter. Remove FIXME comment referring to Ruby 1.8-only syntax. (ruby-smie--implicit-semi-p): Not after "|" operator. (ruby-smie--closing-pipe-p): New function. (ruby-smie--forward-token, ruby-smie--backward-token): Use it. (ruby-smie-rules): Indent after "|".
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):Dmitry Gutov2013-11-091-2/+7
| | | | | | Not after "||". (ruby-smie-rules): Indent non-hanging "begin" blocks as part of their parent.
* * indent/ruby.rb: New exampleDmitry Gutov2013-11-081-0/+7
|
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedencesDmitry Gutov2013-11-081-2/+29
| | | | | | | | | | | | | | | | | of "and", "or", "&&" and "||". (ruby-smie--args-separator-p): Prohibit keyword "do" as the first argument. Prohibit opening curly brace because it could only be a block opener in that position. (ruby-smie--forward-token, ruby-smie--backward-token): Separate "|" from "&" or "*" going after it. That can happen in block arguments. (ruby-smie--indent-to-stmt): New function, seeks the end of previous statement or beginning of buffer. (ruby-smie-rules): Use it. (ruby-smie-rules): Check if there's a ":" before a curly block opener candidate; if there is, it's a hash. * test/indent/ruby.rb: New examples.
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):Dmitry Gutov2013-11-071-0/+12
| | | | | | | | | | No implicit semi after "^", "and" or "or". (ruby-smie-grammar): New tokens: "and" and "or". (ruby-smie--args-separator-p): Fix the check for tokens at POS. Exclude "and" and "or". Remove "do" in order to work around token priorities. (ruby-smie-rules): Add all infix tokens. Handle the case of beginning-of-buffer.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority ofDmitry Gutov2013-11-071-3/+1
| | | | "." compared to "do".
* * test/indent/ruby.rb: Move a now-successful example.Dmitry Gutov2013-11-041-4/+4
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)Dmitry Gutov2013-11-041-0/+1
| | | | | | | | (ruby-smie--backward-token): Tokenize heredocs as semicolons. * test/automated/ruby-mode-tests.el: Remove outdated comment. * test/indent/ruby.rb: Add a statement on the line after heredoc.
* * lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): NewDmitry Gutov2013-11-021-0/+8
| | | | | | function, replacement for `smie-rule-parent' for when we want to skip over our direct parent if it's an assignment token.. (ruby-smie-rules): Use it.
* * src/eval.c (run_hook_with_args): Use FUNCTIONP.Stefan Monnier2013-10-293-2/+16
| | | | | * test/indent/css-mode.css (.x2): Test alignement inside braces. * test/indent/prolog.prolog: Test alignment of ->; with operator at bol.
* * lisp/progmodes/ruby-mode.el (ruby-smie--bosp): Anything that goesDmitry Gutov2013-10-271-0/+5
| | | | after `=' is probably a new expression.
* * test/indent/ruby.rb: New failing example.Dmitry Gutov2013-10-261-0/+4
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be moreDmitry Gutov2013-10-261-12/+13
| | | | | | | | | specific in what the first arg can be: a non-keyword word, string/regexp/percent literal opener, opening paren, or unary operator followed directly by word. * test/automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): Fix the test, in respect to adding the space after the curly.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix the "curly blockDmitry Gutov2013-10-241-1/+1
| | | | | | | with parameters" example. Simplify the "is it block or is it hash" check, but also make it more thorough. * test/indent/ruby.rb: Fix syntax error in the latest example.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Only align with parent ofStefan Monnier2013-10-231-0/+4
| | | | { if it is hanging.
* * test/indent/ruby.rb: Move two examples to "working" section, add oneDmitry Gutov2013-10-231-7/+11
| | | | more.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Remove outdatedDmitry Gutov2013-10-221-3/+14
| | | | | | | | | | | TODO. Add "." after " @ ". (ruby-smie--at-dot-call): New function. Checks if point at method call with explicit target. (ruby-smie--forward-token, ruby-smie--backward-token): Prepend "." to the method name tokens when it precedes them. (ruby-smie--backward-id, ruby-smie--forward-id): Remove. (ruby-smie-rules): Add rule for indentation before and after "." token.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent after + used asStefan Monnier2013-10-211-2/+2
| | | | an instruction.
* * indent/ruby.rb: Fix a typoDmitry Gutov2013-10-211-1/+1
|
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add (almost) allDmitry Gutov2013-10-211-4/+4
| | | | | infix operators. (ruby-smie--implicit-semi-p): Add new operator chars.
* * lisp/progmodes/ruby-mode.el (ruby-mode-map): Add binding forDmitry Gutov2013-10-211-8/+17
| | | | | | | | | | | | `smie-down-list'. (ruby-smie--args-separator-p): Check that there's no newline between method call and its arguments. (ruby-smie-rules): Handle new cases: curly block with and without parameters, hash surrounded with parens, block passed to paren-less method call. * test/indent/ruby.rb: New examples for indentation of blocks. Example of hash inside parens that inflooped before this commit.
* * lisp/progmodes/sh-script.el (sh-find-prev-matching): Disable SMIE'sStefan Monnier2013-10-161-0/+6
| | | | | | forward-sexp-function while we redo its job. Fixes: debbugs:15613
* * indent/ruby.rb: Fix an example, remove wrong example, and add two more.Dmitry Gutov2013-10-151-4/+9
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): HandleDmitry Gutov2013-10-141-3/+24
| | | | | | | methods ending with `?' and `!'. * test/indent/ruby.rb: More examples for bug#15594, both failing and now passing.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add rule for paren-freeStefan Monnier2013-10-121-0/+4
| | | | | | | method calls (bug#bug#15594). (ruby-smie--args-separator-p): New function. (ruby-smie--forward-token, ruby-smie--backward-token): Use it to recognize paren-free method calls.
* * test/indent/ruby.rb: Add two more cases.Dmitry Gutov2013-10-111-0/+7
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Split theDmitry Gutov2013-10-111-0/+4
| | | | | | | cases of ? and =. (ruby-smie-rules): Simplify the "do" rule. The cases when the predicate would return nil are almost non-existent. (ruby-smie--redundant-do-p): Include "until" and "for" statements.