all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] * lisp/progmodes/ruby-mode.el: Use `setq-local' where appropriate.
@ 2013-10-31 12:40 Bozhidar Batsov
  2013-10-31 17:55 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Bozhidar Batsov @ 2013-10-31 12:40 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 175 bytes --]

Hi everyone,  

The attached patch simply replaces (set (make-local-variable …)…) with `setq-local’ where appropriate in ruby-mode.el.  

--  
Cheers,
Bozhidar


[-- Attachment #1.2: Type: text/html, Size: 464 bytes --]

[-- Attachment #2: 0001-lisp-progmodes-ruby-mode.el-Use-setq-local-where-app.patch --]
[-- Type: application/octet-stream, Size: 4096 bytes --]

From 05c45e2fad7abd9fa1214554ee8fed1e1ea53f9f Mon Sep 17 00:00:00 2001
From: Bozhidar Batsov <bozhidar@batsov.com>
Date: Thu, 31 Oct 2013 14:35:05 +0200
Subject: [PATCH] * lisp/progmodes/ruby-mode.el: Use `setq-local' where
 appropriate.

---
 lisp/progmodes/ruby-mode.el | 52 ++++++++++++++++++---------------------------
 1 file changed, 21 insertions(+), 31 deletions(-)

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 441f166..80edeb5 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -568,17 +568,17 @@ explicitly declared in magic comment."
       (smie-setup ruby-smie-grammar #'ruby-smie-rules
                   :forward-token  #'ruby-smie--forward-token
                   :backward-token #'ruby-smie--backward-token)
-    (set (make-local-variable 'indent-line-function) 'ruby-indent-line))
-  (set (make-local-variable 'require-final-newline) t)
-  (set (make-local-variable 'comment-start) "# ")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'comment-column) ruby-comment-column)
-  (set (make-local-variable 'comment-start-skip) "#+ *")
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
-  (set (make-local-variable 'parse-sexp-lookup-properties) t)
-  (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
-  (set (make-local-variable 'paragraph-separate) paragraph-start)
-  (set (make-local-variable 'paragraph-ignore-fill-prefix) t))
+    (setq-local indent-line-function 'ruby-indent-line))
+  (setq-local require-final-newline t)
+  (setq-local comment-start "# ")
+  (setq-local comment-end "")
+  (setq-local comment-column ruby-comment-column)
+  (setq-local comment-start-skip "#+ *")
+  (setq-local parse-sexp-ignore-comments t)
+  (setq-local parse-sexp-lookup-properties t)
+  (setq-local paragraph-start (concat "$\\|" page-delimiter))
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local paragraph-ignore-fill-prefix t))
 
 (defun ruby-mode-set-encoding ()
   "Insert a magic comment header with the proper encoding if necessary."
@@ -2072,32 +2072,22 @@ The variable `ruby-indent-level' controls the amount of indentation.
 \\{ruby-mode-map}"
   (ruby-mode-variables)
 
-  (set (make-local-variable 'imenu-create-index-function)
-       'ruby-imenu-create-index)
-  (set (make-local-variable 'add-log-current-defun-function)
-       'ruby-add-log-current-method)
-  (set (make-local-variable 'beginning-of-defun-function)
-       'ruby-beginning-of-defun)
-  (set (make-local-variable 'end-of-defun-function)
-       'ruby-end-of-defun)
+  (setq-local imenu-create-index-function 'ruby-imenu-create-index)
+  (setq-local add-log-current-defun-function 'ruby-add-log-current-method)
+  (setq-local beginning-of-defun-function 'ruby-beginning-of-defun)
+  (setq-local end-of-defun-function 'ruby-end-of-defun)
 
   (add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local)
 
-  (set (make-local-variable 'electric-indent-chars)
-       (append '(?\{ ?\}) electric-indent-chars))
+  (setq-local electric-indent-chars (append '(?\{ ?\}) electric-indent-chars))
 
-  (set (make-local-variable 'font-lock-defaults)
-       '((ruby-font-lock-keywords) nil nil))
-  (set (make-local-variable 'font-lock-keywords)
-       ruby-font-lock-keywords)
-  (set (make-local-variable 'font-lock-syntax-table)
-       ruby-font-lock-syntax-table)
+  (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil))
+  (setq-local font-lock-keywords ruby-font-lock-keywords)
+  (setq-local font-lock-syntax-table ruby-font-lock-syntax-table)
 
   (if (eval-when-compile (fboundp 'syntax-propertize-rules))
-      (set (make-local-variable 'syntax-propertize-function)
-           #'ruby-syntax-propertize-function)
-    (set (make-local-variable 'font-lock-syntactic-keywords)
-         ruby-font-lock-syntactic-keywords)))
+      (setq-local syntax-propertize-function #'ruby-syntax-propertize-function)
+    (setq-local font-lock-syntactic-keywords ruby-font-lock-syntactic-keywords)))
 
 ;;; Invoke ruby-mode when appropriate
 
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-02  0:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 12:40 [PATCH] * lisp/progmodes/ruby-mode.el: Use `setq-local' where appropriate Bozhidar Batsov
2013-10-31 17:55 ` Stefan Monnier
2013-10-31 19:44   ` Bozhidar Batsov
2013-11-01  3:43     ` Dmitry Gutov
2013-11-01 12:26       ` Stefan Monnier
2013-11-02  0:23         ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.