diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-27 13:47:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-27 13:47:49 +0000 |
commit | 047111584f0e3d8e5d0e52cdda2a674d418e9af4 (patch) | |
tree | c415ce3e083f5c4b13507a0a50f06e0360708527 /misc | |
parent | 5bc8bb36c9a0710910a6c559d1209281ebab8e57 (diff) |
ruby-style.el: ruby-style-c-mode by VCS [ci skip]
* misc/ruby-style.el (ruby-style-c-mode): set ruby-style if the
remote repository is ruby.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ruby-style.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/misc/ruby-style.el b/misc/ruby-style.el index fa35897931..13aad77b3d 100644 --- a/misc/ruby-style.el +++ b/misc/ruby-style.el @@ -75,7 +75,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) |