diff options
| author | Eli Zaretskii | 2015-12-19 16:35:42 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-12-19 16:35:42 +0200 |
| commit | 62812203fa7ec4c296dea988b61fbd34c263d212 (patch) | |
| tree | 8d48e821fe0e3fc964db0310030840b5ccca1fe4 | |
| parent | 277d7efd24082f989c72a1a91df6ded8546bfbfb (diff) | |
| download | emacs-62812203fa7ec4c296dea988b61fbd34c263d212.tar.gz emacs-62812203fa7ec4c296dea988b61fbd34c263d212.zip | |
Document the new feature of 'minibuffer-with-setup-hook'
* lisp/files.el (minibuffer-with-setup-hook): Clarify how FUN is
added to `minibuffer-setup-hook'.
| -rw-r--r-- | etc/NEWS | 9 | ||||
| -rw-r--r-- | lisp/files.el | 6 |
2 files changed, 11 insertions, 4 deletions
| @@ -647,8 +647,13 @@ respectively, `show-paren-when-point-inside-paren' or | |||
| 647 | These should be used in preference to `font-lock-fontify-buffer' when | 647 | These should be used in preference to `font-lock-fontify-buffer' when |
| 648 | called from Lisp. | 648 | called from Lisp. |
| 649 | 649 | ||
| 650 | ** Macro `minibuffer-with-setup-hook' takes (:append FUN) to mean | 650 | --- |
| 651 | appending FUN to `minibuffer-setup-hook'. | 651 | ** Macro `minibuffer-with-setup-hook' can optionally append a function |
| 652 | to `minibuffer-setup-hook'. | ||
| 653 | |||
| 654 | If the first argument of the macro is of the form `(:append FUN)', | ||
| 655 | then FUN will be appended to `minibuffer-setup-hook', instead of | ||
| 656 | prepending it. | ||
| 652 | 657 | ||
| 653 | ** cl-lib | 658 | ** cl-lib |
| 654 | *** New functions cl-fresh-line, cl-digit-char-p and cl-parse-integer. | 659 | *** New functions cl-fresh-line, cl-digit-char-p and cl-parse-integer. |
diff --git a/lisp/files.el b/lisp/files.el index e7f7151acbd..ea09c2a9fa4 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1431,8 +1431,10 @@ return value, which may be passed as the REQUIRE-MATCH arg to | |||
| 1431 | 1431 | ||
| 1432 | (defmacro minibuffer-with-setup-hook (fun &rest body) | 1432 | (defmacro minibuffer-with-setup-hook (fun &rest body) |
| 1433 | "Temporarily add FUN to `minibuffer-setup-hook' while executing BODY. | 1433 | "Temporarily add FUN to `minibuffer-setup-hook' while executing BODY. |
| 1434 | FUN can also be (:append FUN1), in which case FUN1 is appended to | 1434 | |
| 1435 | `minibuffer-setup-hook'. | 1435 | By default, FUN is prepended to `minibuffer-setup-hook'. But if FUN is of |
| 1436 | the form `(:append FUN1)', FUN1 will be appended to `minibuffer-setup-hook' | ||
| 1437 | instead of prepending it. | ||
| 1436 | 1438 | ||
| 1437 | BODY should use the minibuffer at most once. | 1439 | BODY should use the minibuffer at most once. |
| 1438 | Recursive uses of the minibuffer are unaffected (FUN is not | 1440 | Recursive uses of the minibuffer are unaffected (FUN is not |