summaryrefslogtreecommitdiff
path: root/sample/ruby-mode.el
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-09 09:30:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-09 09:30:25 +0000
commite32da15f48189cfba02a9be2e6572161d91b3122 (patch)
tree47c660015f96f23220975c71fd69e71f8a69b6ef /sample/ruby-mode.el
parent8673eacafa039f056927e0f91ce195afae9b9019 (diff)
1.1b9_09 pre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/ruby-mode.el')
-rw-r--r--sample/ruby-mode.el33
1 files changed, 19 insertions, 14 deletions
diff --git a/sample/ruby-mode.el b/sample/ruby-mode.el
index 5d5af3437d..e33a164bd9 100644
--- a/sample/ruby-mode.el
+++ b/sample/ruby-mode.el
@@ -110,19 +110,7 @@
(defvar ruby-indent-level 2
"*Indentation of ruby statements.")
-(defun ruby-mode ()
- "Major mode for editing ruby scripts.
-\\[ruby-indent-command] properly indents subexpressions of multi-line
-class, module, def, if, while, for, do, and case statements, taking
-nesting into account.
-
-The variable ruby-indent-level controls the amount of indentation.
-\\{ruby-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (use-local-map ruby-mode-map)
- (setq mode-name "ruby")
- (setq major-mode 'ruby-mode)
+(defun ruby-mode-variables ()
(set-syntax-table ruby-mode-syntax-table)
(setq local-abbrev-table ruby-mode-abbrev-table)
(make-local-variable 'indent-line-function)
@@ -138,7 +126,22 @@ The variable ruby-indent-level controls the amount of indentation.
(make-variable-buffer-local 'comment-start-skip)
(setq comment-start-skip "\\(^\\|\\s-\\);?#+ *")
(make-local-variable 'parse-sexp-ignore-comments)
- (setq parse-sexp-ignore-comments t)
+ (setq parse-sexp-ignore-comments t))
+
+(defun ruby-mode ()
+ "Major mode for editing ruby scripts.
+\\[ruby-indent-command] properly indents subexpressions of multi-line
+class, module, def, if, while, for, do, and case statements, taking
+nesting into account.
+
+The variable ruby-indent-level controls the amount of indentation.
+\\{ruby-mode-map}"
+ (interactive)
+ (kill-all-local-variables)
+ (use-local-map ruby-mode-map)
+ (setq mode-name "ruby")
+ (setq major-mode 'ruby-mode)
+ (ruby-mode-variable)
(run-hooks 'ruby-mode-hook))
(defun ruby-current-indentation ()
@@ -666,3 +669,5 @@ An end of a defun is found by moving forward from the beginning of one."
(add-hook 'ruby-mode-hook
(lambda ()
(setq font-lock-keywords ruby-font-lock-keywords))))))
+
+(provide 'ruby-mode)