changeset 4550:f189820e7ea7

(Qminibuffer_setup_hook, Vminibuffer_setup_hook): New vars. (syms_of_minibuf): Set them up. (read_minibuffer): Run the hook, if not empty.
author Richard M. Stallman <rms@gnu.org>
date Wed, 11 Aug 1993 05:23:49 +0000
parents 076ad69b0c77
children 1abd3007cbb6
files src/minibuf.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;