changeset 16991:b33fd17a2873

(Fminibuffer_message): New function. (syms_of_minibuf): Set up Lisp function.
author Richard M. Stallman <rms@gnu.org>
date Mon, 10 Feb 1997 09:46:16 +0000
parents a2fc2ef460e3
children ff7346c31184
files src/minibuf.c
diffstat 1 files changed, 45 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/src/minibuf.c	Mon Feb 10 09:41:31 1997 +0000
+++ b/src/minibuf.c	Mon Feb 10 09:46:16 1997 +0000
@@ -1161,38 +1161,6 @@
   return unbind_to (count, val);
 }
 
-/* Temporarily display the string M at the end of the current
-   minibuffer contents.  This is used to display things like
-   "[No Match]" when the user requests a completion for a prefix
-   that has no possible completions, and other quick, unobtrusive
-   messages.  */
-
-temp_echo_area_glyphs (m)
-     char *m;
-{
-  int osize = ZV;
-  int opoint = PT;
-  Lisp_Object oinhibit;
-  oinhibit = Vinhibit_quit;
-
-  /* Clear out any old echo-area message to make way for our new thing.  */
-  message (0);
-
-  SET_PT (osize);
-  insert_string (m);
-  SET_PT (opoint);
-  Vinhibit_quit = Qt;
-  Fsit_for (make_number (2), Qnil, Qnil);
-  del_range (osize, ZV);
-  SET_PT (opoint);
-  if (!NILP (Vquit_flag))
-    {
-      Vquit_flag = Qnil;
-      Vunread_command_events = Fcons (make_number (quit_char), Qnil);
-    }
-  Vinhibit_quit = oinhibit;
-}
-
 Lisp_Object Fminibuffer_completion_help ();
 Lisp_Object assoc_for_completion ();
 /* A subroutine of Fintern_soft.  */
@@ -1798,6 +1766,50 @@
   return width;
 }
 
+/* Temporarily display the string M at the end of the current
+   minibuffer contents.  This is used to display things like
+   "[No Match]" when the user requests a completion for a prefix
+   that has no possible completions, and other quick, unobtrusive
+   messages.  */
+
+temp_echo_area_glyphs (m)
+     char *m;
+{
+  int osize = ZV;
+  int opoint = PT;
+  Lisp_Object oinhibit;
+  oinhibit = Vinhibit_quit;
+
+  /* Clear out any old echo-area message to make way for our new thing.  */
+  message (0);
+
+  SET_PT (osize);
+  insert_string (m);
+  SET_PT (opoint);
+  Vinhibit_quit = Qt;
+  Fsit_for (make_number (2), Qnil, Qnil);
+  del_range (osize, ZV);
+  SET_PT (opoint);
+  if (!NILP (Vquit_flag))
+    {
+      Vquit_flag = Qnil;
+      Vunread_command_events = Fcons (make_number (quit_char), Qnil);
+    }
+  Vinhibit_quit = oinhibit;
+}
+
+DEFUN ("minibuffer-message", Fminibuffer_message, Sminibuffer_message,
+  1, 1, 0,
+  "Temporarily display STRING at the end of the minibuffer.\n\
+The text is displayed for two seconds,\n\
+or until the next input event arrives, whichever comes first.")
+  (string)
+     Lisp_Object string;
+{
+  temp_echo_area_glyphs (XSTRING (string)->data);
+  return Qnil;
+}
+
 init_minibuf_once ()
 {
   Vminibuffer_list = Qnil;
@@ -1948,6 +1960,7 @@
   defsubr (&Sself_insert_and_exit);
   defsubr (&Sexit_minibuffer);
 
+  defsubr (&Sminibuffer_message);
 }
 
 keys_of_minibuf ()