# HG changeset patch # User Richard M. Stallman # Date 745046629 0 # Node ID f189820e7ea7a58d6eeed2af14a9e1ad1f88df33 # Parent 076ad69b0c77d406a19b26b0cbdc252031c5ca4e (Qminibuffer_setup_hook, Vminibuffer_setup_hook): New vars. (syms_of_minibuf): Set them up. (read_minibuffer): Run the hook, if not empty. diff -r 076ad69b0c77 -r f189820e7ea7 src/minibuf.c --- a/src/minibuf.c Wed Aug 11 05:01:04 1993 +0000 +++ b/src/minibuf.c Wed Aug 11 05:23:49 1993 +0000 @@ -75,6 +75,10 @@ Lisp_Object Qminibuffer_history; +/* Normal hook for entry to minibuffer. */ + +Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; + /* Nonzero means completion ignores case. */ int completion_ignore_case; @@ -223,6 +227,12 @@ Vminibuffer_history_position = histpos; Vminibuffer_history_variable = histvar; + /* Run our hook, but not if it is empty. + (run-hooks would do nothing if it is empty, + but it's important to save time here in the usual case. */ + if (!NILP (Vminibuffer_setup_hook) && !EQ (Vminibuffer_setup_hook, Qunbound)) + call1 (Vrun_hooks, Qminibuffer_setup_hook); + /* ??? MCC did redraw_screen here if switching screens. */ recursive_edit_1 (); @@ -1397,6 +1407,13 @@ Qminibuffer_history = intern ("minibuffer-history"); staticpro (&Qminibuffer_history); + Qminibuffer_setup_hook = intern ("minibuffer-setup-hook"); + staticpro (&Qminibuffer_setup_hook); + + DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook, + "Normal hook run just after entry to minibuffer."); + Vminibuffer_setup_hook = Qnil; + DEFVAR_BOOL ("completion-auto-help", &auto_help, "*Non-nil means automatically provide help for invalid completion input."); auto_help = 1;