Mercurial > emacs
changeset 98907:93a97d9279a2
(apply-partially): Move from minibuffer.el to subr.el.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sun, 19 Oct 2008 21:06:03 +0000 |
parents | b6a53f3e132c |
children | 96eaae8a24b8 |
files | lisp/minibuffer.el lisp/subr.el |
diffstat | 2 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/minibuffer.el Sun Oct 19 20:52:40 2008 +0000 +++ b/lisp/minibuffer.el Sun Oct 19 21:06:03 2008 +0000 @@ -96,14 +96,6 @@ (or res (if firsterror (signal (car firsterror) (cdr firsterror)))))) -(defun apply-partially (fun &rest args) - "Do a \"curried\" 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 that takes the remaining arguments, -and calls FUN." - (lexical-let ((fun fun) (args1 args)) - (lambda (&rest args2) (apply fun (append args1 args2))))) - (defun complete-with-action (action table string pred) "Perform completion ACTION. STRING is the string to complete.
--- a/lisp/subr.el Sun Oct 19 20:52:40 2008 +0000 +++ b/lisp/subr.el Sun Oct 19 21:06:03 2008 +0000 @@ -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.