#include "lisp.h"
#include "commands.h"
+#include "character.h"
#include "buffer.h"
#include "dispextern.h"
#include "keyboard.h"
{
if (FRAMEP (selected_frame)
&& FRAME_LIVE_P (XFRAME (selected_frame))
- && !EQ (minibuf_window, XFRAME (selected_frame)->minibuffer_window))
+ && !EQ (minibuf_window, FVAR (XFRAME (selected_frame), minibuffer_window)))
{
struct frame *sf = XFRAME (selected_frame);
Lisp_Object buffer;
/* I don't think that any frames may validly have a null minibuffer
window anymore. */
- if (NILP (sf->minibuffer_window))
+ if (NILP (FVAR (sf, minibuffer_window)))
abort ();
/* Under X, we come here with minibuf_window being the
minibuffer window of the unused termcap window created in
init_window_once. That window doesn't have a buffer. */
- buffer = XWINDOW (minibuf_window)->buffer;
+ buffer = WVAR (XWINDOW (minibuf_window), buffer);
if (BUFFERP (buffer))
- Fset_window_buffer (sf->minibuffer_window, buffer, Qnil);
- minibuf_window = sf->minibuffer_window;
+ Fset_window_buffer (FVAR (sf, minibuffer_window), buffer, Qnil);
+ minibuf_window = FVAR (sf, minibuffer_window);
}
/* Make sure no other frame has a minibuffer as its selected window,
val = Qnil;
size = 100;
len = 0;
- line = (char *) xmalloc (size);
+ line = xmalloc (size);
while ((c = getchar ()) != '\n')
{
{
if (CONSP (initial))
{
- Lisp_Object backup_n = Fcdr (initial);
- initial = Fcar (initial);
+ Lisp_Object backup_n = XCDR (initial);
+ initial = XCAR (initial);
CHECK_STRING (initial);
if (!NILP (backup_n))
{
FOR_EACH_FRAME (dummy, frame)
{
Lisp_Object root_window = Fframe_root_window (frame);
- Lisp_Object mini_window = XWINDOW (root_window)->next;
+ Lisp_Object mini_window = WVAR (XWINDOW (root_window), next);
if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window)
&& !NILP (Fwindow_minibuffer_p (mini_window)))
/* Display this minibuffer in the proper window. */
Fset_window_buffer (minibuf_window, Fcurrent_buffer (), Qnil);
Fselect_window (minibuf_window, Qnil);
- XSETFASTINT (XWINDOW (minibuf_window)->hscroll, 0);
+ XWINDOW (minibuf_window)->hscroll = 0;
Fmake_local_variable (Qprint_escape_newlines);
print_escape_newlines = 1;
XWINDOW (minibuf_window)->must_be_updated_p = 1;
update_frame (XFRAME (selected_frame), 1, 1);
{
- struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
+ struct frame *f = XFRAME (WVAR (XWINDOW (minibuf_window), frame));
struct redisplay_interface *rif = FRAME_RIF (f);
if (rif && rif->flush_display)
rif->flush_display (f);
buf = Fcar (tail);
if (NILP (buf) || NILP (BVAR (XBUFFER (buf), name)))
{
- sprintf (name, " *Minibuf-%"pI"d*", depth);
- buf = Fget_buffer_create (build_string (name));
+ buf = Fget_buffer_create
+ (make_formatted_string (name, " *Minibuf-%"pI"d*", depth));
/* Although the buffer's name starts with a space, undo should be
enabled in it. */
else
{
ptrdiff_t count = SPECPDL_INDEX ();
- /* `reset_buffer' blindly sets the list of overlays to NULL, so we
- have to empty the list, otherwise we end up with overlays that
- think they belong to this buffer while the buffer doesn't know about
- them any more. */
+ /* We have to empty both overlay lists. Otherwise we end
+ up with overlays that think they belong to this buffer
+ while the buffer doesn't know about them any more. */
delete_all_overlays (XBUFFER (buf));
reset_buffer (XBUFFER (buf));
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
window = minibuf_window;
/* To keep things predictable, in case it matters, let's be in the
minibuffer when we reset the relevant variables. */
- Fset_buffer (XWINDOW (window)->buffer);
+ Fset_buffer (WVAR (XWINDOW (window), buffer));
/* Restore prompt, etc, from outer minibuffer level. */
minibuf_prompt = Fcar (minibuf_save_list);
/* Make sure minibuffer window is erased, not ignored. */
windows_or_buffers_changed++;
- XSETFASTINT (XWINDOW (window)->last_modified, 0);
- XSETFASTINT (XWINDOW (window)->last_overlay_modified, 0);
+ XWINDOW (window)->last_modified = 0;
+ XWINDOW (window)->last_overlay_modified = 0;
/* In case the previous minibuffer displayed in this miniwindow is
dead, we may keep displaying this buffer (tho it's inactive), so reset it,
(Lisp_Object prompt, Lisp_Object initial_input, Lisp_Object history, Lisp_Object default_value, Lisp_Object inherit_input_method)
{
Lisp_Object val;
+ ptrdiff_t count = SPECPDL_INDEX ();
+
+ /* Just in case we're in a recursive minibuffer, make it clear that the
+ previous minibuffer's completion table does not apply to the new
+ minibuffer.
+ FIXME: `minibuffer-completion-table' should be buffer-local instead. */
+ specbind (Qminibuffer_completion_table, Qnil);
+
val = Fread_from_minibuffer (prompt, initial_input, Qnil,
Qnil, history, default_value,
inherit_input_method);
if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value))
val = CONSP (default_value) ? XCAR (default_value) : default_value;
- return val;
+ return unbind_to (count, val);
}
DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 1, 3, 0,
{
collection = check_obarray (collection);
obsize = ASIZE (collection);
- bucket = XVECTOR (collection)->contents[idx];
+ bucket = AREF (collection, idx);
}
while (1)
break;
else
{
- bucket = XVECTOR (collection)->contents[idx];
+ bucket = AREF (collection, idx);
continue;
}
}
{
collection = check_obarray (collection);
obsize = ASIZE (collection);
- bucket = XVECTOR (collection)->contents[idx];
+ bucket = AREF (collection, idx);
}
while (1)
break;
else
{
- bucket = XVECTOR (collection)->contents[idx];
+ bucket = AREF (collection, idx);
continue;
}
}
return Ffuncall (9, args);
}
\f
-Lisp_Object Fassoc_string (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold);
-
/* Test whether TXT is an exact completion. */
DEFUN ("test-completion", Ftest_completion, Stest_completion, 2, 3, 0,
doc: /* Return non-nil if STRING is a valid completion.
{
for (i = ASIZE (collection) - 1; i >= 0; i--)
{
- tail = XVECTOR (collection)->contents[i];
+ tail = AREF (collection, i);
if (SYMBOLP (tail))
while (1)
{