Mercurial > emacs
comparison src/minibuf.c @ 90751:52a7f3f50b89
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 624-636)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 200-201)
- Merge from emacs--devo--0
- Update from CVS: lisp/nnweb.el (nnweb-google-parse-1): Update parser.
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-171
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 13 Feb 2007 12:14:16 +0000 |
parents | f83d17e1ace6 55bd832be66b |
children | dd7c098af727 |
comparison
equal
deleted
inserted
replaced
90750:f8cc067aba62 | 90751:52a7f3f50b89 |
---|---|
132 | 132 |
133 static Lisp_Object last_exact_completion; | 133 static Lisp_Object last_exact_completion; |
134 | 134 |
135 /* Keymap for reading expressions. */ | 135 /* Keymap for reading expressions. */ |
136 Lisp_Object Vread_expression_map; | 136 Lisp_Object Vread_expression_map; |
137 | |
138 Lisp_Object Vminibuffer_completion_table, Qminibuffer_completion_table; | |
139 Lisp_Object Vminibuffer_completion_predicate, Qminibuffer_completion_predicate; | |
140 Lisp_Object Vminibuffer_completion_confirm, Qminibuffer_completion_confirm; | |
141 Lisp_Object Vminibuffer_completing_file_name; | |
137 | 142 |
138 Lisp_Object Quser_variable_p; | 143 Lisp_Object Quser_variable_p; |
139 | 144 |
140 Lisp_Object Qminibuffer_default; | 145 Lisp_Object Qminibuffer_default; |
141 | 146 |
465 int count = SPECPDL_INDEX (); | 470 int count = SPECPDL_INDEX (); |
466 Lisp_Object mini_frame, ambient_dir, minibuffer, input_method; | 471 Lisp_Object mini_frame, ambient_dir, minibuffer, input_method; |
467 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 472 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
468 Lisp_Object enable_multibyte; | 473 Lisp_Object enable_multibyte; |
469 int pos = INTEGERP (backup_n) ? XINT (backup_n) : 0; | 474 int pos = INTEGERP (backup_n) ? XINT (backup_n) : 0; |
470 | |
471 /* String to add to the history. */ | 475 /* String to add to the history. */ |
472 Lisp_Object histstring; | 476 Lisp_Object histstring; |
473 | 477 |
474 Lisp_Object empty_minibuf; | 478 Lisp_Object empty_minibuf; |
475 Lisp_Object dummy, frame; | 479 Lisp_Object dummy, frame; |
476 | 480 |
477 extern Lisp_Object Qfront_sticky; | 481 extern Lisp_Object Qfront_sticky; |
478 extern Lisp_Object Qrear_nonsticky; | 482 extern Lisp_Object Qrear_nonsticky; |
479 | 483 |
480 specbind (Qminibuffer_default, defalt); | 484 specbind (Qminibuffer_default, defalt); |
485 | |
486 /* If Vminibuffer_completing_file_name is `lambda' on entry, it was t | |
487 in previous recursive minibuffer, but was not set explicitly | |
488 to t for this invocation, so set it to nil in this minibuffer. | |
489 Save the old value now, before we change it. */ | |
490 specbind (intern ("minibuffer-completing-file-name"), Vminibuffer_completing_file_name); | |
491 if (EQ (Vminibuffer_completing_file_name, Qlambda)) | |
492 Vminibuffer_completing_file_name = Qnil; | |
481 | 493 |
482 single_kboard_state (); | 494 single_kboard_state (); |
483 #ifdef HAVE_X_WINDOWS | 495 #ifdef HAVE_X_WINDOWS |
484 if (display_hourglass_p) | 496 if (display_hourglass_p) |
485 cancel_hourglass (); | 497 cancel_hourglass (); |
569 /* Arrange to restore a number of minibuffer-related variables. | 581 /* Arrange to restore a number of minibuffer-related variables. |
570 We could bind each variable separately, but that would use lots of | 582 We could bind each variable separately, but that would use lots of |
571 specpdl slots. */ | 583 specpdl slots. */ |
572 minibuf_save_list | 584 minibuf_save_list |
573 = Fcons (Voverriding_local_map, | 585 = Fcons (Voverriding_local_map, |
574 Fcons (minibuf_window, minibuf_save_list)); | 586 Fcons (minibuf_window, |
587 minibuf_save_list)); | |
575 minibuf_save_list | 588 minibuf_save_list |
576 = Fcons (minibuf_prompt, | 589 = Fcons (minibuf_prompt, |
577 Fcons (make_number (minibuf_prompt_width), | 590 Fcons (make_number (minibuf_prompt_width), |
578 Fcons (Vhelp_form, | 591 Fcons (Vhelp_form, |
579 Fcons (Vcurrent_prefix_arg, | 592 Fcons (Vcurrent_prefix_arg, |
595 minibuf_prompt_width = 0; | 608 minibuf_prompt_width = 0; |
596 minibuf_prompt = Fcopy_sequence (prompt); | 609 minibuf_prompt = Fcopy_sequence (prompt); |
597 Vminibuffer_history_position = histpos; | 610 Vminibuffer_history_position = histpos; |
598 Vminibuffer_history_variable = histvar; | 611 Vminibuffer_history_variable = histvar; |
599 Vhelp_form = Vminibuffer_help_form; | 612 Vhelp_form = Vminibuffer_help_form; |
613 /* If this minibuffer is reading a file name, that doesn't mean | |
614 recursive ones are. But we cannot set it to nil, because | |
615 completion code still need to know the minibuffer is completing a | |
616 file name. So use `lambda' as intermediate value meaning | |
617 "t" in this minibuffer, but "nil" in next minibuffer. */ | |
618 if (!NILP (Vminibuffer_completing_file_name)) | |
619 Vminibuffer_completing_file_name = Qlambda; | |
600 | 620 |
601 if (inherit_input_method) | 621 if (inherit_input_method) |
602 { | 622 { |
603 /* `current-input-method' is buffer local. So, remember it in | 623 /* `current-input-method' is buffer local. So, remember it in |
604 INPUT_METHOD before changing the current buffer. */ | 624 INPUT_METHOD before changing the current buffer. */ |
1682 } | 1702 } |
1683 | 1703 |
1684 return Fnreverse (allmatches); | 1704 return Fnreverse (allmatches); |
1685 } | 1705 } |
1686 | 1706 |
1687 Lisp_Object Vminibuffer_completion_table, Qminibuffer_completion_table; | |
1688 Lisp_Object Vminibuffer_completion_predicate, Qminibuffer_completion_predicate; | |
1689 Lisp_Object Vminibuffer_completion_confirm, Qminibuffer_completion_confirm; | |
1690 Lisp_Object Vminibuffer_completing_file_name; | |
1691 | |
1692 DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, | 1707 DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, |
1693 doc: /* Read a string in the minibuffer, with completion. | 1708 doc: /* Read a string in the minibuffer, with completion. |
1694 PROMPT is a string to prompt with; normally it ends in a colon and a space. | 1709 PROMPT is a string to prompt with; normally it ends in a colon and a space. |
1695 COLLECTION can be a list of strings, an alist, an obarray or a hash table. | 1710 COLLECTION can be a list of strings, an alist, an obarray or a hash table. |
1696 COLLECTION can also be a function to do the completion itself. | 1711 COLLECTION can also be a function to do the completion itself. |
1784 if (NILP (histpos)) | 1799 if (NILP (histpos)) |
1785 XSETFASTINT (histpos, 0); | 1800 XSETFASTINT (histpos, 0); |
1786 | 1801 |
1787 val = read_minibuf (NILP (require_match) | 1802 val = read_minibuf (NILP (require_match) |
1788 ? (NILP (Vminibuffer_completing_file_name) | 1803 ? (NILP (Vminibuffer_completing_file_name) |
1804 || EQ (Vminibuffer_completing_file_name, Qlambda) | |
1789 ? Vminibuffer_local_completion_map | 1805 ? Vminibuffer_local_completion_map |
1790 : Vminibuffer_local_filename_completion_map) | 1806 : Vminibuffer_local_filename_completion_map) |
1791 : (NILP (Vminibuffer_completing_file_name) | 1807 : (NILP (Vminibuffer_completing_file_name) |
1808 || EQ (Vminibuffer_completing_file_name, Qlambda) | |
1792 ? Vminibuffer_local_must_match_map | 1809 ? Vminibuffer_local_must_match_map |
1793 : Vminibuffer_local_must_match_filename_map), | 1810 : Vminibuffer_local_must_match_filename_map), |
1794 init, prompt, make_number (pos), 0, | 1811 init, prompt, make_number (pos), 0, |
1795 histvar, histpos, def, 0, | 1812 histvar, histpos, def, 0, |
1796 !NILP (inherit_input_method)); | 1813 !NILP (inherit_input_method)); |
2892 doc: /* Non-nil means to demand confirmation of completion before exiting minibuffer. */); | 2909 doc: /* Non-nil means to demand confirmation of completion before exiting minibuffer. */); |
2893 Vminibuffer_completion_confirm = Qnil; | 2910 Vminibuffer_completion_confirm = Qnil; |
2894 | 2911 |
2895 DEFVAR_LISP ("minibuffer-completing-file-name", | 2912 DEFVAR_LISP ("minibuffer-completing-file-name", |
2896 &Vminibuffer_completing_file_name, | 2913 &Vminibuffer_completing_file_name, |
2897 doc: /* Non-nil means completing file names. */); | 2914 doc: /* Non-nil and non-`lambda' means completing file names. */); |
2898 Vminibuffer_completing_file_name = Qnil; | 2915 Vminibuffer_completing_file_name = Qnil; |
2899 | 2916 |
2900 DEFVAR_LISP ("minibuffer-help-form", &Vminibuffer_help_form, | 2917 DEFVAR_LISP ("minibuffer-help-form", &Vminibuffer_help_form, |
2901 doc: /* Value that `help-form' takes on inside the minibuffer. */); | 2918 doc: /* Value that `help-form' takes on inside the minibuffer. */); |
2902 Vminibuffer_help_form = Qnil; | 2919 Vminibuffer_help_form = Qnil; |