aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2008-10-19 21:07:17 +0000
committerEli Zaretskii2008-10-19 21:07:17 +0000
commitb8fc05a9f2f9b6296b43b8b7fb0acfc88b846c08 (patch)
tree6508aece0978dad68255f9e84173a84a447267a8
parentd6328fba7f9e39c3280c7078b4b4452a96210b39 (diff)
downloademacs-b8fc05a9f2f9b6296b43b8b7fb0acfc88b846c08.tar.gz
emacs-b8fc05a9f2f9b6296b43b8b7fb0acfc88b846c08.zip
(apply-partially): Move from minibuffer.el to subr.el.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/minibuffer.el8
-rw-r--r--lisp/subr.el9
3 files changed, 11 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 77925f3beb6..2ae4b90e7b1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12008-10-19 Eli Zaretskii <eliz@gnu.org> 12008-10-19 Eli Zaretskii <eliz@gnu.org>
2 2
3 * subr.el (apply-partially): Moved here from minibuffer.el. Doc fix.
4
3 * simple.el (minibuffer-default-add-shell-commands): Doc fix. 5 * simple.el (minibuffer-default-add-shell-commands): Doc fix.
4 6
52008-10-19 Martin Rudalics <rudalics@gmx.at> 72008-10-19 Martin Rudalics <rudalics@gmx.at>
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index b64a8d08ae5..7626b5d1352 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -96,14 +96,6 @@ Like CL's `some'."
96 (or res 96 (or res
97 (if firsterror (signal (car firsterror) (cdr firsterror)))))) 97 (if firsterror (signal (car firsterror) (cdr firsterror))))))
98 98
99(defun apply-partially (fun &rest args)
100 "Do a \"curried\" partial application of FUN to ARGS.
101ARGS is a list of the first N arguments to pass to FUN.
102The result is a new function that takes the remaining arguments,
103and calls FUN."
104 (lexical-let ((fun fun) (args1 args))
105 (lambda (&rest args2) (apply fun (append args1 args2)))))
106
107(defun complete-with-action (action table string pred) 99(defun complete-with-action (action table string pred)
108 "Perform completion ACTION. 100 "Perform completion ACTION.
109STRING is the string to complete. 101STRING is the string to complete.
diff --git a/lisp/subr.el b/lisp/subr.el
index d62b38b00d4..d078f3dd9ef 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2254,6 +2254,15 @@ Otherwise, return nil."
2254 (get-char-property (1- (field-end pos)) 'field) 2254 (get-char-property (1- (field-end pos)) 'field)
2255 raw-field))) 2255 raw-field)))
2256 2256
2257(defun apply-partially (fun &rest args)
2258 "Return a function that is a partial application of FUN to ARGS.
2259ARGS is a list of the first N arguments to pass to FUN.
2260The result is a new function which does the same as FUN, except that
2261the first N arguments are fixed at the values with which this function
2262was called."
2263 (lexical-let ((fun fun) (args1 args))
2264 (lambda (&rest args2) (apply fun (append args1 args2)))))
2265
2257 2266
2258;;;; Support for yanking and text properties. 2267;;;; Support for yanking and text properties.
2259 2268