aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/minibuf.c81
2 files changed, 6 insertions, 80 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 78fca60ca28..c7fd7ef5b9d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12011-06-22 Leo Liu <sdl.web@gmail.com>
2
3 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
4 Move to minibuffer.el.
5
12011-06-22 Paul Eggert <eggert@cs.ucla.edu> 62011-06-22 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking. 8 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
diff --git a/src/minibuf.c b/src/minibuf.c
index ca2f22df9ed..110b6562b6c 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -72,7 +72,6 @@ Lisp_Object Qcompletion_ignore_case;
72static Lisp_Object Qminibuffer_completion_table; 72static Lisp_Object Qminibuffer_completion_table;
73static Lisp_Object Qminibuffer_completion_predicate; 73static Lisp_Object Qminibuffer_completion_predicate;
74static Lisp_Object Qminibuffer_completion_confirm; 74static Lisp_Object Qminibuffer_completion_confirm;
75static Lisp_Object Qcompleting_read_default;
76static Lisp_Object Quser_variable_p; 75static Lisp_Object Quser_variable_p;
77 76
78static Lisp_Object Qminibuffer_default; 77static Lisp_Object Qminibuffer_default;
@@ -1694,7 +1693,7 @@ See also `completing-read-function'. */)
1694 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method) 1693 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
1695{ 1694{
1696 Lisp_Object args[9]; 1695 Lisp_Object args[9];
1697 args[0] = Vcompleting_read_function; 1696 args[0] = Fsymbol_value (intern ("completing-read-function"));
1698 args[1] = prompt; 1697 args[1] = prompt;
1699 args[2] = collection; 1698 args[2] = collection;
1700 args[3] = predicate; 1699 args[3] = predicate;
@@ -1705,76 +1704,6 @@ See also `completing-read-function'. */)
1705 args[8] = inherit_input_method; 1704 args[8] = inherit_input_method;
1706 return Ffuncall (9, args); 1705 return Ffuncall (9, args);
1707} 1706}
1708
1709DEFUN ("completing-read-default", Fcompleting_read_default, Scompleting_read_default, 2, 8, 0,
1710 doc: /* Default method for reading from the minibuffer with completion.
1711See `completing-read' for the meaning of the arguments. */)
1712 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
1713{
1714 Lisp_Object val, histvar, histpos, position;
1715 Lisp_Object init;
1716 int pos = 0;
1717 int count = SPECPDL_INDEX ();
1718 struct gcpro gcpro1;
1719
1720 init = initial_input;
1721 GCPRO1 (def);
1722
1723 specbind (Qminibuffer_completion_table, collection);
1724 specbind (Qminibuffer_completion_predicate, predicate);
1725 specbind (Qminibuffer_completion_confirm,
1726 EQ (require_match, Qt) ? Qnil : require_match);
1727
1728 position = Qnil;
1729 if (!NILP (init))
1730 {
1731 if (CONSP (init))
1732 {
1733 position = Fcdr (init);
1734 init = Fcar (init);
1735 }
1736 CHECK_STRING (init);
1737 if (!NILP (position))
1738 {
1739 CHECK_NUMBER (position);
1740 /* Convert to distance from end of input. */
1741 pos = XINT (position) - SCHARS (init);
1742 }
1743 }
1744
1745 if (SYMBOLP (hist))
1746 {
1747 histvar = hist;
1748 histpos = Qnil;
1749 }
1750 else
1751 {
1752 histvar = Fcar_safe (hist);
1753 histpos = Fcdr_safe (hist);
1754 }
1755 if (NILP (histvar))
1756 histvar = Qminibuffer_history;
1757 if (NILP (histpos))
1758 XSETFASTINT (histpos, 0);
1759
1760 val = read_minibuf (NILP (require_match)
1761 ? (NILP (Vminibuffer_completing_file_name)
1762 || EQ (Vminibuffer_completing_file_name, Qlambda)
1763 ? Vminibuffer_local_completion_map
1764 : Vminibuffer_local_filename_completion_map)
1765 : (NILP (Vminibuffer_completing_file_name)
1766 || EQ (Vminibuffer_completing_file_name, Qlambda)
1767 ? Vminibuffer_local_must_match_map
1768 : Vminibuffer_local_filename_must_match_map),
1769 init, prompt, make_number (pos), 0,
1770 histvar, histpos, def, 0,
1771 !NILP (inherit_input_method));
1772
1773 if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def))
1774 val = CONSP (def) ? XCAR (def) : def;
1775
1776 RETURN_UNGCPRO (unbind_to (count, val));
1777}
1778 1707
1779Lisp_Object Fassoc_string (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold); 1708Lisp_Object Fassoc_string (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold);
1780 1709
@@ -2013,7 +1942,6 @@ syms_of_minibuf (void)
2013 minibuf_save_list = Qnil; 1942 minibuf_save_list = Qnil;
2014 staticpro (&minibuf_save_list); 1943 staticpro (&minibuf_save_list);
2015 1944
2016 DEFSYM (Qcompleting_read_default, "completing-read-default");
2017 DEFSYM (Qcompletion_ignore_case, "completion-ignore-case"); 1945 DEFSYM (Qcompletion_ignore_case, "completion-ignore-case");
2018 DEFSYM (Qread_file_name_internal, "read-file-name-internal"); 1946 DEFSYM (Qread_file_name_internal, "read-file-name-internal");
2019 DEFSYM (Qminibuffer_default, "minibuffer-default"); 1947 DEFSYM (Qminibuffer_default, "minibuffer-default");
@@ -2132,12 +2060,6 @@ If the value is `confirm-after-completion', the user may exit with an
2132 doc: /* Non-nil means completing file names. */); 2060 doc: /* Non-nil means completing file names. */);
2133 Vminibuffer_completing_file_name = Qnil; 2061 Vminibuffer_completing_file_name = Qnil;
2134 2062
2135 DEFVAR_LISP ("completing-read-function",
2136 Vcompleting_read_function,
2137 doc: /* The function called by `completing-read' to do the work.
2138It should accept the same arguments as `completing-read'. */);
2139 Vcompleting_read_function = Qcompleting_read_default;
2140
2141 DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form, 2063 DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form,
2142 doc: /* Value that `help-form' takes on inside the minibuffer. */); 2064 doc: /* Value that `help-form' takes on inside the minibuffer. */);
2143 Vminibuffer_help_form = Qnil; 2065 Vminibuffer_help_form = Qnil;
@@ -2214,5 +2136,4 @@ properties. */);
2214 defsubr (&Stest_completion); 2136 defsubr (&Stest_completion);
2215 defsubr (&Sassoc_string); 2137 defsubr (&Sassoc_string);
2216 defsubr (&Scompleting_read); 2138 defsubr (&Scompleting_read);
2217 defsubr (&Scompleting_read_default);
2218} 2139}