# HG changeset patch # User Karl Heuer # Date 765769128 0 # Node ID ef62a96ce830f155c9c0c68fca77e979f62952f9 # Parent 840862375e93ff4dc36c0f468923b8dda2d2ead5 (Vminibuffer_exit_hook): New variable. (read_minibuf): Run hook when exiting minibuffer. diff -r 840862375e93 -r ef62a96ce830 src/minibuf.c --- a/src/minibuf.c Fri Apr 08 01:27:28 1994 +0000 +++ b/src/minibuf.c Fri Apr 08 01:38:48 1994 +0000 @@ -79,9 +79,10 @@ Lisp_Object Qread_file_name_internal; -/* Normal hook for entry to minibuffer. */ +/* Normal hooks for entry to and exit from minibuffer. */ Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; +Lisp_Object Qminibuffer_exit_hook, Vminibuffer_exit_hook; /* Nonzero means completion ignores case. */ @@ -266,6 +267,10 @@ /* ??? MCC did redraw_screen here if switching screens. */ recursive_edit_1 (); + if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) + && !NILP (Vrun_hooks)) + call1 (Vrun_hooks, Qminibuffer_exit_hook); + /* If cursor is on the minibuffer line, show the user we have exited by putting it in column 0. */ if ((FRAME_CURSOR_Y (selected_frame) @@ -1589,10 +1594,17 @@ Qminibuffer_setup_hook = intern ("minibuffer-setup-hook"); staticpro (&Qminibuffer_setup_hook); + Qminibuffer_exit_hook = intern ("minibuffer-exit-hook"); + staticpro (&Qminibuffer_exit_hook); + DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook, "Normal hook run just after entry to minibuffer."); Vminibuffer_setup_hook = Qnil; + DEFVAR_LISP ("minibuffer-exit-hook", &Vminibuffer_exit_hook, + "Normal hook run just after exit from minibuffer."); + Vminibuffer_exit_hook = Qnil; + DEFVAR_BOOL ("completion-auto-help", &auto_help, "*Non-nil means automatically provide help for invalid completion input."); auto_help = 1;