1. 04 Nov, 2013 1 commit
  2. 26 Oct, 2013 1 commit
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be more · bae91342
      Dmitry Gutov authored
      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.
      bae91342
  3. 10 Oct, 2013 1 commit
  4. 09 Oct, 2013 1 commit
  5. 06 Oct, 2013 1 commit
  6. 11 Jul, 2013 1 commit
    • Glenn Morris's avatar
      Quieten ruby-mode-tests.el compilation · d2e1542a
      Glenn Morris authored
      * test/automated/ruby-mode-tests.el (ruby-deftest-move-to-block):
      Goto point-min.
      (works-on-do, zero-is-noop, ok-with-three, ok-with-minus-two)
      (ruby-move-to-block-skips-percent-literal)
      (ruby-move-to-block-skips-heredoc)
      (ruby-move-to-block-moves-from-else-to-if)
      (ruby-beginning-of-defun-does-not-fold-case)
      (ruby-end-of-defun-skips-to-next-line-after-the-method):
      Replace goto-line with forward-line/goto-char.
      (ruby-move-to-block-does-not-fold-case): Remove unneeded end-of-buffer.
      d2e1542a
  7. 09 Jul, 2013 1 commit
  8. 03 Jul, 2013 1 commit
  9. 30 Jun, 2013 1 commit
  10. 18 Jun, 2013 1 commit
  11. 31 May, 2013 2 commits
  12. 19 May, 2013 1 commit
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re): Allow to · 1a0a0a8a
      Dmitry Gutov authored
      start at point, so that expansion starting right after opening
      slash in a regexp is recognized.
      (ruby-syntax-before-regexp-re): New defvar, extracted from
      ruby-syntax-propertize-function.  Since the value of this regexp
      is looked up at runtime now, we should be able to turn
      `ruby-syntax-methods-before-regexp' into a defcustom later.
      (ruby-syntax-propertize-function): Split regexp matching into two
      parts, for opening and closing slashes.  That allows us to skip
      over string interpolations and support multiline regexps.
      Don't call `ruby-syntax-propertize-expansions', instead use another rule
      for them, which calls `ruby-syntax-propertize-expansion'.
      (ruby-syntax-propertize-expansions): Move `remove-text-properties'
      call to `ruby-syntax-propertize-function'.
      (ruby-syntax-propertize-expansion): Extracted from
      `ruby-syntax-propertize-expansions'.  Handles one expansion.
      (ruby-syntax-propertize-heredoc): Explicitly call
      `ruby-syntax-propertize-expansions'.
      (ruby-syntax-propertize-percent-literal): Leave point right after
      the percent symbol, so that the expression expansion rule can
      propertize the contents.
      
      * test/automated/ruby-mode-tests.el (ruby-heredoc-highlights-interpolations)
      (ruby-regexp-skips-over-interpolation)
      (ruby-regexp-continues-till-end-when-unclosed)
      (ruby-regexp-can-be-multiline)
      (ruby-interpolation-inside-percent-literal): New tests.
      
      * test/indent/ruby.rb: Add multiline regexp example.
      1a0a0a8a
  13. 15 Apr, 2013 1 commit
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun) · fb549d64
      Dmitry Gutov authored
      (ruby-end-of-defun, ruby-move-to-block): Bind `case-fold-search'
      to nil.
      (ruby-end-of-defun): Remove the unused arg, change the docstring
      to reflect that this function is only used as the value of
      `end-of-defun-function'.
      (ruby-beginning-of-defun): Remove "top-level" from the docstring,
      to reflect an earlier change that beginning/end-of-defun functions
      jump between methods in a class definition, as well as top-level
      functions.
      fb549d64
  14. 11 Mar, 2013 1 commit
  15. 06 Mar, 2013 1 commit
  16. 14 Feb, 2013 2 commits
    • Dmitry Gutov's avatar
      (ruby-add-log-current-method): Improve performance at the expense · 71a048c1
      Dmitry Gutov authored
      of accuracy.  `ruby-block-contains-point' is relatively slow, so
      only use it for method and singleton class blocks.
      
      * test/automated/ruby-mode-tests.el
      (ruby-add-log-current-method-after-inner-class): Lower
      expectations: move point inside a method, initially.
      71a048c1
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-parse-partial): Don't increase · 53ca88c4
      Dmitry Gutov authored
      depth for unfinished percent literal.  Not using it in the caller.
      (ruby-move-to-block): Jump over multiline literals of all types,
      ignoring code-looking contents inside them.
      
      * test/automated/ruby-mode-tests.el
      (ruby-move-to-block-skips-percent-literal): Add depth-affecting
      bits inside the examples.
      (ruby-move-to-block-skips-heredoc): New test.
      53ca88c4
  17. 13 Feb, 2013 1 commit
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-move-to-block): Improve · 7132e457
      Dmitry Gutov authored
      performance.  Instead of recalculating indentation fully for each
      line, sum up indentation depth based only on visited lines.
      (ruby-parse-partial): Increase the depth after "do" even when END
      is right after it.
      (ruby-parse-partial): When END is in the middle of a percent
      literal, increase the depth if the delimiter chars belong to the
      paren syntax class.
      
      * test/automated/ruby-mode-tests.el
      (ruby-move-to-block-skips-percent-literal): New test.
      7132e457
  18. 28 Jan, 2013 1 commit
  19. 27 Jan, 2013 1 commit
  20. 01 Jan, 2013 1 commit
  21. 26 Dec, 2012 1 commit
  22. 14 Dec, 2012 2 commits
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): · bb808526
      Dmitry Gutov authored
      Extract `ruby-syntax-propertize-expansions'.
      (ruby-syntax-propertize-expansions): Only change syntax on
      certain string delimiters, to punctuation.  This way the common
      functions like forward-word and thing-at-point still work.
      (ruby-match-expression-expansion): Improve readability.
      (ruby-block-contains-point): New function.
      (ruby-add-log-current-method): Handle several edge cases.
      
      * test/automated/ruby-mode-tests.el
      Rename one interpolation test; add three more.
      (ruby-with-temp-buffer): New macro, use it where appropriate.
      (ruby-add-log-current-method-examples): Use "_" for target point.
      Add four tests for ruby-add-log-current-method.
      bb808526
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): · dbb530d9
      Dmitry Gutov authored
      Extract `ruby-syntax-propertize-expansions'.
      (ruby-syntax-propertize-expansions): Only change syntax on
      certain string delimiters, to punctuation.  This way the common
      functions like forward-word and thing-at-point still work.
      
      * test/automated/ruby-mode-tests.el
      Rename one interpolation test; add three more.
      dbb530d9
  23. 02 Dec, 2012 1 commit
  24. 14 Nov, 2012 2 commits
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el · c62792e7
      Dmitry Gutov authored
      (ruby-syntax-propertize-function): After everything else, search
      for expansions in string literals, mark their insides as
      whitespace syntax and save match data for font-lock.
      (ruby-font-lock-keywords): Highlight just the 2nd group from
      expression expansion matches.
      (ruby-match-expression-expansion): Use the match data saved to the
      text property in ruby-syntax-propertize-function.
      
      * test/automated/ruby-mode-tests.el
      Change direct font-lock face references to var references.
      (ruby-interpolation-suppresses-syntax-inside): New test.
      (ruby-interpolation-inside-percent-literal-with-paren): New
      failing test.
      c62792e7
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-expr-beg): Make heredoc detection · 8619323f
      Dmitry Gutov authored
      more strict.  Add docstring.
      
      * test/automated/ruby-mode-tests.el (ruby-indent-singleton-class): Pass.
      (ruby-indent-inside-heredoc-after-operator)
      (ruby-indent-inside-heredoc-after-space): New tests.
      8619323f
  25. 13 Nov, 2012 3 commits
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-move-to-block): Looks for a block · 5e9419e8
      Dmitry Gutov authored
      start/end keyword a bit harder.  Works with different values of N.
      Add more comments.
      (ruby-end-of-block): Update accordingly.
      
      * test/automated/ruby-mode-tests.el (ruby-heredoc-font-lock)
      (ruby-singleton-class-no-heredoc-font-lock)
      (ruby-add-log-current-method-examples): New tests.
      (ruby-test-string): Extract from ruby-should-indent-buffer.
      (ruby-deftest-move-to-block): New macro.
      Add several move-to-block tests.
      5e9419e8
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-add-log-current-method): Print the · 5745cae6
      Dmitry Gutov authored
      period before class method names, not after.  Remove handling of
      one impossible case.  Add comments.
      
      * test/automated/ruby-mode-tests.el 
      (ruby-add-log-current-method-examples): New test.
      (ruby-test-string): Extract from ruby-should-indent-buffer.
      5745cae6
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Never · f178c32d
      Dmitry Gutov authored
      font-lock the beginning of singleton class as heredoc.
      
      * test/automated/ruby-mode-tests.el (ruby-heredoc-font-lock)
      (ruby-singleton-class-no-heredoc-font-lock): New tests.
      f178c32d
  26. 12 Nov, 2012 1 commit
  27. 18 Sep, 2012 1 commit
  28. 08 Sep, 2012 2 commits
  29. 07 Sep, 2012 1 commit
    • Dmitry Gutov's avatar
      * lisp/progmodes/ruby-mode.el (ruby-indent-beg-re): Add pieces from · 0ba2d4b6
      Dmitry Gutov authored
      ruby-beginning-of-indent, simplify, allow all keywords to have
      indentation before them.
      (ruby-beginning-of-indent): Adjust for above.  Search until the
      found point is not inside a string or comment.
      (ruby-font-lock-keywords): Allow symbols to start with "@"
      character, give them higher priority than variables.
      (ruby-syntax-propertize-function)
      (ruby-font-lock-syntactic-keywords): Remove the "not comments"
      matchers.  Expression expansions are not comments when inside a
      string, and there comment syntax status is irrelevant.
      (ruby-match-expression-expansion): New function.  Check that
      expression expansion is inside a string, and it's not escaped.
      (ruby-font-lock-keywords): Use it.
      
      * test/automated/ruby-mode-tests.el: New tests (Bug#11613).
      0ba2d4b6
  30. 12 Aug, 2012 1 commit
    • Nobuyoshi Nakada's avatar
      Merge from upstream ruby-mode.el · 0d9e2599
      Nobuyoshi Nakada authored
      * lisp/progmodes/ruby-mode.el (ruby-mode-map): Remove unnecessary
      binding for `newline'.
      (ruby-move-to-block): When moving backward, stop at block opening,
      not indentation.
      * progmodes/ruby-mode.el (ruby-brace-to-do-end)
      (ruby-do-end-to-brace, ruby-toggle-block): New functions.
      * progmodes/ruby-mode.el (ruby-mode-map): Add binding for
      `ruby-toggle-block'.
      * test/automated/ruby-mode-tests.el (ruby-move-to-block-stops-at-opening)
      (ruby-toggle-block-to-do-end, ruby-toggle-block-to-brace): New test.
      0d9e2599
  31. 10 Aug, 2012 2 commits
    • Dmitry Gutov's avatar
      * test/automated/ruby-mode-tests.el (ruby-should-indent): · 9d2ed8a2
      Dmitry Gutov authored
      Add docstring, check (current-indentation) instead of (current-column).
      (ruby-should-indent-buffer): New function.
      Add tests for `ruby-deep-indent-paren' behavior.
      Port all tests from test/misc/test_ruby_mode.rb in Ruby repo.
      
      Fixes: debbugs:12169
      9d2ed8a2
    • Dmitry Gutov's avatar
      Merge stuff from upsteam ruby-mode, part 1. · 9cd80478
      Dmitry Gutov authored
      * lisp/progmodes/ruby-mode.el (ruby-mode-map): Remove deprecated
      binding (use `M-;' instead).
      (ruby-expr-beg, ruby-parse-partial): ?, _, and : are symbol
      constituents, ! is not (but kinda should be).
      (ruby-singleton-class-p): New function.
      (ruby-expr-beg, ruby-in-here-doc-p)
      (ruby-syntax-propertize-heredoc): Use it.
      (ruby-syntax-propertize-function): Adjust for changes in
      `ruby-syntax-propertize-heredoc'.
      
      * test/automated/ruby-mode-tests.el (ruby-should-indent)
      (ruby-assert-state): New functions.
      Add new tests.
      
      Fixes: debbugs:12169
      9cd80478
  32. 20 Jul, 2012 1 commit