diff options
Diffstat (limited to 'misc/ruby-style.el')
| -rw-r--r-- | misc/ruby-style.el | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/misc/ruby-style.el b/misc/ruby-style.el index b8593b202a..03d0830d3a 100644 --- a/misc/ruby-style.el +++ b/misc/ruby-style.el @@ -55,8 +55,10 @@ '("bsd" (c-basic-offset . 4) (tab-width . 8) - (indent-tabs-mode . t) - (setq show-trailing-whitespace t) + (indent-tabs-mode . nil) + (show-trailing-whitespace . t) + (c-backslash-column . 1) + (c-backslash-max-column . 1) (c-offsets-alist (case-label . *) (label . (ruby-style-label-indent *)) @@ -66,6 +68,17 @@ (access-label /) ))) +(c-add-style + "prism" + '("bsd" + (c-basic-offset . 4) + (tab-width . 8) + (indent-tabs-mode . nil) + (show-trailing-whitespace . t) + (c-offsets-alist + (case-label . +) + ))) + ;;;###autoload (defun ruby-style-c-mode () (interactive) @@ -75,7 +88,20 @@ (let ((head (progn (forward-line 100) (point))) (case-fold-search nil)) (goto-char (point-min)) - (re-search-forward "Copyright (C) .* Yukihiro Matsumoto" head t)))) + (re-search-forward "Copyright (C) .* Yukihiro Matsumoto" head t))) + (condition-case () + (with-temp-buffer + (when (= 0 (call-process "git" nil t nil "remote" "get-url" "origin")) + (goto-char (point-min)) + (looking-at ".*/ruby\\(\\.git\\)?$"))) + (error)) + (condition-case () + (with-temp-buffer + (when (= 0 (call-process "svn" nil t nil "info" "--xml")) + (goto-char (point-min)) + (search-forward-regexp "<root>.*/ruby</root>" nil))) + (error)) + nil) (c-set-style "ruby"))) (provide 'ruby-style) |
