diff options
| author | Karl Heuer | 1994-04-08 01:38:48 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-04-08 01:38:48 +0000 |
| commit | 177aecf96f1d57c13d23e13f4f3e032084ddb1ef (patch) | |
| tree | dc1d4ffe9f0880b6414d0785ec7c2c958e89b450 /src | |
| parent | dedd1182ee076e170ae102af0542b18404bc4152 (diff) | |
| download | emacs-177aecf96f1d57c13d23e13f4f3e032084ddb1ef.tar.gz emacs-177aecf96f1d57c13d23e13f4f3e032084ddb1ef.zip | |
(Vminibuffer_exit_hook): New variable.
(read_minibuf): Run hook when exiting minibuffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index ea6214f4ca6..ddb8ae7d70a 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -79,9 +79,10 @@ Lisp_Object Qminibuffer_history; | |||
| 79 | 79 | ||
| 80 | Lisp_Object Qread_file_name_internal; | 80 | Lisp_Object Qread_file_name_internal; |
| 81 | 81 | ||
| 82 | /* Normal hook for entry to minibuffer. */ | 82 | /* Normal hooks for entry to and exit from minibuffer. */ |
| 83 | 83 | ||
| 84 | Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; | 84 | Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; |
| 85 | Lisp_Object Qminibuffer_exit_hook, Vminibuffer_exit_hook; | ||
| 85 | 86 | ||
| 86 | /* Nonzero means completion ignores case. */ | 87 | /* Nonzero means completion ignores case. */ |
| 87 | 88 | ||
| @@ -266,6 +267,10 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) | |||
| 266 | /* ??? MCC did redraw_screen here if switching screens. */ | 267 | /* ??? MCC did redraw_screen here if switching screens. */ |
| 267 | recursive_edit_1 (); | 268 | recursive_edit_1 (); |
| 268 | 269 | ||
| 270 | if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) | ||
| 271 | && !NILP (Vrun_hooks)) | ||
| 272 | call1 (Vrun_hooks, Qminibuffer_exit_hook); | ||
| 273 | |||
| 269 | /* If cursor is on the minibuffer line, | 274 | /* If cursor is on the minibuffer line, |
| 270 | show the user we have exited by putting it in column 0. */ | 275 | show the user we have exited by putting it in column 0. */ |
| 271 | if ((FRAME_CURSOR_Y (selected_frame) | 276 | if ((FRAME_CURSOR_Y (selected_frame) |
| @@ -1589,10 +1594,17 @@ syms_of_minibuf () | |||
| 1589 | Qminibuffer_setup_hook = intern ("minibuffer-setup-hook"); | 1594 | Qminibuffer_setup_hook = intern ("minibuffer-setup-hook"); |
| 1590 | staticpro (&Qminibuffer_setup_hook); | 1595 | staticpro (&Qminibuffer_setup_hook); |
| 1591 | 1596 | ||
| 1597 | Qminibuffer_exit_hook = intern ("minibuffer-exit-hook"); | ||
| 1598 | staticpro (&Qminibuffer_exit_hook); | ||
| 1599 | |||
| 1592 | DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook, | 1600 | DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook, |
| 1593 | "Normal hook run just after entry to minibuffer."); | 1601 | "Normal hook run just after entry to minibuffer."); |
| 1594 | Vminibuffer_setup_hook = Qnil; | 1602 | Vminibuffer_setup_hook = Qnil; |
| 1595 | 1603 | ||
| 1604 | DEFVAR_LISP ("minibuffer-exit-hook", &Vminibuffer_exit_hook, | ||
| 1605 | "Normal hook run just after exit from minibuffer."); | ||
| 1606 | Vminibuffer_exit_hook = Qnil; | ||
| 1607 | |||
| 1596 | DEFVAR_BOOL ("completion-auto-help", &auto_help, | 1608 | DEFVAR_BOOL ("completion-auto-help", &auto_help, |
| 1597 | "*Non-nil means automatically provide help for invalid completion input."); | 1609 | "*Non-nil means automatically provide help for invalid completion input."); |
| 1598 | auto_help = 1; | 1610 | auto_help = 1; |