mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* misc/ruby-style.el (ruby-style-label-indent): for yacc rules.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2d239b4745
commit
b21d410d4e
2 changed files with 15 additions and 4 deletions
|
@ -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.
|
||||
|
|
|
@ -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 +))
|
||||
|
|
Loading…
Add table
Reference in a new issue