emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode e898255861 006/500: Use setq-local everywhere


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode e898255861 006/500: Use setq-local everywhere
Date: Sat, 29 Jan 2022 08:26:22 -0500 (EST)

branch: elpa/nix-mode
commit e89825586165639fa4354d037f01542f7a4319f7
Author: Matthew Justin Bauer <mjbauer95@gmail.com>
Commit: GitHub <noreply@github.com>

    Use setq-local everywhere
    
    Make everything consistent, also provide backup function for <= 24.2.
---
 nix-mode.el | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/nix-mode.el b/nix-mode.el
index 88c2cebcbc..dd8bc3e6d5 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -15,6 +15,12 @@
 
 ;;; Code:
 
+;; Emacs 24.2 compatability
+(unless (fboundp 'setq-local)
+  (defmacro setq-local (var val)
+    "Set variable VAR to value VAL in current buffer."
+    `(set (make-local-variable ',var) ,val)))
+
 (defun nix-syntax-match-antiquote (limit)
   (let ((pos (next-single-char-property-change (point) 'nix-syntax-antiquote
                                                nil limit)))
@@ -166,17 +172,17 @@ The hook `nix-mode-hook' is run when Nix mode is started.
   (setq-local parse-sexp-lookup-properties t)
 
   ;; Automatic indentation [C-j].
-  (set (make-local-variable 'indent-line-function) 'nix-indent-line)
+  (setq-local indent-line-function 'nix-indent-line)
 
   ;; Indenting of comments.
-  (set (make-local-variable 'comment-start) "# ")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
+  (setq-local comment-start "# ")
+  (setq-local comment-end "")
+  (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
 
   ;; Filling of comments.
-  (set (make-local-variable 'adaptive-fill-mode) t)
-  (set (make-local-variable 'paragraph-start) "[ \t]*\\(#+[ \t]*\\)?$")
-  (set (make-local-variable 'paragraph-separate) paragraph-start))
+  (setq-local adaptive-fill-mode t)
+  (setq-local paragraph-start "[ \t]*\\(#+[ \t]*\\)?$")
+  (setq-local paragraph-separate paragraph-start))
 
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]