GNU bug report logs -
#26923
25.2; `setq-local': allow multiple assignments or add optional buffer arg
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26923 in the body.
You can then email your comments to 26923 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26923
; Package
emacs
.
(Sun, 14 May 2017 14:16:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Drew Adams <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 14 May 2017 14:16:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
1. I believe this has been discussed before, and presumably the result
(decision or lack of one) has been not to make the change, but I'd
still suggest that `setq-local', like `setq', should allow multiple
assignment pairs.
2. If that's definitely rejected then please consider this other
enhancement instead: Allow a buffer argument:
(setq-local VAR VALUE &optional BUFFER)
This would be essentially just a convenience.
See this emacs.SE question:
https://emacs.stackexchange.com/q/32787/105
In GNU Emacs 25.2.1 (x86_64-w64-mingw32)
of 2017-04-24
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --without-dbus --without-compress-install 'CFLAGS=-O2
-static -g3''
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26923
; Package
emacs
.
(Wed, 09 Oct 2019 08:17:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 26923 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
> 1. I believe this has been discussed before, and presumably the result
> (decision or lack of one) has been not to make the change, but I'd
> still suggest that `setq-local', like `setq', should allow multiple
> assignment pairs.
This was implemented by
Jordon Biondo <jordonbiondo <at> gmail.com>
but never applied. Biondo has copyright assignment papers on file, but
apparently the final movement here was this email from Eli:
> > From: Jordon Biondo <jordonbiondo <at> gmail.com>
> > Date: Wed, 8 Feb 2017 10:59:19 -0500
> > Cc: John Wiegley <jwiegley <at> gmail.com>, Emacs development discussions
> > <emacs-devel <at> gnu.org>
> >
> > My paperwork is now complete, if that's the only thing holding up this patch.
>
> Thanks. Could you please re-submit your patch, and add to it suitable
> changes to NEWS and to the ELisp manual?
Eli, if you still think this is something that should be done, I can add
the NEWS entry and the manual changes. I've re-spun the patch for the
current trunk:
diff --git a/lisp/subr.el b/lisp/subr.el
index e361b8324f..8cb8bcef69 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -143,11 +143,22 @@ setq-default
(push `(set-default ',(pop args) ,(pop args)) exps))
`(progn . ,(nreverse exps))))
-(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.
(declare (debug (symbolp form)))
- (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.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26923
; Package
emacs
.
(Thu, 10 Oct 2019 10:34:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 26923 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Wed, 09 Oct 2019 10:15:49 +0200
> Cc: 26923 <at> debbugs.gnu.org
>
> > Thanks. Could you please re-submit your patch, and add to it suitable
> > changes to NEWS and to the ELisp manual?
>
> Eli, if you still think this is something that should be done, I can add
> the NEWS entry and the manual changes.
Yes, please, and thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26923
; Package
emacs
.
(Thu, 10 Oct 2019 13:03:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 26923 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Thu, 10 Oct 2019 13:33:34 +0300, Eli Zaretskii <eliz <at> gnu.org> said:
>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Date: Wed, 09 Oct 2019 10:15:49 +0200
>> Cc: 26923 <at> debbugs.gnu.org
>>
>> > Thanks. Could you please re-submit your patch, and add to it suitable
>> > changes to NEWS and to the ELisp manual?
>>
>> Eli, if you still think this is something that should be done, I can add
>> the NEWS entry and the manual changes.
Eli> Yes, please, and thanks.
Unlike 'setq', this new version of 'setq-local' does not enforce an
even number of arguments, so the last arg gets set to nil.
Robert
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26923
; Package
emacs
.
(Thu, 10 Oct 2019 13:47:01 GMT)
Full text and
rfc822 format available.
Message #19 received at 26923 <at> debbugs.gnu.org (full text, mbox):
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 26923 <at> debbugs.gnu.org
> Date: Thu, 10 Oct 2019 15:02:15 +0200
>
> Unlike 'setq', this new version of 'setq-local' does not enforce an
> even number of arguments
Maybe it should, for consistency (less things to remember)?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26923
; Package
emacs
.
(Fri, 11 Oct 2019 05:57:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 26923 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Unlike 'setq', this new version of 'setq-local' does not enforce an
>> even number of arguments
>
> Maybe it should, for consistency (less things to remember)?
Yes, I think so. I'll rework the patch to check for that.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26923
; Package
emacs
.
(Fri, 11 Oct 2019 06:30:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 26923 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> Unlike 'setq', this new version of 'setq-local' does not enforce an
>>> even number of arguments
>>
>> Maybe it should, for consistency (less things to remember)?
>
> Yes, I think so. I'll rework the patch to check for that.
I've now done this, as well as updating the documentation and NEWS, and
I've made nntp.el use the new syntax (as a test case).
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 11 Oct 2019 06:30:03 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
26923 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 11 Oct 2019 06:30:03 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 08 Nov 2019 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 169 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.