diff options
| author | Stefan Monnier | 2010-10-27 10:26:01 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-10-27 10:26:01 -0400 |
| commit | 2122161f8dfddcbe0e46b63803ae73f3033d0e55 (patch) | |
| tree | 653d1d83ffbf86c0884604e6885bc9a8aae8ac2c | |
| parent | 0b9808b0cf492ee3c1b7f3dfe8bc962c13c3aad7 (diff) | |
| download | emacs-2122161f8dfddcbe0e46b63803ae73f3033d0e55.tar.gz emacs-2122161f8dfddcbe0e46b63803ae73f3033d0e55.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/electric.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/octave-mod.el | 5 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 9 |
4 files changed, 15 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1dccc73bda1..9071e3983be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2010-10-27 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * electric.el (electric-indent-chars): Autoload. | ||
| 4 | * progmodes/octave-mod.el (octave-mode): | ||
| 5 | * progmodes/ruby-mode.el (ruby-mode): Take advantage of it. | ||
| 6 | (ruby-mode-abbrev-table): Merge initialization and declaration. | ||
| 7 | |||
| 1 | 2010-10-27 Glenn Morris <rgm@gnu.org> | 8 | 2010-10-27 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * abbrev.el (abbrev-mode): Remove one of the three definitions of this | 10 | * abbrev.el (abbrev-mode): Remove one of the three definitions of this |
diff --git a/lisp/electric.el b/lisp/electric.el index 8e9d23be231..a0d849bbcca 100644 --- a/lisp/electric.el +++ b/lisp/electric.el | |||
| @@ -178,6 +178,10 @@ | |||
| 178 | 178 | ||
| 179 | ;; Electric indentation. | 179 | ;; Electric indentation. |
| 180 | 180 | ||
| 181 | ;; Autoloading variables is generally undesirable, but major modes | ||
| 182 | ;; should usually set this variable by adding elements to the default | ||
| 183 | ;; value, which only works well if the variable is preloaded. | ||
| 184 | ;;;###autoload | ||
| 181 | (defvar electric-indent-chars '(?\n) | 185 | (defvar electric-indent-chars '(?\n) |
| 182 | "Characters that should cause automatic reindentation.") | 186 | "Characters that should cause automatic reindentation.") |
| 183 | 187 | ||
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 56de9b869db..40931c3d54d 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el | |||
| @@ -646,9 +646,8 @@ including a reproducible test case and send the message." | |||
| 646 | (aref (cdr kw) (1- (length (cdr kw))))) | 646 | (aref (cdr kw) (1- (length (cdr kw))))) |
| 647 | smie-closer-alist)))))) | 647 | smie-closer-alist)))))) |
| 648 | 648 | ||
| 649 | ;; FIXME: maybe we should use (cons ?\; electric-indent-chars) | 649 | (set (make-local-variable 'electric-indent-chars) |
| 650 | ;; since only ; is really octave-specific. | 650 | (cons ?\; electric-indent-chars)) |
| 651 | (set (make-local-variable 'electric-indent-chars) '(?\; ?\s ?\n)) | ||
| 652 | 651 | ||
| 653 | (set (make-local-variable 'comment-start) octave-comment-start) | 652 | (set (make-local-variable 'comment-start) octave-comment-start) |
| 654 | (set (make-local-variable 'comment-end) "") | 653 | (set (make-local-variable 'comment-end) "") |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 4d015de5198..af68699f2a4 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -135,11 +135,9 @@ This should only be called after matching against `ruby-here-doc-beg-re'." | |||
| 135 | (defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]") | 135 | (defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]") |
| 136 | "Regexp to match symbols.") | 136 | "Regexp to match symbols.") |
| 137 | 137 | ||
| 138 | (defvar ruby-mode-abbrev-table nil | 138 | (define-abbrev-table 'ruby-mode-abbrev-table () |
| 139 | "Abbrev table in use in Ruby mode buffers.") | 139 | "Abbrev table in use in Ruby mode buffers.") |
| 140 | 140 | ||
| 141 | (define-abbrev-table 'ruby-mode-abbrev-table ()) | ||
| 142 | |||
| 143 | (defvar ruby-mode-map | 141 | (defvar ruby-mode-map |
| 144 | (let ((map (make-sparse-keymap))) | 142 | (let ((map (make-sparse-keymap))) |
| 145 | (define-key map "{" 'ruby-electric-brace) | 143 | (define-key map "{" 'ruby-electric-brace) |
| @@ -1430,8 +1428,6 @@ See `font-lock-syntax-table'.") | |||
| 1430 | ) | 1428 | ) |
| 1431 | "Additional expressions to highlight in Ruby mode.") | 1429 | "Additional expressions to highlight in Ruby mode.") |
| 1432 | 1430 | ||
| 1433 | (defvar electric-indent-chars) | ||
| 1434 | |||
| 1435 | ;;;###autoload | 1431 | ;;;###autoload |
| 1436 | (define-derived-mode ruby-mode prog-mode "Ruby" | 1432 | (define-derived-mode ruby-mode prog-mode "Ruby" |
| 1437 | "Major mode for editing Ruby scripts. | 1433 | "Major mode for editing Ruby scripts. |
| @@ -1456,8 +1452,7 @@ The variable `ruby-indent-level' controls the amount of indentation. | |||
| 1456 | 'ruby-mode-set-encoding nil 'local) | 1452 | 'ruby-mode-set-encoding nil 'local) |
| 1457 | 1453 | ||
| 1458 | (set (make-local-variable 'electric-indent-chars) | 1454 | (set (make-local-variable 'electric-indent-chars) |
| 1459 | (append '(?\{ ?\}) (if (boundp 'electric-indent-chars) | 1455 | (append '(?\{ ?\}) electric-indent-chars)) |
| 1460 | (default-value 'electric-indent-chars)))) | ||
| 1461 | 1456 | ||
| 1462 | (set (make-local-variable 'font-lock-defaults) | 1457 | (set (make-local-variable 'font-lock-defaults) |
| 1463 | '((ruby-font-lock-keywords) nil nil)) | 1458 | '((ruby-font-lock-keywords) nil nil)) |