From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jordon Biondo Newsgroups: gmane.emacs.devel Subject: Re: Revisiting `setq-local`s signature Date: Thu, 2 Feb 2017 09:28:06 -0500 Message-ID: References: <83zii5uuxx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c1a0a3645adee05478cf92e X-Trace: blaine.gmane.org 1486045713 26161 195.159.176.226 (2 Feb 2017 14:28:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2017 14:28:33 +0000 (UTC) Cc: John Wiegley , Emacs development discussions To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 02 15:28:26 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZIN4-0006Qd-HW for ged-emacs-devel@m.gmane.org; Thu, 02 Feb 2017 15:28:22 +0100 Original-Received: from localhost ([::1]:56952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZINA-0002Ty-27 for ged-emacs-devel@m.gmane.org; Thu, 02 Feb 2017 09:28:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZIN0-0002Rq-Bk for emacs-devel@gnu.org; Thu, 02 Feb 2017 09:28:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZIMw-0002TC-5V for emacs-devel@gnu.org; Thu, 02 Feb 2017 09:28:18 -0500 Original-Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:32810) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZIMu-0002Rv-2W; Thu, 02 Feb 2017 09:28:12 -0500 Original-Received: by mail-lf0-x233.google.com with SMTP id x1so9414838lff.0; Thu, 02 Feb 2017 06:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KBRSrz5IrPUnr5mZdG35dA+HrYv5HyYu3qLdQHJsLUI=; b=cCIug8ppomxMxBJva8XrMWLndoRd9FNsp8QDxBTWdNwWD/DD611yNHYQ/NWD1YOtll Lb/hf6JnHGOICb3F9IDrmCLlFiFTdKzRG+Oez22fYslPxeTFiEZv/EVB54awRtsfKrXb hdH0LyHc7RTs47YZJ5Qsw+toC0ww0vcQFjHEG/aFELnA/8vROYUV1Xa07X0aZqVbORA2 d7vZ43LWza8S37Pl2YVzfBAcdPtOzS0YPpkeDRJkyyn3JHQDBU3WAtrSwM1TEQh97kvL AiJYYMVKRDN+PVuR0y2dyc9VJOV3R/254l/qixwDFQXLno/1nmLVi1jIn2SyR/x/RODg Gdow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KBRSrz5IrPUnr5mZdG35dA+HrYv5HyYu3qLdQHJsLUI=; b=ly2gJHFGdt4n0+bm8wq/nOWoAeW3Ro1HeXvX3inyd8im2EPTPX6nzuMAwEdxVHOTzy QPa/4gBXxQjJmE2jUsykHP+jC8LVE57y2fJqHFpfHQlQV6FOfGXA4u2YSFEzSEq1+umR WYBwCDe735I3gsn1ZXN5E48u/8aFGBRkFVlBA/lTposltiButKOi9eNahi+0Z6fywHZ8 hFTwiRSQ1dPtYug7SqIncyRfHY//RQRoVqrxfzAMGNxJ075P40ZCDoKs/Sa0it67x0W+ ZpexVIQrPSQXGWMYLII2Wa8oXC58Za8tRs5DTsr4TkD8ejhzM0xFh6gNyALTUYcq/bx4 nz6g== X-Gm-Message-State: AIkVDXL5mhBy79CA1w4Y7AIrLyvSvqxoPysSYahfWnyRjMt3VxNIUAvzWCPrFAz0mNdvxWY8tp8779j3l//SRg== X-Received: by 10.25.190.207 with SMTP id o198mr3247511lff.65.1486045686637; Thu, 02 Feb 2017 06:28:06 -0800 (PST) Original-Received: by 10.25.230.18 with HTTP; Thu, 2 Feb 2017 06:28:06 -0800 (PST) In-Reply-To: <83zii5uuxx.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211872 Archived-At: --94eb2c1a0a3645adee05478cf92e Content-Type: text/plain; charset=UTF-8 Below is an updated patch of the change. >From 625060e5a72f0e25bd2c59bad9f4b828ac80ac0f Mon Sep 17 00:00:00 2001 From: jordonbiondo 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 wrote: > > From: John Wiegley > > Date: Wed, 01 Feb 2017 22:01:29 -0500 > > Cc: Emacs development discussions > > > > >>>>> "JB" == Jordon Biondo 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. > --94eb2c1a0a3645adee05478cf92e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Below is an updated patch of the change.
From 625060e5a72f0e25bd2c59bad9f4b828ac80ac0f Mon Sep 17 00:00= :00 2001
From: jordonbiondo <jordonbiondo@gmail.com>
Date: Thu, 2 Feb 2017 09:= 20:02 -0500
Subject: [PATCH] * lisp/subr.el (setq-local): Is now = variadic like setq

---
=C2=A0lisp/subr.e= l | 17 ++++++++++++++---
=C2=A01 file changed, 14 insertions(+), = 3 deletions(-)

diff --git a/lisp/subr.el b/lisp/su= br.el
index a204577..447952c 100644
--- a/lisp/subr.el<= /div>
+++ b/lisp/subr.el
@@ -118,10 +118,21 @@ lambda
=C2=A0 =C2=A0;; depend on backquote.el.
=C2=A0 =C2=A0(list = 9;function (cons 'lambda cdr)))
=C2=A0
-(defmacro s= etq-local (var val)
- =C2=A0"Set variable VAR to value VAL i= n current buffer."
+(defmacro setq-local (&rest args)
+ =C2=A0"Set each SYM to the value of its VAL in the current b= uffer.
+
+\(fn [SYM VAL]...)"
=C2=A0 =C2= =A0;; Can't use backquote here, it's too early in the bootstrap.
- =C2=A0(list 'set (list 'make-local-variable (list 'qu= ote var)) val))
+ =C2=A0(let ((expr))
+ =C2=A0 =C2=A0(w= hile args
+ =C2=A0 =C2=A0 =C2=A0(setq expr
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cons
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (list 'set
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (list 'make-local-variable (list = 9;quote (car args)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (car (cdr args)))
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 expr))
+ =C2=A0 =C2=A0 =C2=A0(setq args (cdr (c= dr args))))
+ =C2=A0 =C2=A0(cons 'progn (nreverse expr))))
=C2=A0
=C2=A0(defmacro defvar-local (var val &optiona= l docstring)
=C2=A0 =C2=A0"Define VAR as a buffer-local vari= able with default value VAL.
--=C2=A0
2.7.4 (Apple Git-= 66)


On Wed, Feb 1, 2017 at 10:34 PM, Eli Zaretskii <eliz@gnu.org&g= t; wrote:
> From: John Wiegley = <jwiegley@gmail.com>
> Date: Wed, 01 Feb 2017 22:01:29 -0500
> Cc: Emacs development discussions <emacs-devel@gnu.org>
>
> >>>>> "JB" =3D=3D Jordon Biondo <jordonbiondo@gmail.com> 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 make= s it easier
> to switch between them, and there is nothing necessary about the
> inconsistency. Eli?

No objections.

--94eb2c1a0a3645adee05478cf92e--