diff options
| author | Kim F. Storm | 2007-02-08 00:06:43 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2007-02-08 00:06:43 +0000 |
| commit | ef72eaff36c38378ab79781070161358c44c43b2 (patch) | |
| tree | 56d8394c1b1a335090a4e14864dbaa3aa35c925e /src | |
| parent | 459b1fe4c0f85c4b863627f08537a8c644d2cd46 (diff) | |
| download | emacs-ef72eaff36c38378ab79781070161358c44c43b2.tar.gz emacs-ef72eaff36c38378ab79781070161358c44c43b2.zip | |
(read_minibuf): Fix 2007-01-30 change.
Use Qlambda as interrim value of Vminibuffer_completing_file_name.
(Fcompleting_read, do_completion, Fminibuffer_complete_word):
If Vminibuffer_completing_file_name equals Qlambda, treat it as Qnil.
(syms_of_minibuf) <minibuffer-completing-file-name>: Document lambda.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index 6581159e841..9a25c3ee278 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -472,7 +472,6 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 472 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 472 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 473 | Lisp_Object enable_multibyte; | 473 | Lisp_Object enable_multibyte; |
| 474 | int pos = INTEGERP (backup_n) ? XINT (backup_n) : 0; | 474 | int pos = INTEGERP (backup_n) ? XINT (backup_n) : 0; |
| 475 | |||
| 476 | /* String to add to the history. */ | 475 | /* String to add to the history. */ |
| 477 | Lisp_Object histstring; | 476 | Lisp_Object histstring; |
| 478 | 477 | ||
| @@ -484,6 +483,14 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 484 | 483 | ||
| 485 | specbind (Qminibuffer_default, defalt); | 484 | specbind (Qminibuffer_default, defalt); |
| 486 | 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; | ||
| 493 | |||
| 487 | single_kboard_state (); | 494 | single_kboard_state (); |
| 488 | #ifdef HAVE_X_WINDOWS | 495 | #ifdef HAVE_X_WINDOWS |
| 489 | if (display_hourglass_p) | 496 | if (display_hourglass_p) |
| @@ -577,8 +584,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 577 | minibuf_save_list | 584 | minibuf_save_list |
| 578 | = Fcons (Voverriding_local_map, | 585 | = Fcons (Voverriding_local_map, |
| 579 | Fcons (minibuf_window, | 586 | Fcons (minibuf_window, |
| 580 | Fcons (Vminibuffer_completing_file_name, | 587 | minibuf_save_list)); |
| 581 | minibuf_save_list))); | ||
| 582 | minibuf_save_list | 588 | minibuf_save_list |
| 583 | = Fcons (minibuf_prompt, | 589 | = Fcons (minibuf_prompt, |
| 584 | Fcons (make_number (minibuf_prompt_width), | 590 | Fcons (make_number (minibuf_prompt_width), |
| @@ -604,9 +610,13 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 604 | Vminibuffer_history_position = histpos; | 610 | Vminibuffer_history_position = histpos; |
| 605 | Vminibuffer_history_variable = histvar; | 611 | Vminibuffer_history_variable = histvar; |
| 606 | Vhelp_form = Vminibuffer_help_form; | 612 | Vhelp_form = Vminibuffer_help_form; |
| 607 | /* If this minibuffer is reading a file name, | 613 | /* If this minibuffer is reading a file name, that doesn't mean |
| 608 | that doesn't mean recursive ones are. */ | 614 | recursive ones are. But we cannot set it to nil, because |
| 609 | Vminibuffer_completing_file_name = Qnil; | 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; | ||
| 610 | 620 | ||
| 611 | if (inherit_input_method) | 621 | if (inherit_input_method) |
| 612 | { | 622 | { |
| @@ -928,8 +938,6 @@ read_minibuf_unwind (data) | |||
| 928 | minibuf_window = temp; | 938 | minibuf_window = temp; |
| 929 | #endif | 939 | #endif |
| 930 | minibuf_save_list = Fcdr (minibuf_save_list); | 940 | minibuf_save_list = Fcdr (minibuf_save_list); |
| 931 | Vminibuffer_completing_file_name = Fcar (minibuf_save_list); | ||
| 932 | minibuf_save_list = Fcdr (minibuf_save_list); | ||
| 933 | 941 | ||
| 934 | /* Erase the minibuffer we were using at this level. */ | 942 | /* Erase the minibuffer we were using at this level. */ |
| 935 | { | 943 | { |
| @@ -1793,9 +1801,11 @@ Completion ignores case if the ambient value of | |||
| 1793 | 1801 | ||
| 1794 | val = read_minibuf (NILP (require_match) | 1802 | val = read_minibuf (NILP (require_match) |
| 1795 | ? (NILP (Vminibuffer_completing_file_name) | 1803 | ? (NILP (Vminibuffer_completing_file_name) |
| 1804 | || EQ (Vminibuffer_completing_file_name, Qlambda) | ||
| 1796 | ? Vminibuffer_local_completion_map | 1805 | ? Vminibuffer_local_completion_map |
| 1797 | : Vminibuffer_local_filename_completion_map) | 1806 | : Vminibuffer_local_filename_completion_map) |
| 1798 | : (NILP (Vminibuffer_completing_file_name) | 1807 | : (NILP (Vminibuffer_completing_file_name) |
| 1808 | || EQ (Vminibuffer_completing_file_name, Qlambda) | ||
| 1799 | ? Vminibuffer_local_must_match_map | 1809 | ? Vminibuffer_local_must_match_map |
| 1800 | : Vminibuffer_local_must_match_filename_map), | 1810 | : Vminibuffer_local_must_match_filename_map), |
| 1801 | init, prompt, make_number (pos), 0, | 1811 | init, prompt, make_number (pos), 0, |
| @@ -2002,6 +2012,7 @@ do_completion () | |||
| 2002 | /* Some completion happened */ | 2012 | /* Some completion happened */ |
| 2003 | 2013 | ||
| 2004 | if (! NILP (Vminibuffer_completing_file_name) | 2014 | if (! NILP (Vminibuffer_completing_file_name) |
| 2015 | && ! EQ (Vminibuffer_completing_file_name, Qlambda) | ||
| 2005 | && SREF (completion, SBYTES (completion) - 1) == '/' | 2016 | && SREF (completion, SBYTES (completion) - 1) == '/' |
| 2006 | && PT < ZV | 2017 | && PT < ZV |
| 2007 | && FETCH_CHAR (PT_BYTE) == '/') | 2018 | && FETCH_CHAR (PT_BYTE) == '/') |
| @@ -2291,7 +2302,8 @@ Return nil if there is no valid completion, else t. */) | |||
| 2291 | GCPRO2 (completion, tem); | 2302 | GCPRO2 (completion, tem); |
| 2292 | /* If reading a file name, | 2303 | /* If reading a file name, |
| 2293 | expand any $ENVVAR refs in the buffer and in TEM. */ | 2304 | expand any $ENVVAR refs in the buffer and in TEM. */ |
| 2294 | if (! NILP (Vminibuffer_completing_file_name)) | 2305 | if (! NILP (Vminibuffer_completing_file_name) |
| 2306 | && ! EQ (Vminibuffer_completing_file_name, Qlambda)) | ||
| 2295 | { | 2307 | { |
| 2296 | Lisp_Object substituted; | 2308 | Lisp_Object substituted; |
| 2297 | substituted = Fsubstitute_in_file_name (tem); | 2309 | substituted = Fsubstitute_in_file_name (tem); |
| @@ -2406,6 +2418,7 @@ Return nil if there is no valid completion, else t. */) | |||
| 2406 | /* Otherwise insert in minibuffer the chars we got */ | 2418 | /* Otherwise insert in minibuffer the chars we got */ |
| 2407 | 2419 | ||
| 2408 | if (! NILP (Vminibuffer_completing_file_name) | 2420 | if (! NILP (Vminibuffer_completing_file_name) |
| 2421 | && ! EQ (Vminibuffer_completing_file_name, Qlambda) | ||
| 2409 | && SREF (completion, SBYTES (completion) - 1) == '/' | 2422 | && SREF (completion, SBYTES (completion) - 1) == '/' |
| 2410 | && PT < ZV | 2423 | && PT < ZV |
| 2411 | && FETCH_CHAR (PT_BYTE) == '/') | 2424 | && FETCH_CHAR (PT_BYTE) == '/') |
| @@ -2910,7 +2923,7 @@ CODE can be nil, t or `lambda': | |||
| 2910 | 2923 | ||
| 2911 | DEFVAR_LISP ("minibuffer-completing-file-name", | 2924 | DEFVAR_LISP ("minibuffer-completing-file-name", |
| 2912 | &Vminibuffer_completing_file_name, | 2925 | &Vminibuffer_completing_file_name, |
| 2913 | doc: /* Non-nil means completing file names. */); | 2926 | doc: /* Non-nil and non-`lambda' means completing file names. */); |
| 2914 | Vminibuffer_completing_file_name = Qnil; | 2927 | Vminibuffer_completing_file_name = Qnil; |
| 2915 | 2928 | ||
| 2916 | DEFVAR_LISP ("minibuffer-help-form", &Vminibuffer_help_form, | 2929 | DEFVAR_LISP ("minibuffer-help-form", &Vminibuffer_help_form, |