emacs-devel
[Top][All Lists]
Advanced

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

[PATCH] Let apply-partially make use of lexical binding in subr.el


From: David Kastrup
Subject: [PATCH] Let apply-partially make use of lexical binding in subr.el
Date: Sun, 25 Jan 2015 20:45:37 +0100

* subr.el (apply-partially): Use lexical binding here.

See
<URL:http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00784.html>
for discussion.
---
 lisp/ChangeLog | 4 ++++
 lisp/subr.el   | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 70293af..7cd831c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-25  David Kastrup  <address@hidden>
+
+       * subr.el (apply-partially): Use lexical binding here.
+
 2015-01-25  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/cl-generic.el (cl--generic-no-next-method-function): New 
fun.
diff --git a/lisp/subr.el b/lisp/subr.el
index 0534585..4dee603 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -136,8 +136,8 @@ ARGS is a list of the first N arguments to pass to FUN.
 The result is a new function which does the same as FUN, except that
 the first N arguments are fixed at the values with which this function
 was called."
-  `(closure (t) (&rest args)
-            (apply ',fun ,@(mapcar (lambda (arg) `',arg) args) args)))
+  (lambda (&rest args2)
+    (apply fun (append args args2))))
 
 (defmacro push (newelt place)
   "Add NEWELT to the list stored in the generalized variable PLACE.
-- 
2.1.0




reply via email to

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