comparison src/minibuf.c @ 9316:5f7cfbdef872

(read_minibuf, get_minibuffer, read_minibuf_unwind, Fread_from_minibuffer, Ftry_completion, Fall_completions, Fcompleting_read, Fminibuffer_prompt_width, syms_of_minibuf): Don't use XFASTINT as an lvalue.
author Karl Heuer <kwzh@gnu.org>
date Tue, 04 Oct 1994 16:08:54 +0000
parents f49aca34b7ae
children a8e59db60df6
comparison
equal deleted inserted replaced
9315:77eba75a44a0 9316:5f7cfbdef872
218 record_unwind_protect (read_minibuf_unwind, Qnil); 218 record_unwind_protect (read_minibuf_unwind, Qnil);
219 219
220 Vminibuf_scroll_window = selected_window; 220 Vminibuf_scroll_window = selected_window;
221 Fset_window_buffer (minibuf_window, Fcurrent_buffer ()); 221 Fset_window_buffer (minibuf_window, Fcurrent_buffer ());
222 Fselect_window (minibuf_window); 222 Fselect_window (minibuf_window);
223 XFASTINT (XWINDOW (minibuf_window)->hscroll) = 0; 223 XSETFASTINT (XWINDOW (minibuf_window)->hscroll, 0);
224 224
225 Ferase_buffer (); 225 Ferase_buffer ();
226 minibuf_level++; 226 minibuf_level++;
227 227
228 if (!NILP (initial)) 228 if (!NILP (initial))
316 { 316 {
317 Lisp_Object tail, num, buf; 317 Lisp_Object tail, num, buf;
318 char name[24]; 318 char name[24];
319 extern Lisp_Object nconc2 (); 319 extern Lisp_Object nconc2 ();
320 320
321 XFASTINT (num) = depth; 321 XSETFASTINT (num, depth);
322 tail = Fnthcdr (num, Vminibuffer_list); 322 tail = Fnthcdr (num, Vminibuffer_list);
323 if (NILP (tail)) 323 if (NILP (tail))
324 { 324 {
325 tail = Fcons (Qnil, Qnil); 325 tail = Fcons (Qnil, Qnil);
326 Vminibuffer_list = nconc2 (Vminibuffer_list, tail); 326 Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
379 /* If this was a recursive minibuffer, 379 /* If this was a recursive minibuffer,
380 tie the minibuffer window back to the outer level minibuffer buffer */ 380 tie the minibuffer window back to the outer level minibuffer buffer */
381 minibuf_level--; 381 minibuf_level--;
382 /* Make sure minibuffer window is erased, not ignored */ 382 /* Make sure minibuffer window is erased, not ignored */
383 windows_or_buffers_changed++; 383 windows_or_buffers_changed++;
384 XFASTINT (XWINDOW (minibuf_window)->last_modified) = 0; 384 XSETFASTINT (XWINDOW (minibuf_window)->last_modified, 0);
385 385
386 /* Restore prompt, etc from outer minibuffer */ 386 /* Restore prompt, etc from outer minibuffer */
387 minibuf_prompt = Fcar (minibuf_save_list); 387 minibuf_prompt = Fcar (minibuf_save_list);
388 minibuf_save_list = Fcdr (minibuf_save_list); 388 minibuf_save_list = Fcdr (minibuf_save_list);
389 minibuf_prompt_width = XFASTINT (Fcar (minibuf_save_list)); 389 minibuf_prompt_width = XFASTINT (Fcar (minibuf_save_list));
466 histpos = Fcdr_safe (hist); 466 histpos = Fcdr_safe (hist);
467 } 467 }
468 if (NILP (histvar)) 468 if (NILP (histvar))
469 histvar = Qminibuffer_history; 469 histvar = Qminibuffer_history;
470 if (NILP (histpos)) 470 if (NILP (histpos))
471 XFASTINT (histpos) = 0; 471 XSETFASTINT (histpos, 0);
472 472
473 return read_minibuf (keymap, initial_contents, prompt, 473 return read_minibuf (keymap, initial_contents, prompt,
474 make_number (pos), !NILP (read), histvar, histpos); 474 make_number (pos), !NILP (read), histvar, histpos);
475 } 475 }
476 476
654 elt = bucket; 654 elt = bucket;
655 eltstring = Fsymbol_name (elt); 655 eltstring = Fsymbol_name (elt);
656 if (XSYMBOL (bucket)->next) 656 if (XSYMBOL (bucket)->next)
657 XSETSYMBOL (bucket, XSYMBOL (bucket)->next); 657 XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
658 else 658 else
659 XFASTINT (bucket) = 0; 659 XSETFASTINT (bucket, 0);
660 } 660 }
661 else if (++index >= obsize) 661 else if (++index >= obsize)
662 break; 662 break;
663 else 663 else
664 { 664 {
675 XSTRING (string)->size)) 675 XSTRING (string)->size))
676 { 676 {
677 /* Yes. */ 677 /* Yes. */
678 Lisp_Object regexps; 678 Lisp_Object regexps;
679 Lisp_Object zero; 679 Lisp_Object zero;
680 XFASTINT (zero) = 0; 680 XSETFASTINT (zero, 0);
681 681
682 /* Ignore this element if it fails to match all the regexps. */ 682 /* Ignore this element if it fails to match all the regexps. */
683 for (regexps = Vcompletion_regexp_list; CONSP (regexps); 683 for (regexps = Vcompletion_regexp_list; CONSP (regexps);
684 regexps = XCONS (regexps)->cdr) 684 regexps = XCONS (regexps)->cdr)
685 { 685 {
762 if (matchcount == 1 && bestmatchsize == XSTRING (string)->size 762 if (matchcount == 1 && bestmatchsize == XSTRING (string)->size
763 && !bcmp (XSTRING (bestmatch)->data, XSTRING (string)->data, 763 && !bcmp (XSTRING (bestmatch)->data, XSTRING (string)->data,
764 bestmatchsize)) 764 bestmatchsize))
765 return Qt; 765 return Qt;
766 766
767 XFASTINT (zero) = 0; /* Else extract the part in which */ 767 XSETFASTINT (zero, 0); /* Else extract the part in which */
768 XFASTINT (end) = bestmatchsize; /* all completions agree */ 768 XSETFASTINT (end, bestmatchsize); /* all completions agree */
769 return Fsubstring (bestmatch, zero, end); 769 return Fsubstring (bestmatch, zero, end);
770 } 770 }
771 771
772 /* Compare exactly LEN chars of strings at S1 and S2, 772 /* Compare exactly LEN chars of strings at S1 and S2,
773 ignoring case if appropriate. 773 ignoring case if appropriate.
860 elt = bucket; 860 elt = bucket;
861 eltstring = Fsymbol_name (elt); 861 eltstring = Fsymbol_name (elt);
862 if (XSYMBOL (bucket)->next) 862 if (XSYMBOL (bucket)->next)
863 XSETSYMBOL (bucket, XSYMBOL (bucket)->next); 863 XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
864 else 864 else
865 XFASTINT (bucket) = 0; 865 XSETFASTINT (bucket, 0);
866 } 866 }
867 else if (++index >= obsize) 867 else if (++index >= obsize)
868 break; 868 break;
869 else 869 else
870 { 870 {
885 XSTRING (string)->size)) 885 XSTRING (string)->size))
886 { 886 {
887 /* Yes. */ 887 /* Yes. */
888 Lisp_Object regexps; 888 Lisp_Object regexps;
889 Lisp_Object zero; 889 Lisp_Object zero;
890 XFASTINT (zero) = 0; 890 XSETFASTINT (zero, 0);
891 891
892 /* Ignore this element if it fails to match all the regexps. */ 892 /* Ignore this element if it fails to match all the regexps. */
893 for (regexps = Vcompletion_regexp_list; CONSP (regexps); 893 for (regexps = Vcompletion_regexp_list; CONSP (regexps);
894 regexps = XCONS (regexps)->cdr) 894 regexps = XCONS (regexps)->cdr)
895 { 895 {
1002 histpos = Fcdr_safe (hist); 1002 histpos = Fcdr_safe (hist);
1003 } 1003 }
1004 if (NILP (histvar)) 1004 if (NILP (histvar))
1005 histvar = Qminibuffer_history; 1005 histvar = Qminibuffer_history;
1006 if (NILP (histpos)) 1006 if (NILP (histpos))
1007 XFASTINT (histpos) = 0; 1007 XSETFASTINT (histpos, 0);
1008 1008
1009 val = read_minibuf (NILP (require_match) 1009 val = read_minibuf (NILP (require_match)
1010 ? Vminibuffer_local_completion_map 1010 ? Vminibuffer_local_completion_map
1011 : Vminibuffer_local_must_match_map, 1011 : Vminibuffer_local_must_match_map,
1012 init, prompt, make_number (pos), 0, 1012 init, prompt, make_number (pos), 0,
1566 Sminibuffer_prompt_width, 0, 0, 0, 1566 Sminibuffer_prompt_width, 0, 0, 0,
1567 "Return the display width of the minibuffer prompt.") 1567 "Return the display width of the minibuffer prompt.")
1568 () 1568 ()
1569 { 1569 {
1570 Lisp_Object width; 1570 Lisp_Object width;
1571 XFASTINT (width) = minibuf_prompt_width; 1571 XSETFASTINT (width, minibuf_prompt_width);
1572 return width; 1572 return width;
1573 } 1573 }
1574 1574
1575 init_minibuf_once () 1575 init_minibuf_once ()
1576 { 1576 {
1669 DEFVAR_LISP ("minibuffer-history-variable", &Vminibuffer_history_variable, 1669 DEFVAR_LISP ("minibuffer-history-variable", &Vminibuffer_history_variable,
1670 "History list symbol to add minibuffer values to.\n\ 1670 "History list symbol to add minibuffer values to.\n\
1671 Each minibuffer output is added with\n\ 1671 Each minibuffer output is added with\n\
1672 (set minibuffer-history-variable\n\ 1672 (set minibuffer-history-variable\n\
1673 (cons STRING (symbol-value minibuffer-history-variable)))"); 1673 (cons STRING (symbol-value minibuffer-history-variable)))");
1674 XFASTINT (Vminibuffer_history_variable) = 0; 1674 XSETFASTINT (Vminibuffer_history_variable, 0);
1675 1675
1676 DEFVAR_LISP ("minibuffer-history-position", &Vminibuffer_history_position, 1676 DEFVAR_LISP ("minibuffer-history-position", &Vminibuffer_history_position,
1677 "Current position of redoing in the history list."); 1677 "Current position of redoing in the history list.");
1678 Vminibuffer_history_position = Qnil; 1678 Vminibuffer_history_position = Qnil;
1679 1679