* misc/ruby-style.el (ruby-style-{case,label}-indent): adjust for
labels inside switch block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
27b35eddd6
commit
32865ef821
@ -1,3 +1,8 @@
|
|||||||
|
Fri Oct 26 15:00:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* misc/ruby-style.el (ruby-style-{case,label}-indent): adjust for
|
||||||
|
labels inside switch block.
|
||||||
|
|
||||||
Fri Oct 26 05:48:57 UTC 2007 David Flanagan <davidflanagan@ruby-lang.org>
|
Fri Oct 26 05:48:57 UTC 2007 David Flanagan <davidflanagan@ruby-lang.org>
|
||||||
* array.c: raise IndexError for negative length in rb_ary_fill
|
* array.c: raise IndexError for negative length in rb_ary_fill
|
||||||
|
|
||||||
|
@ -20,18 +20,22 @@
|
|||||||
|
|
||||||
(defun ruby-style-case-indent (x)
|
(defun ruby-style-case-indent (x)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(unless (progn (backward-up-list) (back-to-indentation)
|
||||||
|
(> (point) (cdr x)))
|
||||||
(goto-char (cdr x))
|
(goto-char (cdr x))
|
||||||
(if (looking-at "\\<case\\|default\\>") '*)))
|
(if (looking-at "\\<case\\|default\\>") '*))))
|
||||||
|
|
||||||
(defun ruby-style-label-indent (x)
|
(defun ruby-style-label-indent (x)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(unless (progn (backward-up-list) (back-to-indentation)
|
||||||
|
(> (point) (cdr x)))
|
||||||
(goto-char (cdr x))
|
(goto-char (cdr x))
|
||||||
(condition-case ()
|
(condition-case ()
|
||||||
(progn
|
(progn
|
||||||
(backward-up-list)
|
(backward-up-list)
|
||||||
(backward-sexp 2)
|
(backward-sexp 2)
|
||||||
(if (looking-at "\\<switch\\>") '/))
|
(if (looking-at "\\<switch\\>") '/))
|
||||||
(error))))
|
(error)))))
|
||||||
|
|
||||||
(require 'cc-styles)
|
(require 'cc-styles)
|
||||||
(c-add-style
|
(c-add-style
|
||||||
|
Loading…
x
Reference in New Issue
Block a user