From 047111584f0e3d8e5d0e52cdda2a674d418e9af4 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 27 Nov 2018 13:47:49 +0000 Subject: 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 --- misc/ruby-style.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'misc') 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 ".*/ruby" nil))) + (error)) + nil) (c-set-style "ruby"))) (provide 'ruby-style) -- cgit v1.2.3