diff options
| author | Bozhidar Batsov | 2013-11-02 04:17:54 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2013-11-02 04:17:54 +0400 |
| commit | a3996a2eba1a85e33da320f7bcec0e714ea1d6d6 (patch) | |
| tree | 9f58d25d55de5218685d7663b2941f705b45bc9d | |
| parent | 6f9260e8f83078698c8a50756ecdfd13e61a80ec (diff) | |
| download | emacs-a3996a2eba1a85e33da320f7bcec0e714ea1d6d6.tar.gz emacs-a3996a2eba1a85e33da320f7bcec0e714ea1d6d6.zip | |
* lisp/progmodes/ruby-mode.el (ruby-mode-variables, ruby-mode): Use `setq-local'.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 52 |
2 files changed, 25 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e4438e0f497..dc8cc973423 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-11-02 Bozhidar Batsov <bozhidar@batsov.com> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-mode-variables, ruby-mode): Use `setq-local'. | ||
| 4 | |||
| 1 | 2013-11-01 Bozhidar Batsov <bozhidar@batsov.com> | 5 | 2013-11-01 Bozhidar Batsov <bozhidar@batsov.com> |
| 2 | 6 | ||
| 3 | * progmodes/ruby-mode.el (ruby-mode-variables): Don't set syntax | 7 | * progmodes/ruby-mode.el (ruby-mode-variables): Don't set syntax |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index db78d33e61e..c8d7169ca58 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -565,17 +565,17 @@ explicitly declared in magic comment." | |||
| 565 | (smie-setup ruby-smie-grammar #'ruby-smie-rules | 565 | (smie-setup ruby-smie-grammar #'ruby-smie-rules |
| 566 | :forward-token #'ruby-smie--forward-token | 566 | :forward-token #'ruby-smie--forward-token |
| 567 | :backward-token #'ruby-smie--backward-token) | 567 | :backward-token #'ruby-smie--backward-token) |
| 568 | (set (make-local-variable 'indent-line-function) 'ruby-indent-line)) | 568 | (setq-local indent-line-function 'ruby-indent-line)) |
| 569 | (set (make-local-variable 'require-final-newline) t) | 569 | (setq-local require-final-newline t) |
| 570 | (set (make-local-variable 'comment-start) "# ") | 570 | (setq-local comment-start "# ") |
| 571 | (set (make-local-variable 'comment-end) "") | 571 | (setq-local comment-end "") |
| 572 | (set (make-local-variable 'comment-column) ruby-comment-column) | 572 | (setq-local comment-column ruby-comment-column) |
| 573 | (set (make-local-variable 'comment-start-skip) "#+ *") | 573 | (setq-local comment-start-skip "#+ *") |
| 574 | (set (make-local-variable 'parse-sexp-ignore-comments) t) | 574 | (setq-local parse-sexp-ignore-comments t) |
| 575 | (set (make-local-variable 'parse-sexp-lookup-properties) t) | 575 | (setq-local parse-sexp-lookup-properties t) |
| 576 | (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter)) | 576 | (setq-local paragraph-start (concat "$\\|" page-delimiter)) |
| 577 | (set (make-local-variable 'paragraph-separate) paragraph-start) | 577 | (setq-local paragraph-separate paragraph-start) |
| 578 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t)) | 578 | (setq-local paragraph-ignore-fill-prefix t)) |
| 579 | 579 | ||
| 580 | (defun ruby-mode-set-encoding () | 580 | (defun ruby-mode-set-encoding () |
| 581 | "Insert a magic comment header with the proper encoding if necessary." | 581 | "Insert a magic comment header with the proper encoding if necessary." |
| @@ -2069,32 +2069,22 @@ The variable `ruby-indent-level' controls the amount of indentation. | |||
| 2069 | \\{ruby-mode-map}" | 2069 | \\{ruby-mode-map}" |
| 2070 | (ruby-mode-variables) | 2070 | (ruby-mode-variables) |
| 2071 | 2071 | ||
| 2072 | (set (make-local-variable 'imenu-create-index-function) | 2072 | (setq-local imenu-create-index-function 'ruby-imenu-create-index) |
| 2073 | 'ruby-imenu-create-index) | 2073 | (setq-local add-log-current-defun-function 'ruby-add-log-current-method) |
| 2074 | (set (make-local-variable 'add-log-current-defun-function) | 2074 | (setq-local beginning-of-defun-function 'ruby-beginning-of-defun) |
| 2075 | 'ruby-add-log-current-method) | 2075 | (setq-local end-of-defun-function 'ruby-end-of-defun) |
| 2076 | (set (make-local-variable 'beginning-of-defun-function) | ||
| 2077 | 'ruby-beginning-of-defun) | ||
| 2078 | (set (make-local-variable 'end-of-defun-function) | ||
| 2079 | 'ruby-end-of-defun) | ||
| 2080 | 2076 | ||
| 2081 | (add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local) | 2077 | (add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local) |
| 2082 | 2078 | ||
| 2083 | (set (make-local-variable 'electric-indent-chars) | 2079 | (setq-local electric-indent-chars (append '(?\{ ?\}) electric-indent-chars)) |
| 2084 | (append '(?\{ ?\}) electric-indent-chars)) | ||
| 2085 | 2080 | ||
| 2086 | (set (make-local-variable 'font-lock-defaults) | 2081 | (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil)) |
| 2087 | '((ruby-font-lock-keywords) nil nil)) | 2082 | (setq-local font-lock-keywords ruby-font-lock-keywords) |
| 2088 | (set (make-local-variable 'font-lock-keywords) | 2083 | (setq-local font-lock-syntax-table ruby-font-lock-syntax-table) |
| 2089 | ruby-font-lock-keywords) | ||
| 2090 | (set (make-local-variable 'font-lock-syntax-table) | ||
| 2091 | ruby-font-lock-syntax-table) | ||
| 2092 | 2084 | ||
| 2093 | (if (eval-when-compile (fboundp 'syntax-propertize-rules)) | 2085 | (if (eval-when-compile (fboundp 'syntax-propertize-rules)) |
| 2094 | (set (make-local-variable 'syntax-propertize-function) | 2086 | (setq-local syntax-propertize-function #'ruby-syntax-propertize-function) |
| 2095 | #'ruby-syntax-propertize-function) | 2087 | (setq-local font-lock-syntactic-keywords ruby-font-lock-syntactic-keywords))) |
| 2096 | (set (make-local-variable 'font-lock-syntactic-keywords) | ||
| 2097 | ruby-font-lock-syntactic-keywords))) | ||
| 2098 | 2088 | ||
| 2099 | ;;; Invoke ruby-mode when appropriate | 2089 | ;;; Invoke ruby-mode when appropriate |
| 2100 | 2090 | ||