Commit 2122161f authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/electric.el (electric-indent-chars): Autoload.

* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/ruby-mode.el (ruby-mode): Take advantage of it.
(ruby-mode-abbrev-table): Merge initialization and declaration.
parent 0b9808b0
2010-10-27 Stefan Monnier <>
* electric.el (electric-indent-chars): Autoload.
* progmodes/octave-mod.el (octave-mode):
* progmodes/ruby-mode.el (ruby-mode): Take advantage of it.
(ruby-mode-abbrev-table): Merge initialization and declaration.
2010-10-27 Glenn Morris <>
* abbrev.el (abbrev-mode): Remove one of the three definitions of this
......@@ -178,6 +178,10 @@
;; Electric indentation.
;; Autoloading variables is generally undesirable, but major modes
;; should usually set this variable by adding elements to the default
;; value, which only works well if the variable is preloaded.
(defvar electric-indent-chars '(?\n)
"Characters that should cause automatic reindentation.")
......@@ -646,9 +646,8 @@ including a reproducible test case and send the message."
(aref (cdr kw) (1- (length (cdr kw)))))
;; FIXME: maybe we should use (cons ?\; electric-indent-chars)
;; since only ; is really octave-specific.
(set (make-local-variable 'electric-indent-chars) '(?\; ?\s ?\n))
(set (make-local-variable 'electric-indent-chars)
(cons ?\; electric-indent-chars))
(set (make-local-variable 'comment-start) octave-comment-start)
(set (make-local-variable 'comment-end) "")
......@@ -135,11 +135,9 @@ This should only be called after matching against `ruby-here-doc-beg-re'."
(defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]")
"Regexp to match symbols.")
(defvar ruby-mode-abbrev-table nil
(define-abbrev-table 'ruby-mode-abbrev-table ()
"Abbrev table in use in Ruby mode buffers.")
(define-abbrev-table 'ruby-mode-abbrev-table ())
(defvar ruby-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "{" 'ruby-electric-brace)
......@@ -1430,8 +1428,6 @@ See `font-lock-syntax-table'.")
"Additional expressions to highlight in Ruby mode.")
(defvar electric-indent-chars)
(define-derived-mode ruby-mode prog-mode "Ruby"
"Major mode for editing Ruby scripts.
......@@ -1456,8 +1452,7 @@ The variable `ruby-indent-level' controls the amount of indentation.
'ruby-mode-set-encoding nil 'local)
(set (make-local-variable 'electric-indent-chars)
(append '(?\{ ?\}) (if (boundp 'electric-indent-chars)
(default-value 'electric-indent-chars))))
(append '(?\{ ?\}) electric-indent-chars))
(set (make-local-variable 'font-lock-defaults)
'((ruby-font-lock-keywords) nil nil))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment