emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/subr.el,v


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el,v
Date: Sun, 19 Oct 2008 21:06:04 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Eli Zaretskii <eliz>    08/10/19 21:06:03

Index: subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.608
retrieving revision 1.609
diff -u -b -r1.608 -r1.609
--- subr.el     28 Sep 2008 08:43:18 -0000      1.608
+++ subr.el     19 Oct 2008 21:06:03 -0000      1.609
@@ -2254,6 +2254,15 @@
        (get-char-property (1- (field-end pos)) 'field)
       raw-field)))
 
+(defun apply-partially (fun &rest args)
+  "Return a function that is a partial application of FUN to ARGS.
+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."
+  (lexical-let ((fun fun) (args1 args))
+    (lambda (&rest args2) (apply fun (append args1 args2)))))
+
 
 ;;;; Support for yanking and text properties.
 




reply via email to

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