aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-02-10 09:46:16 +0000
committerRichard M. Stallman1997-02-10 09:46:16 +0000
commit2d955a501c3c97999224aabf104c606ac8553013 (patch)
tree2c9477f8e77909f93b91f410ae0e84caad4d5129 /src
parent86bfaffe409c6f7398bcf2144fa8d9f436bd4002 (diff)
downloademacs-2d955a501c3c97999224aabf104c606ac8553013.tar.gz
emacs-2d955a501c3c97999224aabf104c606ac8553013.zip
(Fminibuffer_message): New function.
(syms_of_minibuf): Set up Lisp function.
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c77
1 files changed, 45 insertions, 32 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index e7f8a88e306..89ea801b1db 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1161,38 +1161,6 @@ DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 6, 0,
1161 return unbind_to (count, val); 1161 return unbind_to (count, val);
1162} 1162}
1163 1163
1164/* Temporarily display the string M at the end of the current
1165 minibuffer contents. This is used to display things like
1166 "[No Match]" when the user requests a completion for a prefix
1167 that has no possible completions, and other quick, unobtrusive
1168 messages. */
1169
1170temp_echo_area_glyphs (m)
1171 char *m;
1172{
1173 int osize = ZV;
1174 int opoint = PT;
1175 Lisp_Object oinhibit;
1176 oinhibit = Vinhibit_quit;
1177
1178 /* Clear out any old echo-area message to make way for our new thing. */
1179 message (0);
1180
1181 SET_PT (osize);
1182 insert_string (m);
1183 SET_PT (opoint);
1184 Vinhibit_quit = Qt;
1185 Fsit_for (make_number (2), Qnil, Qnil);
1186 del_range (osize, ZV);
1187 SET_PT (opoint);
1188 if (!NILP (Vquit_flag))
1189 {
1190 Vquit_flag = Qnil;
1191 Vunread_command_events = Fcons (make_number (quit_char), Qnil);
1192 }
1193 Vinhibit_quit = oinhibit;
1194}
1195
1196Lisp_Object Fminibuffer_completion_help (); 1164Lisp_Object Fminibuffer_completion_help ();
1197Lisp_Object assoc_for_completion (); 1165Lisp_Object assoc_for_completion ();
1198/* A subroutine of Fintern_soft. */ 1166/* A subroutine of Fintern_soft. */
@@ -1798,6 +1766,50 @@ DEFUN ("minibuffer-prompt-width", Fminibuffer_prompt_width,
1798 return width; 1766 return width;
1799} 1767}
1800 1768
1769/* Temporarily display the string M at the end of the current
1770 minibuffer contents. This is used to display things like
1771 "[No Match]" when the user requests a completion for a prefix
1772 that has no possible completions, and other quick, unobtrusive
1773 messages. */
1774
1775temp_echo_area_glyphs (m)
1776 char *m;
1777{
1778 int osize = ZV;
1779 int opoint = PT;
1780 Lisp_Object oinhibit;
1781 oinhibit = Vinhibit_quit;
1782
1783 /* Clear out any old echo-area message to make way for our new thing. */
1784 message (0);
1785
1786 SET_PT (osize);
1787 insert_string (m);
1788 SET_PT (opoint);
1789 Vinhibit_quit = Qt;
1790 Fsit_for (make_number (2), Qnil, Qnil);
1791 del_range (osize, ZV);
1792 SET_PT (opoint);
1793 if (!NILP (Vquit_flag))
1794 {
1795 Vquit_flag = Qnil;
1796 Vunread_command_events = Fcons (make_number (quit_char), Qnil);
1797 }
1798 Vinhibit_quit = oinhibit;
1799}
1800
1801DEFUN ("minibuffer-message", Fminibuffer_message, Sminibuffer_message,
1802 1, 1, 0,
1803 "Temporarily display STRING at the end of the minibuffer.\n\
1804The text is displayed for two seconds,\n\
1805or until the next input event arrives, whichever comes first.")
1806 (string)
1807 Lisp_Object string;
1808{
1809 temp_echo_area_glyphs (XSTRING (string)->data);
1810 return Qnil;
1811}
1812
1801init_minibuf_once () 1813init_minibuf_once ()
1802{ 1814{
1803 Vminibuffer_list = Qnil; 1815 Vminibuffer_list = Qnil;
@@ -1948,6 +1960,7 @@ Some uses of the echo area also raise that frame (since they use it too).");
1948 defsubr (&Sself_insert_and_exit); 1960 defsubr (&Sself_insert_and_exit);
1949 defsubr (&Sexit_minibuffer); 1961 defsubr (&Sexit_minibuffer);
1950 1962
1963 defsubr (&Sminibuffer_message);
1951} 1964}
1952 1965
1953keys_of_minibuf () 1966keys_of_minibuf ()