Mercurial > emacs
comparison src/minibuf.c @ 75558:f7b5b15084ef
(read_minibuf): Save and clear Vminibuffer_completing_file_name.
(read_minibuf_unwind): Restore it.
(Vminibuffer_completion_table, Qminibuffer_completion_table)
(Vminibuffer_completion_predicate, Qminibuffer_completion_predicate)
(Vminibuffer_completion_confirm, Qminibuffer_completion_confirm)
(Vminibuffer_completing_file_name): Definitions moved up.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 30 Jan 2007 23:49:33 +0000 |
parents | 688a9d290d4d |
children | d93f8cf55f80 |
comparison
equal
deleted
inserted
replaced
75557:21cbf755a07c | 75558:f7b5b15084ef |
---|---|
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 |
569 /* Arrange to restore a number of minibuffer-related variables. | 574 /* Arrange to restore a number of minibuffer-related variables. |
570 We could bind each variable separately, but that would use lots of | 575 We could bind each variable separately, but that would use lots of |
571 specpdl slots. */ | 576 specpdl slots. */ |
572 minibuf_save_list | 577 minibuf_save_list |
573 = Fcons (Voverriding_local_map, | 578 = Fcons (Voverriding_local_map, |
574 Fcons (minibuf_window, minibuf_save_list)); | 579 Fcons (minibuf_window, |
580 Fcons (Vminibuffer_completing_file_name, | |
581 minibuf_save_list))); | |
575 minibuf_save_list | 582 minibuf_save_list |
576 = Fcons (minibuf_prompt, | 583 = Fcons (minibuf_prompt, |
577 Fcons (make_number (minibuf_prompt_width), | 584 Fcons (make_number (minibuf_prompt_width), |
578 Fcons (Vhelp_form, | 585 Fcons (Vhelp_form, |
579 Fcons (Vcurrent_prefix_arg, | 586 Fcons (Vcurrent_prefix_arg, |
595 minibuf_prompt_width = 0; | 602 minibuf_prompt_width = 0; |
596 minibuf_prompt = Fcopy_sequence (prompt); | 603 minibuf_prompt = Fcopy_sequence (prompt); |
597 Vminibuffer_history_position = histpos; | 604 Vminibuffer_history_position = histpos; |
598 Vminibuffer_history_variable = histvar; | 605 Vminibuffer_history_variable = histvar; |
599 Vhelp_form = Vminibuffer_help_form; | 606 Vhelp_form = Vminibuffer_help_form; |
607 /* If this minibuffer is reading a file name, | |
608 that doesn't mean recursive ones are. */ | |
609 Vminibuffer_completing_file_name = Qnil; | |
600 | 610 |
601 if (inherit_input_method) | 611 if (inherit_input_method) |
602 { | 612 { |
603 /* `current-input-method' is buffer local. So, remember it in | 613 /* `current-input-method' is buffer local. So, remember it in |
604 INPUT_METHOD before changing the current buffer. */ | 614 INPUT_METHOD before changing the current buffer. */ |
915 #if 0 | 925 #if 0 |
916 temp = Fcar (minibuf_save_list); | 926 temp = Fcar (minibuf_save_list); |
917 if (FRAME_LIVE_P (XFRAME (WINDOW_FRAME (XWINDOW (temp))))) | 927 if (FRAME_LIVE_P (XFRAME (WINDOW_FRAME (XWINDOW (temp))))) |
918 minibuf_window = temp; | 928 minibuf_window = temp; |
919 #endif | 929 #endif |
930 minibuf_save_list = Fcdr (minibuf_save_list); | |
931 Vminibuffer_completing_file_name = Fcar (minibuf_save_list); | |
920 minibuf_save_list = Fcdr (minibuf_save_list); | 932 minibuf_save_list = Fcdr (minibuf_save_list); |
921 | 933 |
922 /* Erase the minibuffer we were using at this level. */ | 934 /* Erase the minibuffer we were using at this level. */ |
923 { | 935 { |
924 int count = SPECPDL_INDEX (); | 936 int count = SPECPDL_INDEX (); |
1682 } | 1694 } |
1683 | 1695 |
1684 return Fnreverse (allmatches); | 1696 return Fnreverse (allmatches); |
1685 } | 1697 } |
1686 | 1698 |
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, | 1699 DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, |
1693 doc: /* Read a string in the minibuffer, with completion. | 1700 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. | 1701 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. | 1702 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. | 1703 COLLECTION can also be a function to do the completion itself. |