#include "lisp.h"
#include "commands.h"
-#ifdef MULTI_SCREEN
-#include "screen.h"
-#endif
-
#include "buffer.h"
+#include "keyboard.h"
Lisp_Object Qstring_lessp;
"Concatenate all the arguments and make the result a list.\n\
The result is a list whose elements are the elements of all the arguments.\n\
Each argument may be a list, vector or string.\n\
-The last argument is not copied if it is a list.")
+The last argument is not copied, just used as the tail of the new list.")
(nargs, args)
int nargs;
Lisp_Object *args;
while (!NILP (tail))
{
tem = Fcar (tail);
- if (Fequal (elt, tem))
+ if (! NILP (Fequal (elt, tem)))
{
if (NILP (prev))
list = Fcdr (tail);
DEFUN ("y-or-n-p", Fy_or_n_p, Sy_or_n_p, 1, 1, 0,
"Ask user a \"y or n\" question. Return t if answer is \"y\".\n\
+Takes one argument, which is the string to display to ask the question.\n\
+It should end in a space; `y-or-n-p' adds `(y or n) ' to it.\n\
No confirmation of the answer is requested; a single character is enough.\n\
Also accepts Space to mean yes, or Delete to mean no.")
(prompt)
message ("%s(y or n) ", XSTRING (xprompt)->data);
cursor_in_echo_area = 1;
- obj = read_char (0);
+ obj = read_char (0, 0, 0, Qnil, 0);
if (XTYPE (obj) == Lisp_Int)
ans = XINT (obj);
else
if (ans == 7 || ans == '\035')
Vquit_flag = Qt;
QUIT;
+
+ /* If we don't clear this, then the next call to read_char will
+ return quit_char again, and we'll enter an infinite loop. */
+ Vquit_flag = Qnil;
if (ans >= 0)
ans = DOWNCASE (ans);
if (ans == 'y' || ans == ' ')
/* Anything that calls this function must protect from GC! */
DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0,
- "Ask user a yes or no question. Return t if answer is yes.\n\
-The user must confirm the answer with a newline,\n\
-and can rub it out if not confirmed.")
+ "Ask user a yes-or-no question. Return t if answer is yes.\n\
+Takes one argument, which is the string to display to ask the question.\n\
+It should end in a space; `yes-or-no-p' adds `(yes or no) ' to it.\n\
+The user must confirm the answer with RET,\n\
+and can edit it until it as been confirmed.")
(prompt)
Lisp_Object prompt;
{
GCPRO1 (prompt);
while (1)
{
- ans = Fdowncase (read_minibuf (Vminibuffer_local_map,
- Qnil, prompt, Qnil, 0));
+ ans = Fdowncase (Fread_string (prompt, Qnil));
if (XSTRING (ans)->size == 3 && !strcmp (XSTRING (ans)->data, "yes"))
{
UNGCPRO;
Fding (Qnil);
Fdiscard_input ();
message ("Please answer yes or no.");
- Fsleep_for (make_number (2));
+ Fsleep_for (make_number (2), Qnil);
}
UNGCPRO;
}