* misc/ruby-style.el (ruby-style-c-mode): buffer may not have file
name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2f67ef8332
commit
fd8ca75663
@ -1,3 +1,8 @@
|
|||||||
|
Thu Oct 9 23:53:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* misc/ruby-style.el (ruby-style-c-mode): buffer may not have file
|
||||||
|
name.
|
||||||
|
|
||||||
Thu Oct 9 23:30:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
Thu Oct 9 23:30:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* process.c (run_exec_dup2): fix resource leak.
|
* process.c (run_exec_dup2): fix resource leak.
|
||||||
|
@ -7,6 +7,14 @@
|
|||||||
;;; $Author$
|
;;; $Author$
|
||||||
;;; created at: Thu Apr 26 13:54:01 JST 2007
|
;;; created at: Thu Apr 26 13:54:01 JST 2007
|
||||||
;;;
|
;;;
|
||||||
|
;;; sets ruby style if it seems like a source of ruby.
|
||||||
|
;;;
|
||||||
|
;;; (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")
|
||||||
|
|
||||||
(defconst ruby-style-revision "$Revision$"
|
(defconst ruby-style-revision "$Revision$"
|
||||||
"Ruby style revision string.")
|
"Ruby style revision string.")
|
||||||
@ -56,7 +64,7 @@
|
|||||||
|
|
||||||
(defun ruby-style-c-mode ()
|
(defun ruby-style-c-mode ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (or (string-match "/ruby\\>" (buffer-file-name))
|
(if (or (let ((name (buffer-file-name))) (and name (string-match "/ruby\\>" name)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(let ((head (progn (forward-line 100) (point)))
|
(let ((head (progn (forward-line 100) (point)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user