diff options
| author | Richard M. Stallman | 2004-11-20 22:04:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-11-20 22:04:11 +0000 |
| commit | da34f64ebeff2f855b526b945a73e929029a2678 (patch) | |
| tree | d8b2cc72993ca58b96f0b8e2068396a548a2c32f /src | |
| parent | 2b2c3c7f627c36a57b30648db7a5a2930d9725e4 (diff) | |
| download | emacs-da34f64ebeff2f855b526b945a73e929029a2678.tar.gz emacs-da34f64ebeff2f855b526b945a73e929029a2678.zip | |
(read_minibuf): New arg KEEP_ALL. Callers changed.
(Fread_from_minibuffer): New ark KEEP_ALL. Callers changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index 3f125efa818..0037bd70535 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -218,7 +218,7 @@ static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object, | |||
| 218 | Lisp_Object, Lisp_Object, | 218 | Lisp_Object, Lisp_Object, |
| 219 | int, Lisp_Object, | 219 | int, Lisp_Object, |
| 220 | Lisp_Object, Lisp_Object, | 220 | Lisp_Object, Lisp_Object, |
| 221 | int, int)); | 221 | int, int, int)); |
| 222 | static Lisp_Object read_minibuf_noninteractive P_ ((Lisp_Object, Lisp_Object, | 222 | static Lisp_Object read_minibuf_noninteractive P_ ((Lisp_Object, Lisp_Object, |
| 223 | Lisp_Object, Lisp_Object, | 223 | Lisp_Object, Lisp_Object, |
| 224 | int, Lisp_Object, | 224 | int, Lisp_Object, |
| @@ -437,7 +437,8 @@ minibuffer_completion_contents () | |||
| 437 | 437 | ||
| 438 | static Lisp_Object | 438 | static Lisp_Object |
| 439 | read_minibuf (map, initial, prompt, backup_n, expflag, | 439 | read_minibuf (map, initial, prompt, backup_n, expflag, |
| 440 | histvar, histpos, defalt, allow_props, inherit_input_method) | 440 | histvar, histpos, defalt, allow_props, inherit_input_method, |
| 441 | keep_all) | ||
| 441 | Lisp_Object map; | 442 | Lisp_Object map; |
| 442 | Lisp_Object initial; | 443 | Lisp_Object initial; |
| 443 | Lisp_Object prompt; | 444 | Lisp_Object prompt; |
| @@ -448,6 +449,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 448 | Lisp_Object defalt; | 449 | Lisp_Object defalt; |
| 449 | int allow_props; | 450 | int allow_props; |
| 450 | int inherit_input_method; | 451 | int inherit_input_method; |
| 452 | int keep_all; | ||
| 451 | { | 453 | { |
| 452 | Lisp_Object val; | 454 | Lisp_Object val; |
| 453 | int count = SPECPDL_INDEX (); | 455 | int count = SPECPDL_INDEX (); |
| @@ -722,7 +724,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 722 | last_minibuf_string = val; | 724 | last_minibuf_string = val; |
| 723 | 725 | ||
| 724 | /* Choose the string to add to the history. */ | 726 | /* Choose the string to add to the history. */ |
| 725 | if (SCHARS (val) != 0) | 727 | if (SCHARS (val) != 0 || keep_all) |
| 726 | histstring = val; | 728 | histstring = val; |
| 727 | else if (STRINGP (defalt)) | 729 | else if (STRINGP (defalt)) |
| 728 | histstring = defalt; | 730 | histstring = defalt; |
| @@ -749,7 +751,8 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 749 | if (NILP (histval) | 751 | if (NILP (histval) |
| 750 | || (CONSP (histval) | 752 | || (CONSP (histval) |
| 751 | /* Don't duplicate the most recent entry in the history. */ | 753 | /* Don't duplicate the most recent entry in the history. */ |
| 752 | && NILP (Fequal (histstring, Fcar (histval))))) | 754 | && (keep_all |
| 755 | || NILP (Fequal (histstring, Fcar (histval)))))) | ||
| 753 | { | 756 | { |
| 754 | Lisp_Object length; | 757 | Lisp_Object length; |
| 755 | 758 | ||
| @@ -911,7 +914,7 @@ read_minibuf_unwind (data) | |||
| 911 | } | 914 | } |
| 912 | 915 | ||
| 913 | 916 | ||
| 914 | DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, 7, 0, | 917 | DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, 8, 0, |
| 915 | doc: /* Read a string from the minibuffer, prompting with string PROMPT. | 918 | doc: /* Read a string from the minibuffer, prompting with string PROMPT. |
| 916 | The optional second arg INITIAL-CONTENTS is an obsolete alternative to | 919 | The optional second arg INITIAL-CONTENTS is an obsolete alternative to |
| 917 | DEFAULT-VALUE. It normally should be nil in new code, except when | 920 | DEFAULT-VALUE. It normally should be nil in new code, except when |
| @@ -935,6 +938,8 @@ Sixth arg DEFAULT-VALUE is the default value. If non-nil, it is available | |||
| 935 | the empty string. | 938 | the empty string. |
| 936 | Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | 939 | Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits |
| 937 | the current input method and the setting of `enable-multibyte-characters'. | 940 | the current input method and the setting of `enable-multibyte-characters'. |
| 941 | Eight arg KEEP-ALL, if non-nil, says to put all inputs in the history list, | ||
| 942 | even empty or duplicate inputs. | ||
| 938 | If the variable `minibuffer-allow-text-properties' is non-nil, | 943 | If the variable `minibuffer-allow-text-properties' is non-nil, |
| 939 | then the string which is returned includes whatever text properties | 944 | then the string which is returned includes whatever text properties |
| 940 | were present in the minibuffer. Otherwise the value has no text properties. | 945 | were present in the minibuffer. Otherwise the value has no text properties. |
| @@ -950,9 +955,9 @@ POSITION in the minibuffer. Any integer value less than or equal to | |||
| 950 | one puts point at the beginning of the string. *Note* that this | 955 | one puts point at the beginning of the string. *Note* that this |
| 951 | behavior differs from the way such arguments are used in `completing-read' | 956 | behavior differs from the way such arguments are used in `completing-read' |
| 952 | and some related functions, which use zero-indexing for POSITION. */) | 957 | and some related functions, which use zero-indexing for POSITION. */) |
| 953 | (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method) | 958 | (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method, keep_all) |
| 954 | Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; | 959 | Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; |
| 955 | Lisp_Object inherit_input_method; | 960 | Lisp_Object inherit_input_method, keep_all; |
| 956 | { | 961 | { |
| 957 | Lisp_Object histvar, histpos, val; | 962 | Lisp_Object histvar, histpos, val; |
| 958 | struct gcpro gcpro1; | 963 | struct gcpro gcpro1; |
| @@ -983,7 +988,8 @@ and some related functions, which use zero-indexing for POSITION. */) | |||
| 983 | Qnil, !NILP (read), | 988 | Qnil, !NILP (read), |
| 984 | histvar, histpos, default_value, | 989 | histvar, histpos, default_value, |
| 985 | minibuffer_allow_text_properties, | 990 | minibuffer_allow_text_properties, |
| 986 | !NILP (inherit_input_method)); | 991 | !NILP (inherit_input_method), |
| 992 | !NILP (keep_all)); | ||
| 987 | UNGCPRO; | 993 | UNGCPRO; |
| 988 | return val; | 994 | return val; |
| 989 | } | 995 | } |
| @@ -1000,7 +1006,7 @@ arguments are used as in `read-from-minibuffer') */) | |||
| 1000 | CHECK_STRING (prompt); | 1006 | CHECK_STRING (prompt); |
| 1001 | return read_minibuf (Vminibuffer_local_map, initial_contents, | 1007 | return read_minibuf (Vminibuffer_local_map, initial_contents, |
| 1002 | prompt, Qnil, 1, Qminibuffer_history, | 1008 | prompt, Qnil, 1, Qminibuffer_history, |
| 1003 | make_number (0), Qnil, 0, 0); | 1009 | make_number (0), Qnil, 0, 0, 0); |
| 1004 | } | 1010 | } |
| 1005 | 1011 | ||
| 1006 | DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0, | 1012 | DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0, |
| @@ -1038,7 +1044,7 @@ Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | |||
| 1038 | Lisp_Object val; | 1044 | Lisp_Object val; |
| 1039 | val = Fread_from_minibuffer (prompt, initial_input, Qnil, | 1045 | val = Fread_from_minibuffer (prompt, initial_input, Qnil, |
| 1040 | Qnil, history, default_value, | 1046 | Qnil, history, default_value, |
| 1041 | inherit_input_method); | 1047 | inherit_input_method, Qnil); |
| 1042 | if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value)) | 1048 | if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value)) |
| 1043 | val = default_value; | 1049 | val = default_value; |
| 1044 | return val; | 1050 | return val; |
| @@ -1060,7 +1066,7 @@ the current input method and the setting of`enable-multibyte-characters'. */) | |||
| 1060 | CHECK_STRING (prompt); | 1066 | CHECK_STRING (prompt); |
| 1061 | return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil, | 1067 | return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil, |
| 1062 | 0, Qminibuffer_history, make_number (0), Qnil, 0, | 1068 | 0, Qminibuffer_history, make_number (0), Qnil, 0, |
| 1063 | !NILP (inherit_input_method)); | 1069 | !NILP (inherit_input_method), 0); |
| 1064 | } | 1070 | } |
| 1065 | 1071 | ||
| 1066 | DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0, | 1072 | DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0, |
| @@ -1711,7 +1717,7 @@ Completion ignores case if the ambient value of | |||
| 1711 | : Vminibuffer_local_must_match_map, | 1717 | : Vminibuffer_local_must_match_map, |
| 1712 | init, prompt, make_number (pos), 0, | 1718 | init, prompt, make_number (pos), 0, |
| 1713 | histvar, histpos, def, 0, | 1719 | histvar, histpos, def, 0, |
| 1714 | !NILP (inherit_input_method)); | 1720 | !NILP (inherit_input_method), 0); |
| 1715 | 1721 | ||
| 1716 | if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def)) | 1722 | if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def)) |
| 1717 | val = def; | 1723 | val = def; |