Mercurial > emacs
diff src/minibuf.c @ 83556:07774e5c3ff5
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-619
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-620
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-621
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-622
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-623
Remove RCS keywords
* emacs@sv.gnu.org/emacs--devo--0--patch-624
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-625
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-626
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-627
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-628
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-629
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-630
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-631
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-632
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-633
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-634
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-635
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-636
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-637
Remove RCS keywords
* emacs@sv.gnu.org/emacs--devo--0--patch-638
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-639
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-640
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-641
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-642
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-643
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-644
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-645
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-646
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-647
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-648
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-649
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-197
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-198
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-199
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-200
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-201
Update from CVS: lisp/nnweb.el (nnweb-google-parse-1): Update parser.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-202
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-596
author | Karoly Lorentey <karoly@lorentey.hu> |
---|---|
date | Sat, 24 Feb 2007 19:26:54 +0000 |
parents | b8d9a391daf3 c76aa2fa987a |
children | 738ce3540ffb |
line wrap: on
line diff
--- a/src/minibuf.c Sat Feb 24 19:12:27 2007 +0000 +++ b/src/minibuf.c Sat Feb 24 19:26:54 2007 +0000 @@ -136,6 +136,11 @@ /* Keymap for reading expressions. */ Lisp_Object Vread_expression_map; +Lisp_Object Vminibuffer_completion_table, Qminibuffer_completion_table; +Lisp_Object Vminibuffer_completion_predicate, Qminibuffer_completion_predicate; +Lisp_Object Vminibuffer_completion_confirm, Qminibuffer_completion_confirm; +Lisp_Object Vminibuffer_completing_file_name; + Lisp_Object Quser_variable_p; Lisp_Object Qminibuffer_default; @@ -468,7 +473,6 @@ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; Lisp_Object enable_multibyte; int pos = INTEGERP (backup_n) ? XINT (backup_n) : 0; - /* String to add to the history. */ Lisp_Object histstring; @@ -480,6 +484,14 @@ specbind (Qminibuffer_default, defalt); + /* If Vminibuffer_completing_file_name is `lambda' on entry, it was t + in previous recursive minibuffer, but was not set explicitly + to t for this invocation, so set it to nil in this minibuffer. + Save the old value now, before we change it. */ + specbind (intern ("minibuffer-completing-file-name"), Vminibuffer_completing_file_name); + if (EQ (Vminibuffer_completing_file_name, Qlambda)) + Vminibuffer_completing_file_name = Qnil; + #ifdef HAVE_X_WINDOWS if (display_hourglass_p) cancel_hourglass (); @@ -573,7 +585,8 @@ specpdl slots. */ minibuf_save_list = Fcons (Voverriding_local_map, - Fcons (minibuf_window, minibuf_save_list)); + Fcons (minibuf_window, + minibuf_save_list)); minibuf_save_list = Fcons (minibuf_prompt, Fcons (make_number (minibuf_prompt_width), @@ -599,6 +612,13 @@ Vminibuffer_history_position = histpos; Vminibuffer_history_variable = histvar; Vhelp_form = Vminibuffer_help_form; + /* If this minibuffer is reading a file name, that doesn't mean + recursive ones are. But we cannot set it to nil, because + completion code still need to know the minibuffer is completing a + file name. So use `lambda' as intermediate value meaning + "t" in this minibuffer, but "nil" in next minibuffer. */ + if (!NILP (Vminibuffer_completing_file_name)) + Vminibuffer_completing_file_name = Qlambda; if (inherit_input_method) { @@ -1690,11 +1710,6 @@ return Fnreverse (allmatches); } -Lisp_Object Vminibuffer_completion_table, Qminibuffer_completion_table; -Lisp_Object Vminibuffer_completion_predicate, Qminibuffer_completion_predicate; -Lisp_Object Vminibuffer_completion_confirm, Qminibuffer_completion_confirm; -Lisp_Object Vminibuffer_completing_file_name; - DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, doc: /* Read a string in the minibuffer, with completion. PROMPT is a string to prompt with; normally it ends in a colon and a space. @@ -1792,9 +1807,11 @@ val = read_minibuf (NILP (require_match) ? (NILP (Vminibuffer_completing_file_name) + || EQ (Vminibuffer_completing_file_name, Qlambda) ? Vminibuffer_local_completion_map : Vminibuffer_local_filename_completion_map) : (NILP (Vminibuffer_completing_file_name) + || EQ (Vminibuffer_completing_file_name, Qlambda) ? Vminibuffer_local_must_match_map : Vminibuffer_local_must_match_filename_map), init, prompt, make_number (pos), 0, @@ -2062,9 +2079,10 @@ /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ DEFUN ("assoc-string", Fassoc_string, Sassoc_string, 2, 3, 0, - doc: /* Like `assoc' but specifically for strings. -Unibyte strings are converted to multibyte for comparison. -And case is ignored if CASE-FOLD is non-nil. + doc: /* Like `assoc' but specifically for strings (and symbols). +Symbols are converted to strings, and unibyte strings are converted to +multibyte for comparison. +Case is ignored if optional arg CASE-FOLD is non-nil. As opposed to `assoc', it will also match an entry consisting of a single string rather than a cons cell whose car is a string. */) (key, list, case_fold) @@ -2073,12 +2091,17 @@ { register Lisp_Object tail; + if (SYMBOLP (key)) + key = Fsymbol_name (key); + for (tail = list; !NILP (tail); tail = Fcdr (tail)) { register Lisp_Object elt, tem, thiscar; elt = Fcar (tail); thiscar = CONSP (elt) ? XCAR (elt) : elt; - if (!STRINGP (thiscar)) + if (SYMBOLP (thiscar)) + thiscar = Fsymbol_name (thiscar); + else if (!STRINGP (thiscar)) continue; tem = Fcompare_strings (thiscar, make_number (0), Qnil, key, make_number (0), Qnil, @@ -2909,7 +2932,7 @@ DEFVAR_LISP ("minibuffer-completing-file-name", &Vminibuffer_completing_file_name, - doc: /* Non-nil means completing file names. */); + doc: /* Non-nil and non-`lambda' means completing file names. */); Vminibuffer_completing_file_name = Qnil; DEFVAR_LISP ("minibuffer-help-form", &Vminibuffer_help_form,