APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1530456266 -3600
# Sun Jul 01 15:44:26 2018 +0100
# Node ID 665a83d265d76b1a23285d90efb85191f8766b6f
# Parent c66cd0e4e0e01df0a941afa79d9c65498021ddf2
Small fixes, #'apply-partially.
lisp/ChangeLog addition:
2018-07-01 Aidan Kehoe <kehoea(a)parhasard.net>
[...]
* subr.el (apply-partially):
[...]
Do the check for the number of args passed correctly.
If we haven't been supplied an explicit lambda, use an uninterned
symbol for the argument list name, avoiding problems with dynamic
scope.
diff -r c66cd0e4e0e0 -r 665a83d265d7 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jul 01 14:11:26 2018 +0100
+++ b/lisp/ChangeLog Sun Jul 01 15:44:26 2018 +0100
@@ -11,6 +11,10 @@
we've been supplied an explicit lambda. Parse the supplied arglist
and construct one that reflects it, something that allows the byte
compiler to give more useful warnings with labels.
+ Do the check for the number of args passed correctly.
+ If we haven't been supplied an explicit lambda, use an uninterned
+ symbol for the argument list name, avoiding problems with dynamic
+ scope.
2018-06-30 Aidan Kehoe <kehoea(a)parhasard.net>
diff -r c66cd0e4e0e0 -r 665a83d265d7 lisp/subr.el
--- a/lisp/subr.el Sun Jul 01 14:11:26 2018 +0100
+++ b/lisp/subr.el Sun Jul 01 15:44:26 2018 +0100
@@ -83,7 +83,7 @@
the first N arguments are fixed at the values with which this function
was called."
(if (and (eq 'lambda (car-safe function))
- (< (length args) (or (function-max-args function)
+ (<= (length args) (or (function-max-args function)
most-positive-fixnum)))
;; XEmacs; for our constructed function, don't just use a (&rest args)
;; arglist if there is an explicit lambda supplied. This allows the
@@ -125,8 +125,8 @@
(push (pop body) header))
`(lambda ,arglist ,@(nreverse header)
(let ,(nreverse bindings) ,@body)))
- `(lambda (&rest args)
- (apply ',function ,@(mapcar 'quote-maybe args) args))))
+ `(lambda (&rest #1=#:args)
+ (apply ',function ,@(mapcar 'quote-maybe args) #1#))))
;; FSF 21.2 has various basic macros here. We don't because they're either
;; in cl*.el (which we dump and hence is always available) or built-in.
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)
Show replies by date