[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r102126: * lisp/electric.el (electric
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r102126: * lisp/electric.el (electric-indent-chars): Autoload. |
Date: |
Wed, 27 Oct 2010 10:26:01 -0400 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 102126
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2010-10-27 10:26:01 -0400
message:
* 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.
modified:
lisp/ChangeLog
lisp/electric.el
lisp/progmodes/octave-mod.el
lisp/progmodes/ruby-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-10-27 06:50:28 +0000
+++ b/lisp/ChangeLog 2010-10-27 14:26:01 +0000
@@ -1,3 +1,10 @@
+2010-10-27 Stefan Monnier <address@hidden>
+
+ * 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 <address@hidden>
* abbrev.el (abbrev-mode): Remove one of the three definitions of this
=== modified file 'lisp/electric.el'
--- a/lisp/electric.el 2010-09-04 22:54:58 +0000
+++ b/lisp/electric.el 2010-10-27 14:26:01 +0000
@@ -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.
+;;;###autoload
(defvar electric-indent-chars '(?\n)
"Characters that should cause automatic reindentation.")
=== modified file 'lisp/progmodes/octave-mod.el'
--- a/lisp/progmodes/octave-mod.el 2010-10-07 11:27:19 +0000
+++ b/lisp/progmodes/octave-mod.el 2010-10-27 14:26:01 +0000
@@ -646,9 +646,8 @@
(aref (cdr kw) (1- (length (cdr kw)))))
smie-closer-alist))))))
- ;; 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) "")
=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el 2010-09-10 23:13:42 +0000
+++ b/lisp/progmodes/ruby-mode.el 2010-10-27 14:26:01 +0000
@@ -135,11 +135,9 @@
(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 @@
)
"Additional expressions to highlight in Ruby mode.")
-(defvar electric-indent-chars)
-
;;;###autoload
(define-derived-mode ruby-mode prog-mode "Ruby"
"Major mode for editing Ruby scripts.
@@ -1456,8 +1452,7 @@
'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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r102126: * lisp/electric.el (electric-indent-chars): Autoload.,
Stefan Monnier <=