diff options
| -rw-r--r-- | src/minibuf.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index d4938415a1c..ff56eca3241 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -219,7 +219,7 @@ 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, |
| @@ -440,8 +440,7 @@ The current buffer must be a minibuffer. */) | |||
| 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; |
| @@ -452,7 +451,6 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 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 (); |
| @@ -747,7 +745,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 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; |
| @@ -774,8 +772,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 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 | ||
| @@ -937,7 +934,7 @@ read_minibuf_unwind (data) | |||
| 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 |
| @@ -961,8 +958,6 @@ Sixth arg DEFAULT-VALUE is the default value. If non-nil, it is available | |||
| 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. |
| @@ -978,9 +973,9 @@ 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; |
| @@ -1011,8 +1006,7 @@ and some related functions, which use zero-indexing for POSITION. */) | |||
| 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 | } |
| @@ -1029,7 +1023,7 @@ arguments are used as in `read-from-minibuffer') */) | |||
| 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, |
| @@ -1067,7 +1061,7 @@ Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | |||
| 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; |
| @@ -1089,7 +1083,7 @@ the current input method and the setting of`enable-multibyte-characters'. */) | |||
| 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, |
| @@ -1778,7 +1772,7 @@ Completion ignores case if the ambient value of | |||
| 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; |