comparison src/minibuf.c @ 70930:f3ddca90b6b1

(read_minibuf): Remove arg KEEP_ALL. Callers changed. (Fread_from_minibuffer): Remove arg KEEP_ALL. Callers changed.
author Juri Linkov <juri@jurta.org>
date Thu, 25 May 2006 21:16:22 +0000
parents 088b163bf6e8
children 3c66cf4b4ded
comparison
equal deleted inserted replaced
70929:10bd863bbc8a 70930:f3ddca90b6b1
217 static Lisp_Object run_exit_minibuf_hook P_ ((Lisp_Object)); 217 static Lisp_Object run_exit_minibuf_hook P_ ((Lisp_Object));
218 static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object, 218 static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object,
219 Lisp_Object, Lisp_Object, 219 Lisp_Object, Lisp_Object,
220 int, Lisp_Object, 220 int, Lisp_Object,
221 Lisp_Object, Lisp_Object, 221 Lisp_Object, Lisp_Object,
222 int, int, int)); 222 int, int));
223 static Lisp_Object read_minibuf_noninteractive P_ ((Lisp_Object, Lisp_Object, 223 static Lisp_Object read_minibuf_noninteractive P_ ((Lisp_Object, Lisp_Object,
224 Lisp_Object, Lisp_Object, 224 Lisp_Object, Lisp_Object,
225 int, Lisp_Object, 225 int, Lisp_Object,
226 Lisp_Object, Lisp_Object, 226 Lisp_Object, Lisp_Object,
227 int, int)); 227 int, int));
438 if INHERIT_INPUT_METHOD is nonzero, the minibuffer inherits the 438 if INHERIT_INPUT_METHOD is nonzero, the minibuffer inherits the
439 current input method. */ 439 current input method. */
440 440
441 static Lisp_Object 441 static Lisp_Object
442 read_minibuf (map, initial, prompt, backup_n, expflag, 442 read_minibuf (map, initial, prompt, backup_n, expflag,
443 histvar, histpos, defalt, allow_props, inherit_input_method, 443 histvar, histpos, defalt, allow_props, inherit_input_method)
444 keep_all)
445 Lisp_Object map; 444 Lisp_Object map;
446 Lisp_Object initial; 445 Lisp_Object initial;
447 Lisp_Object prompt; 446 Lisp_Object prompt;
448 Lisp_Object backup_n; 447 Lisp_Object backup_n;
449 int expflag; 448 int expflag;
450 Lisp_Object histvar; 449 Lisp_Object histvar;
451 Lisp_Object histpos; 450 Lisp_Object histpos;
452 Lisp_Object defalt; 451 Lisp_Object defalt;
453 int allow_props; 452 int allow_props;
454 int inherit_input_method; 453 int inherit_input_method;
455 int keep_all;
456 { 454 {
457 Lisp_Object val; 455 Lisp_Object val;
458 int count = SPECPDL_INDEX (); 456 int count = SPECPDL_INDEX ();
459 Lisp_Object mini_frame, ambient_dir, minibuffer, input_method; 457 Lisp_Object mini_frame, ambient_dir, minibuffer, input_method;
460 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 458 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
745 /* VAL is the string of minibuffer text. */ 743 /* VAL is the string of minibuffer text. */
746 744
747 last_minibuf_string = val; 745 last_minibuf_string = val;
748 746
749 /* Choose the string to add to the history. */ 747 /* Choose the string to add to the history. */
750 if (SCHARS (val) != 0 || keep_all) 748 if (SCHARS (val) != 0)
751 histstring = val; 749 histstring = val;
752 else if (STRINGP (defalt)) 750 else if (STRINGP (defalt))
753 histstring = defalt; 751 histstring = defalt;
754 else 752 else
755 histstring = Qnil; 753 histstring = Qnil;
772 values are unacceptable. We silently ignore these values. */ 770 values are unacceptable. We silently ignore these values. */
773 771
774 if (NILP (histval) 772 if (NILP (histval)
775 || (CONSP (histval) 773 || (CONSP (histval)
776 /* Don't duplicate the most recent entry in the history. */ 774 /* Don't duplicate the most recent entry in the history. */
777 && (keep_all 775 && (NILP (Fequal (histstring, Fcar (histval))))))
778 || NILP (Fequal (histstring, Fcar (histval))))))
779 { 776 {
780 Lisp_Object length; 777 Lisp_Object length;
781 778
782 if (history_delete_duplicates) Fdelete (histstring, histval); 779 if (history_delete_duplicates) Fdelete (histstring, histval);
783 histval = Fcons (histstring, histval); 780 histval = Fcons (histstring, histval);
935 XSETFASTINT (XWINDOW (window)->last_overlay_modified, 0); 932 XSETFASTINT (XWINDOW (window)->last_overlay_modified, 0);
936 return Qnil; 933 return Qnil;
937 } 934 }
938 935
939 936
940 DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, 8, 0, 937 DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, 7, 0,
941 doc: /* Read a string from the minibuffer, prompting with string PROMPT. 938 doc: /* Read a string from the minibuffer, prompting with string PROMPT.
942 The optional second arg INITIAL-CONTENTS is an obsolete alternative to 939 The optional second arg INITIAL-CONTENTS is an obsolete alternative to
943 DEFAULT-VALUE. It normally should be nil in new code, except when 940 DEFAULT-VALUE. It normally should be nil in new code, except when
944 HIST is a cons. It is discussed in more detail below. 941 HIST is a cons. It is discussed in more detail below.
945 Third arg KEYMAP is a keymap to use whilst reading; 942 Third arg KEYMAP is a keymap to use whilst reading;
959 for history commands; but, unless READ is non-nil, `read-from-minibuffer' 956 for history commands; but, unless READ is non-nil, `read-from-minibuffer'
960 does NOT return DEFAULT-VALUE if the user enters empty input! It returns 957 does NOT return DEFAULT-VALUE if the user enters empty input! It returns
961 the empty string. 958 the empty string.
962 Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits 959 Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits
963 the current input method and the setting of `enable-multibyte-characters'. 960 the current input method and the setting of `enable-multibyte-characters'.
964 Eight arg KEEP-ALL, if non-nil, says to put all inputs in the history list,
965 even empty or duplicate inputs.
966 If the variable `minibuffer-allow-text-properties' is non-nil, 961 If the variable `minibuffer-allow-text-properties' is non-nil,
967 then the string which is returned includes whatever text properties 962 then the string which is returned includes whatever text properties
968 were present in the minibuffer. Otherwise the value has no text properties. 963 were present in the minibuffer. Otherwise the value has no text properties.
969 964
970 The remainder of this documentation string describes the 965 The remainder of this documentation string describes the
976 input is STRING, but point is placed at _one-indexed_ position 971 input is STRING, but point is placed at _one-indexed_ position
977 POSITION in the minibuffer. Any integer value less than or equal to 972 POSITION in the minibuffer. Any integer value less than or equal to
978 one puts point at the beginning of the string. *Note* that this 973 one puts point at the beginning of the string. *Note* that this
979 behavior differs from the way such arguments are used in `completing-read' 974 behavior differs from the way such arguments are used in `completing-read'
980 and some related functions, which use zero-indexing for POSITION. */) 975 and some related functions, which use zero-indexing for POSITION. */)
981 (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method, keep_all) 976 (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method)
982 Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; 977 Lisp_Object prompt, initial_contents, keymap, read, hist, default_value;
983 Lisp_Object inherit_input_method, keep_all; 978 Lisp_Object inherit_input_method;
984 { 979 {
985 Lisp_Object histvar, histpos, val; 980 Lisp_Object histvar, histpos, val;
986 struct gcpro gcpro1; 981 struct gcpro gcpro1;
987 982
988 CHECK_STRING (prompt); 983 CHECK_STRING (prompt);
1009 GCPRO1 (default_value); 1004 GCPRO1 (default_value);
1010 val = read_minibuf (keymap, initial_contents, prompt, 1005 val = read_minibuf (keymap, initial_contents, prompt,
1011 Qnil, !NILP (read), 1006 Qnil, !NILP (read),
1012 histvar, histpos, default_value, 1007 histvar, histpos, default_value,
1013 minibuffer_allow_text_properties, 1008 minibuffer_allow_text_properties,
1014 !NILP (inherit_input_method), 1009 !NILP (inherit_input_method));
1015 !NILP (keep_all));
1016 UNGCPRO; 1010 UNGCPRO;
1017 return val; 1011 return val;
1018 } 1012 }
1019 1013
1020 DEFUN ("read-minibuffer", Fread_minibuffer, Sread_minibuffer, 1, 2, 0, 1014 DEFUN ("read-minibuffer", Fread_minibuffer, Sread_minibuffer, 1, 2, 0,
1027 Lisp_Object prompt, initial_contents; 1021 Lisp_Object prompt, initial_contents;
1028 { 1022 {
1029 CHECK_STRING (prompt); 1023 CHECK_STRING (prompt);
1030 return read_minibuf (Vminibuffer_local_map, initial_contents, 1024 return read_minibuf (Vminibuffer_local_map, initial_contents,
1031 prompt, Qnil, 1, Qminibuffer_history, 1025 prompt, Qnil, 1, Qminibuffer_history,
1032 make_number (0), Qnil, 0, 0, 0); 1026 make_number (0), Qnil, 0, 0);
1033 } 1027 }
1034 1028
1035 DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0, 1029 DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0,
1036 doc: /* Return value of Lisp expression read using the minibuffer. 1030 doc: /* Return value of Lisp expression read using the minibuffer.
1037 Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS 1031 Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
1065 Lisp_Object inherit_input_method; 1059 Lisp_Object inherit_input_method;
1066 { 1060 {
1067 Lisp_Object val; 1061 Lisp_Object val;
1068 val = Fread_from_minibuffer (prompt, initial_input, Qnil, 1062 val = Fread_from_minibuffer (prompt, initial_input, Qnil,
1069 Qnil, history, default_value, 1063 Qnil, history, default_value,
1070 inherit_input_method, Qnil); 1064 inherit_input_method);
1071 if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value)) 1065 if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value))
1072 val = default_value; 1066 val = default_value;
1073 return val; 1067 return val;
1074 } 1068 }
1075 1069
1087 Lisp_Object prompt, initial, inherit_input_method; 1081 Lisp_Object prompt, initial, inherit_input_method;
1088 { 1082 {
1089 CHECK_STRING (prompt); 1083 CHECK_STRING (prompt);
1090 return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil, 1084 return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil,
1091 0, Qminibuffer_history, make_number (0), Qnil, 0, 1085 0, Qminibuffer_history, make_number (0), Qnil, 0,
1092 !NILP (inherit_input_method), 0); 1086 !NILP (inherit_input_method));
1093 } 1087 }
1094 1088
1095 DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0, 1089 DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0,
1096 doc: /* Read the name of a command and return as a symbol. 1090 doc: /* Read the name of a command and return as a symbol.
1097 Prompt with PROMPT. By default, return DEFAULT-VALUE. */) 1091 Prompt with PROMPT. By default, return DEFAULT-VALUE. */)
1776 : (NILP (Vminibuffer_completing_file_name) 1770 : (NILP (Vminibuffer_completing_file_name)
1777 ? Vminibuffer_local_must_match_map 1771 ? Vminibuffer_local_must_match_map
1778 : Vminibuffer_local_must_match_filename_map), 1772 : Vminibuffer_local_must_match_filename_map),
1779 init, prompt, make_number (pos), 0, 1773 init, prompt, make_number (pos), 0,
1780 histvar, histpos, def, 0, 1774 histvar, histpos, def, 0,
1781 !NILP (inherit_input_method), 0); 1775 !NILP (inherit_input_method));
1782 1776
1783 if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def)) 1777 if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def))
1784 val = def; 1778 val = def;
1785 1779
1786 RETURN_UNGCPRO (unbind_to (count, val)); 1780 RETURN_UNGCPRO (unbind_to (count, val));