summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-17 08:02:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-17 08:02:02 +0000
commitcda9d3c5df05019703cd34b639819f6394e3a144 (patch)
treeef72afc2edc90e3bfb412a0fc346c5019cc9865d
parentf208510c449e78cd0f2433cbaf6a1c68a66f97ab (diff)
downloadruby-cda9d3c5df05019703cd34b639819f6394e3a144.tar.gz
ruby-cda9d3c5df05019703cd34b639819f6394e3a144.tar.xz
ruby-cda9d3c5df05019703cd34b639819f6394e3a144.zip
* misc/ruby-style.el (ruby-style-label-indent): for yacc rules.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--misc/ruby-style.el15
2 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 21d54f9d4..97c8ea5d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu May 17 17:03:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-style.el (ruby-style-label-indent): for yacc rules.
+
Thu May 17 13:30:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (f_arg): remove typo from ripper description.
diff --git a/misc/ruby-style.el b/misc/ruby-style.el
index 176878947..e0ed41fbc 100644
--- a/misc/ruby-style.el
+++ b/misc/ruby-style.el
@@ -4,18 +4,25 @@
(defun ruby-style-case-indent (x)
(save-excursion
(goto-char (cdr x))
- (if (looking-at "\\<case\\|default\\>")
- (- c-basic-offset
- (% (current-column) c-basic-offset)))))
+ (if (looking-at "\\<case\\|default\\>") '*)))
+
+(defun ruby-style-label-indent (x)
+ (save-excursion
+ (goto-char (cdr x))
+ (backward-up-list)
+ (backward-sexp 2)
+ (if (looking-at "\\<switch\\>") '/)))
(require 'cc-styles)
(c-add-style
"ruby"
'("bsd"
(c-basic-offset . 4)
+ (tab-width . 8)
+ (indent-tabs-mode . t)
(c-offsets-alist
(case-label . *)
- (label . *)
+ (label . (ruby-style-label-indent *))
(statement-case-intro . *)
(statement-case-open . *)
(statement-block-intro . (ruby-style-case-indent +))