[Top][All Lists]

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

Re: Revisiting `setq-local`s signature

From: Jordon Biondo
Subject: Re: Revisiting `setq-local`s signature
Date: Thu, 2 Feb 2017 09:28:06 -0500

Below is an updated patch of the change.

From 625060e5a72f0e25bd2c59bad9f4b828ac80ac0f Mon Sep 17 00:00:00 2001
From: jordonbiondo <address@hidden>
Date: Thu, 2 Feb 2017 09:20:02 -0500
Subject: [PATCH] * lisp/subr.el (setq-local): Is now variadic like setq

 lisp/subr.el | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index a204577..447952c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -118,10 +118,21 @@ lambda
   ;; depend on backquote.el.
   (list 'function (cons 'lambda cdr)))
-(defmacro setq-local (var val)
-  "Set variable VAR to value VAL in current buffer."
+(defmacro setq-local (&rest args)
+  "Set each SYM to the value of its VAL in the current buffer.
+\(fn [SYM VAL]...)"
   ;; Can't use backquote here, it's too early in the bootstrap.
-  (list 'set (list 'make-local-variable (list 'quote var)) val))
+  (let ((expr))
+    (while args
+      (setq expr
+            (cons
+             (list 'set
+                   (list 'make-local-variable (list 'quote (car args)))
+                   (car (cdr args)))
+             expr))
+      (setq args (cdr (cdr args))))
+    (cons 'progn (nreverse expr))))
 (defmacro defvar-local (var val &optional docstring)
   "Define VAR as a buffer-local variable with default value VAL.
2.7.4 (Apple Git-66)

On Wed, Feb 1, 2017 at 10:34 PM, Eli Zaretskii <address@hidden> wrote:
> From: John Wiegley <address@hidden>
> Date: Wed, 01 Feb 2017 22:01:29 -0500
> Cc: Emacs development discussions <address@hidden>
> >>>>> "JB" == Jordon Biondo <address@hidden> writes:
> JB> Are maintainers and users still opposed to this change? If not I'd be
> JB> happy to update the patch from the previous thread.
> I wouldn't mind having them be consistent, if only because it makes it easier
> to switch between them, and there is nothing necessary about the
> inconsistency. Eli?

No objections.

reply via email to

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