[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r114111: * lisp/progmodes/ruby-mode.el (ruby-calcula
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] trunk r114111: * lisp/progmodes/ruby-mode.el (ruby-calculate-indent): Consider |
Date: |
Tue, 03 Sep 2013 00:29:15 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 114111
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15208
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-09-03 03:29:10 +0300
message:
* lisp/progmodes/ruby-mode.el (ruby-calculate-indent): Consider
two-character operators and whether the character preceding them
changes their meaning.
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 2013-09-02 13:56:03 +0000
+++ b/lisp/ChangeLog 2013-09-03 00:29:10 +0000
@@ -1,3 +1,9 @@
+2013-09-03 Dmitry Gutov <address@hidden>
+
+ * progmodes/ruby-mode.el (ruby-calculate-indent): Consider
+ two-character operators and whether the character preceding them
+ changes their meaning (Bug#15208).
+
2013-09-02 Fabián Ezequiel Gallina <address@hidden>
Format code sent to Python shell for robustness.
=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el 2013-08-29 18:06:46 +0000
+++ b/lisp/progmodes/ruby-mode.el 2013-09-03 00:29:10 +0000
@@ -137,6 +137,7 @@
(defconst ruby-symbol-chars "a-zA-Z0-9_"
"List of characters that symbol names may contain.")
+
(defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]")
"Regexp to match symbols.")
@@ -935,6 +936,10 @@
(not (looking-at "[a-z_]"))))
(and (looking-at ruby-operator-re)
(not (ruby-special-char-p))
+ (save-excursion
+ (forward-char -1)
+ (or (not (looking-at ruby-operator-re))
+ (not (eq (char-before) ?:))))
;; Operator at the end of line.
(let ((c (char-after (point))))
(and
=== modified file 'test/indent/ruby.rb'
--- a/test/indent/ruby.rb 2013-05-19 06:01:23 +0000
+++ b/test/indent/ruby.rb 2013-09-03 00:29:10 +0000
@@ -66,3 +66,8 @@
Given /toto/ do
print "hello"
end
+
+# Bug#15208
+if something == :==
+ do_something
+end
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r114111: * lisp/progmodes/ruby-mode.el (ruby-calculate-indent): Consider,
Dmitry Gutov <=