[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116535: * lisp/progmodes/ruby-mode.el (ruby-smie-ru
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] trunk r116535: * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle the |
Date: |
Sun, 23 Feb 2014 08:26:50 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116535
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sun 2014-02-23 10:26:40 +0200
message:
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle the
inconsistent second element of the list returned by
`smie-indent--parent'.
(ruby-font-lock-keywords): Disqualify any identifier before `=' as
method call.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/progmodes/ruby-mode.el
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
test/indent/ruby.rb ruby.rb-20120424165921-h044139hbrd7snvw-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-02-23 05:53:53 +0000
+++ b/lisp/ChangeLog 2014-02-23 08:26:40 +0000
@@ -2,6 +2,10 @@
* progmodes/ruby-mode.el (ruby-smie-rules): Don't indent specially
after `=>' (bug#16811).
+ (ruby-smie-rules): Handle the inconsistent second element of the
+ list returned by `smie-indent--parent'.
+ (ruby-font-lock-keywords): Disqualify any identifier before `=' as
+ method call.
2014-02-23 Juanma Barranquero <address@hidden>
=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el 2014-02-23 05:53:53 +0000
+++ b/lisp/progmodes/ruby-mode.el 2014-02-23 08:26:40 +0000
@@ -630,9 +630,11 @@
(save-excursion
;; Traverse up the parents until the parent is "." at
;; indentation, or any other token.
- (while (and (progn
- (goto-char (1- (cadr (smie-indent--parent))))
- (not (ruby-smie--bosp)))
+ (while (and (let ((parent (smie-indent--parent)))
+ (goto-char (cadr parent))
+ (save-excursion
+ (unless (integerp (car parent)) (forward-char -1))
+ (not (ruby-smie--bosp))))
(progn
(setq smie--parent nil)
(smie-rule-parent-p "."))))
@@ -2061,7 +2063,7 @@
"refine"
"using")
'symbols))
- (1 (unless (looking-at " *\\(?:[]|,.)}]\\|$\\)")
+ (1 (unless (looking-at " *\\(?:[]|,.)}=]\\|$\\)")
font-lock-builtin-face)))
;; Kernel methods that have no required arguments.
(,(concat
=== modified file 'test/indent/ruby.rb'
--- a/test/indent/ruby.rb 2014-02-23 05:53:53 +0000
+++ b/test/indent/ruby.rb 2014-02-23 08:26:40 +0000
@@ -357,6 +357,13 @@
.lose(
q, p)
+a.records().map(&:b).zip(
+ foo)
+
+# FIXME: This is not consistent with the example below it, but this
+# ofset only happens if the colon is at eol, which wouldn't be often.
+# Tokenizing `bar:' as `:bar =>' would be better, but it's hard to
+# distinguish from a variable reference inside a ternary operator.
foo(bar:
tee)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116535: * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle the,
Dmitry Gutov <=