diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/misc/ruby-style.el | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/misc/ruby-style.el')
-rw-r--r-- | trunk/misc/ruby-style.el | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/trunk/misc/ruby-style.el b/trunk/misc/ruby-style.el deleted file mode 100644 index 1915419056..0000000000 --- a/trunk/misc/ruby-style.el +++ /dev/null @@ -1,68 +0,0 @@ -;;; -*- emacs-lisp -*- -;;; -;;; ruby-style.el - -;;; -;;; C/C++ mode style for Ruby. -;;; -;;; $Author$ -;;; created at: Thu Apr 26 13:54:01 JST 2007 -;;; - -(defconst ruby-style-revision "$Revision$" - "Ruby style revision string.") - -(defconst ruby-style-version - (progn - (string-match "[0-9.]+" ruby-style-revision) - (substring ruby-style-revision (match-beginning 0) (match-end 0))) - "Ruby style version number.") - -(defun ruby-style-case-indent (x) - (save-excursion - (back-to-indentation) - (unless (progn (backward-up-list) (back-to-indentation) - (> (point) (cdr x))) - (goto-char (cdr x)) - (if (looking-at "\\<case\\|default\\>") '*)))) - -(defun ruby-style-label-indent (x) - (save-excursion - (back-to-indentation) - (unless (progn (backward-up-list) (back-to-indentation) - (>= (point) (cdr x))) - (goto-char (cdr x)) - (condition-case () - (progn - (backward-up-list) - (backward-sexp 2) - (if (looking-at "\\<switch\\>") '/)) - (error))))) - -(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 . (ruby-style-label-indent *)) - (statement-case-intro . *) - (statement-case-open . *) - (statement-block-intro . (ruby-style-case-indent +)) - (access-label /) - ))) - -(defun ruby-style-c-mode () - (interactive) - (if (or (string-match "/ruby\\>" (buffer-file-name)) - (save-excursion - (goto-char (point-min)) - (let ((head (progn (forward-line 100) (point))) - (case-fold-search nil)) - (goto-char (point-min)) - (re-search-forward "Copyright (C) .* Yukihiro Matsumoto" head t)))) - (setq c-file-style "ruby"))) - -(provide 'ruby-style) |