diff options
| author | Eli Zaretskii | 2008-10-19 21:07:17 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-10-19 21:07:17 +0000 |
| commit | b8fc05a9f2f9b6296b43b8b7fb0acfc88b846c08 (patch) | |
| tree | 6508aece0978dad68255f9e84173a84a447267a8 | |
| parent | d6328fba7f9e39c3280c7078b4b4452a96210b39 (diff) | |
| download | emacs-b8fc05a9f2f9b6296b43b8b7fb0acfc88b846c08.tar.gz emacs-b8fc05a9f2f9b6296b43b8b7fb0acfc88b846c08.zip | |
(apply-partially): Move from minibuffer.el to subr.el.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 8 | ||||
| -rw-r--r-- | lisp/subr.el | 9 |
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 @@ | |||
| 1 | 2008-10-19 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-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 | ||
| 5 | 2008-10-19 Martin Rudalics <rudalics@gmx.at> | 7 | 2008-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. | ||
| 101 | ARGS is a list of the first N arguments to pass to FUN. | ||
| 102 | The result is a new function that takes the remaining arguments, | ||
| 103 | and 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. |
| 109 | STRING is the string to complete. | 101 | STRING 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. | ||
| 2259 | ARGS is a list of the first N arguments to pass to FUN. | ||
| 2260 | The result is a new function which does the same as FUN, except that | ||
| 2261 | the first N arguments are fixed at the values with which this function | ||
| 2262 | was 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 | ||