ruby-changes:12161
From: knu <ko1@a...>
Date: Wed, 24 Jun 2009 11:43:57 +0900 (JST)
Subject: [ruby-changes:12161] Ruby:r23836 (trunk): * misc/ruby-style.el: It is too late to set c-file-style in
knu 2009-06-24 11:41:57 +0900 (Wed, 24 Jun 2009) New Revision: 23836 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23836 Log: * misc/ruby-style.el: It is too late to set c-file-style in c-mode-hook (at least on Emacs 23). Call c-set-style instead. Modified files: trunk/ChangeLog trunk/misc/ruby-style.el Index: ChangeLog =================================================================== --- ChangeLog (revision 23835) +++ ChangeLog (revision 23836) @@ -1,3 +1,8 @@ +Wed Jun 24 11:41:20 2009 Akinori MUSHA <knu@i...> + + * misc/ruby-style.el: It is too late to set c-file-style in + c-mode-hook (at least on Emacs 23). Call c-set-style instead. + Tue Jun 23 21:28:16 2009 Nobuyoshi Nakada <nobu@r...> * file.c (rb_get_path_check): check with given safe level. Index: misc/ruby-style.el =================================================================== --- misc/ruby-style.el (revision 23835) +++ misc/ruby-style.el (revision 23836) @@ -7,14 +7,15 @@ ;;; $Author$ ;;; created at: Thu Apr 26 13:54:01 JST 2007 ;;; -;;; sets ruby style if it seems like a source of ruby. +;;; To switch to the "ruby" style automatically if it looks like a +;;; source file of ruby, add ruby-style-c-mode to c-mode-hook: ;;; ;;; (require 'ruby-style) ;;; (add-hook 'c-mode-hook 'ruby-style-c-mode) ;;; (add-hook 'c++-mode-hook 'ruby-style-c-mode) ;;; -;;; uses ruby style always. -;;; (setq-default c-file-style "ruby") +;;; Customize the c-default-style variable to set the default style +;;; for each CC major mode. (defconst ruby-style-revision "$Revision$" "Ruby style revision string.") @@ -71,6 +72,6 @@ (case-fold-search nil)) (goto-char (point-min)) (re-search-forward "Copyright (C) .* Yukihiro Matsumoto" head t)))) - (setq c-file-style "ruby"))) + (c-set-style "ruby"))) (provide 'ruby-style) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/