diff options
| author | Stefan Monnier | 2011-05-31 00:03:38 -0300 |
|---|---|---|
| committer | Stefan Monnier | 2011-05-31 00:03:38 -0300 |
| commit | 620c53a664e41788f6d4f8e3f687e1a0d448b857 (patch) | |
| tree | 64b790dcda19362a90514d4ff419fef06b7eb111 /src | |
| parent | e003a29261f4d1f9263efbcabbeb4e502de5612b (diff) | |
| download | emacs-620c53a664e41788f6d4f8e3f687e1a0d448b857.tar.gz emacs-620c53a664e41788f6d4f8e3f687e1a0d448b857.zip | |
* lisp/minibuffer.el: Add metadata method to completion tables.
(completion-category-overrides): New defcustom.
(completion-metadata, completion--field-metadata)
(completion-metadata-get, completion--styles)
(completion--cycle-threshold): New functions.
(completion-try-completion, completion-all-completions):
Add `metadata' argument to choose completion-styles.
(completion--do-completion): Use metadata to choose cycling.
(completion-all-sorted-completions): Use metadata for sorting.
Remove :completion-cycle-penalty which is not needed any more.
(completion--try-word-completion): Add `metadata' argument.
(minibuffer-completion-help): Check metadata for annotation function
and sorting.
(completion-file-name-table): Return `category' metadata.
(minibuffer-completing-file-name): Make obsolete.
* lisp/simple.el (minibuffer-completing-symbol): Make obsolete.
* lisp/icomplete.el (icomplete-completions): Pass new `metadata' param to
completion-try-completion.
* src/minibuf.c (Finternal_complete_buffer): Return `category' metadata.
(read_minibuf): Use get_minibuffer.
(syms_of_minibuf): Use DEFSYM.
(Qmetadata): New var.
* src/data.c (Qbuffer): Don't make it static.
(syms_of_data): Use DEFSYM.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 21 | ||||
| -rw-r--r-- | src/data.c | 269 | ||||
| -rw-r--r-- | src/minibuf.c | 83 |
3 files changed, 139 insertions, 234 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d5eb84095fd..813e590681d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * minibuf.c (Finternal_complete_buffer): Return `category' metadata. | ||
| 4 | (read_minibuf): Use get_minibuffer. | ||
| 5 | (syms_of_minibuf): Use DEFSYM. | ||
| 6 | (Qmetadata): New var. | ||
| 7 | * data.c (Qbuffer): Don't make it static. | ||
| 8 | (syms_of_data): Use DEFSYM. | ||
| 9 | |||
| 1 | 2011-05-31 Paul Eggert <eggert@cs.ucla.edu> | 10 | 2011-05-31 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 11 | ||
| 3 | * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751) | 12 | * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751) |
| @@ -164,8 +173,8 @@ | |||
| 164 | (symbol_to_x_atom): Remove gratuitous arg. | 173 | (symbol_to_x_atom): Remove gratuitous arg. |
| 165 | (x_handle_selection_request, lisp_data_to_selection_data) | 174 | (x_handle_selection_request, lisp_data_to_selection_data) |
| 166 | (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed. | 175 | (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed. |
| 167 | (x_own_selection, x_get_local_selection, x_convert_selection): New | 176 | (x_own_selection, x_get_local_selection, x_convert_selection): |
| 168 | arg, specifying work frame. Use terminal-local Vselection_alist. | 177 | New arg, specifying work frame. Use terminal-local Vselection_alist. |
| 169 | (some_frame_on_display): Delete unused function. | 178 | (some_frame_on_display): Delete unused function. |
| 170 | (Fx_own_selection_internal, Fx_get_selection_internal) | 179 | (Fx_own_selection_internal, Fx_get_selection_internal) |
| 171 | (Fx_disown_selection_internal, Fx_selection_owner_p) | 180 | (Fx_disown_selection_internal, Fx_selection_owner_p) |
| @@ -186,8 +195,8 @@ | |||
| 186 | (x_selection_request_lisp_error): Free the above. | 195 | (x_selection_request_lisp_error): Free the above. |
| 187 | (x_get_local_selection): Remove unnecessary code. | 196 | (x_get_local_selection): Remove unnecessary code. |
| 188 | (x_reply_selection_request): Args changed; handle arbitrary array | 197 | (x_reply_selection_request): Args changed; handle arbitrary array |
| 189 | of converted selections stored in converted_selections. Separate | 198 | of converted selections stored in converted_selections. |
| 190 | the XChangeProperty and SelectionNotify steps. | 199 | Separate the XChangeProperty and SelectionNotify steps. |
| 191 | (x_handle_selection_request): Rewrite to handle MULTIPLE target. | 200 | (x_handle_selection_request): Rewrite to handle MULTIPLE target. |
| 192 | (x_convert_selection): New function. | 201 | (x_convert_selection): New function. |
| 193 | (x_handle_selection_event): Simplify. | 202 | (x_handle_selection_event): Simplify. |
| @@ -351,8 +360,8 @@ | |||
| 351 | 360 | ||
| 352 | Be more systematic about user-interface timestamps. | 361 | Be more systematic about user-interface timestamps. |
| 353 | Before, the code sometimes used 'Time', sometimes 'unsigned long', | 362 | Before, the code sometimes used 'Time', sometimes 'unsigned long', |
| 354 | and sometimes 'EMACS_UINT', to represent these timestamps. This | 363 | and sometimes 'EMACS_UINT', to represent these timestamps. |
| 355 | change causes it to use 'Time' uniformly, as that's what X uses. | 364 | This change causes it to use 'Time' uniformly, as that's what X uses. |
| 356 | This makes the code easier to follow, and makes it easier to catch | 365 | This makes the code easier to follow, and makes it easier to catch |
| 357 | integer overflow bugs such as Bug#8664. | 366 | integer overflow bugs such as Bug#8664. |
| 358 | * frame.c (Fmouse_position, Fmouse_pixel_position): | 367 | * frame.c (Fmouse_position, Fmouse_pixel_position): |
diff --git a/src/data.c b/src/data.c index a26627875ab..443d78376d9 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -32,14 +32,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 32 | #include "keyboard.h" | 32 | #include "keyboard.h" |
| 33 | #include "frame.h" | 33 | #include "frame.h" |
| 34 | #include "syssignal.h" | 34 | #include "syssignal.h" |
| 35 | #include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */ | 35 | #include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */ |
| 36 | #include "font.h" | 36 | #include "font.h" |
| 37 | 37 | ||
| 38 | #ifdef STDC_HEADERS | 38 | #ifdef STDC_HEADERS |
| 39 | #include <float.h> | 39 | #include <float.h> |
| 40 | #endif | 40 | #endif |
| 41 | 41 | ||
| 42 | /* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ | 42 | /* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ |
| 43 | #ifndef IEEE_FLOATING_POINT | 43 | #ifndef IEEE_FLOATING_POINT |
| 44 | #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ | 44 | #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ |
| 45 | && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128) | 45 | && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128) |
| @@ -90,7 +90,7 @@ static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay; | |||
| 90 | Lisp_Object Qwindow; | 90 | Lisp_Object Qwindow; |
| 91 | static Lisp_Object Qfloat, Qwindow_configuration; | 91 | static Lisp_Object Qfloat, Qwindow_configuration; |
| 92 | static Lisp_Object Qprocess; | 92 | static Lisp_Object Qprocess; |
| 93 | static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector; | 93 | Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector; |
| 94 | static Lisp_Object Qchar_table, Qbool_vector, Qhash_table; | 94 | static Lisp_Object Qchar_table, Qbool_vector, Qhash_table; |
| 95 | static Lisp_Object Qsubrp, Qmany, Qunevalled; | 95 | static Lisp_Object Qsubrp, Qmany, Qunevalled; |
| 96 | Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; | 96 | Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; |
| @@ -2854,74 +2854,75 @@ syms_of_data (void) | |||
| 2854 | { | 2854 | { |
| 2855 | Lisp_Object error_tail, arith_tail; | 2855 | Lisp_Object error_tail, arith_tail; |
| 2856 | 2856 | ||
| 2857 | Qquote = intern_c_string ("quote"); | 2857 | DEFSYM (Qquote, "quote"); |
| 2858 | Qlambda = intern_c_string ("lambda"); | 2858 | DEFSYM (Qlambda, "lambda"); |
| 2859 | Qsubr = intern_c_string ("subr"); | 2859 | DEFSYM (Qsubr, "subr"); |
| 2860 | Qerror_conditions = intern_c_string ("error-conditions"); | 2860 | DEFSYM (Qerror_conditions, "error-conditions"); |
| 2861 | Qerror_message = intern_c_string ("error-message"); | 2861 | DEFSYM (Qerror_message, "error-message"); |
| 2862 | Qtop_level = intern_c_string ("top-level"); | 2862 | DEFSYM (Qtop_level, "top-level"); |
| 2863 | 2863 | ||
| 2864 | Qerror = intern_c_string ("error"); | 2864 | DEFSYM (Qerror, "error"); |
| 2865 | Qquit = intern_c_string ("quit"); | 2865 | DEFSYM (Qquit, "quit"); |
| 2866 | Qwrong_type_argument = intern_c_string ("wrong-type-argument"); | 2866 | DEFSYM (Qwrong_type_argument, "wrong-type-argument"); |
| 2867 | Qargs_out_of_range = intern_c_string ("args-out-of-range"); | 2867 | DEFSYM (Qargs_out_of_range, "args-out-of-range"); |
| 2868 | Qvoid_function = intern_c_string ("void-function"); | 2868 | DEFSYM (Qvoid_function, "void-function"); |
| 2869 | Qcyclic_function_indirection = intern_c_string ("cyclic-function-indirection"); | 2869 | DEFSYM (Qcyclic_function_indirection, "cyclic-function-indirection"); |
| 2870 | Qcyclic_variable_indirection = intern_c_string ("cyclic-variable-indirection"); | 2870 | DEFSYM (Qcyclic_variable_indirection, "cyclic-variable-indirection"); |
| 2871 | Qvoid_variable = intern_c_string ("void-variable"); | 2871 | DEFSYM (Qvoid_variable, "void-variable"); |
| 2872 | Qsetting_constant = intern_c_string ("setting-constant"); | 2872 | DEFSYM (Qsetting_constant, "setting-constant"); |
| 2873 | Qinvalid_read_syntax = intern_c_string ("invalid-read-syntax"); | 2873 | DEFSYM (Qinvalid_read_syntax, "invalid-read-syntax"); |
| 2874 | 2874 | ||
| 2875 | Qinvalid_function = intern_c_string ("invalid-function"); | 2875 | DEFSYM (Qinvalid_function, "invalid-function"); |
| 2876 | Qwrong_number_of_arguments = intern_c_string ("wrong-number-of-arguments"); | 2876 | DEFSYM (Qwrong_number_of_arguments, "wrong-number-of-arguments"); |
| 2877 | Qno_catch = intern_c_string ("no-catch"); | 2877 | DEFSYM (Qno_catch, "no-catch"); |
| 2878 | Qend_of_file = intern_c_string ("end-of-file"); | 2878 | DEFSYM (Qend_of_file, "end-of-file"); |
| 2879 | Qarith_error = intern_c_string ("arith-error"); | 2879 | DEFSYM (Qarith_error, "arith-error"); |
| 2880 | Qbeginning_of_buffer = intern_c_string ("beginning-of-buffer"); | 2880 | DEFSYM (Qbeginning_of_buffer, "beginning-of-buffer"); |
| 2881 | Qend_of_buffer = intern_c_string ("end-of-buffer"); | 2881 | DEFSYM (Qend_of_buffer, "end-of-buffer"); |
| 2882 | Qbuffer_read_only = intern_c_string ("buffer-read-only"); | 2882 | DEFSYM (Qbuffer_read_only, "buffer-read-only"); |
| 2883 | Qtext_read_only = intern_c_string ("text-read-only"); | 2883 | DEFSYM (Qtext_read_only, "text-read-only"); |
| 2884 | Qmark_inactive = intern_c_string ("mark-inactive"); | 2884 | DEFSYM (Qmark_inactive, "mark-inactive"); |
| 2885 | 2885 | ||
| 2886 | Qlistp = intern_c_string ("listp"); | 2886 | DEFSYM (Qlistp, "listp"); |
| 2887 | Qconsp = intern_c_string ("consp"); | 2887 | DEFSYM (Qconsp, "consp"); |
| 2888 | Qsymbolp = intern_c_string ("symbolp"); | 2888 | DEFSYM (Qsymbolp, "symbolp"); |
| 2889 | Qkeywordp = intern_c_string ("keywordp"); | 2889 | DEFSYM (Qkeywordp, "keywordp"); |
| 2890 | Qintegerp = intern_c_string ("integerp"); | 2890 | DEFSYM (Qintegerp, "integerp"); |
| 2891 | Qnatnump = intern_c_string ("natnump"); | 2891 | DEFSYM (Qnatnump, "natnump"); |
| 2892 | Qwholenump = intern_c_string ("wholenump"); | 2892 | DEFSYM (Qwholenump, "wholenump"); |
| 2893 | Qstringp = intern_c_string ("stringp"); | 2893 | DEFSYM (Qstringp, "stringp"); |
| 2894 | Qarrayp = intern_c_string ("arrayp"); | 2894 | DEFSYM (Qarrayp, "arrayp"); |
| 2895 | Qsequencep = intern_c_string ("sequencep"); | 2895 | DEFSYM (Qsequencep, "sequencep"); |
| 2896 | Qbufferp = intern_c_string ("bufferp"); | 2896 | DEFSYM (Qbufferp, "bufferp"); |
| 2897 | Qvectorp = intern_c_string ("vectorp"); | 2897 | DEFSYM (Qvectorp, "vectorp"); |
| 2898 | Qchar_or_string_p = intern_c_string ("char-or-string-p"); | 2898 | DEFSYM (Qchar_or_string_p, "char-or-string-p"); |
| 2899 | Qmarkerp = intern_c_string ("markerp"); | 2899 | DEFSYM (Qmarkerp, "markerp"); |
| 2900 | Qbuffer_or_string_p = intern_c_string ("buffer-or-string-p"); | 2900 | DEFSYM (Qbuffer_or_string_p, "buffer-or-string-p"); |
| 2901 | Qinteger_or_marker_p = intern_c_string ("integer-or-marker-p"); | 2901 | DEFSYM (Qinteger_or_marker_p, "integer-or-marker-p"); |
| 2902 | Qboundp = intern_c_string ("boundp"); | 2902 | DEFSYM (Qboundp, "boundp"); |
| 2903 | Qfboundp = intern_c_string ("fboundp"); | 2903 | DEFSYM (Qfboundp, "fboundp"); |
| 2904 | 2904 | ||
| 2905 | Qfloatp = intern_c_string ("floatp"); | 2905 | DEFSYM (Qfloatp, "floatp"); |
| 2906 | Qnumberp = intern_c_string ("numberp"); | 2906 | DEFSYM (Qnumberp, "numberp"); |
| 2907 | Qnumber_or_marker_p = intern_c_string ("number-or-marker-p"); | 2907 | DEFSYM (Qnumber_or_marker_p, "number-or-marker-p"); |
| 2908 | 2908 | ||
| 2909 | Qchar_table_p = intern_c_string ("char-table-p"); | 2909 | DEFSYM (Qchar_table_p, "char-table-p"); |
| 2910 | Qvector_or_char_table_p = intern_c_string ("vector-or-char-table-p"); | 2910 | DEFSYM (Qvector_or_char_table_p, "vector-or-char-table-p"); |
| 2911 | 2911 | ||
| 2912 | Qsubrp = intern_c_string ("subrp"); | 2912 | DEFSYM (Qsubrp, "subrp"); |
| 2913 | Qunevalled = intern_c_string ("unevalled"); | 2913 | DEFSYM (Qunevalled, "unevalled"); |
| 2914 | Qmany = intern_c_string ("many"); | 2914 | DEFSYM (Qmany, "many"); |
| 2915 | 2915 | ||
| 2916 | Qcdr = intern_c_string ("cdr"); | 2916 | DEFSYM (Qcdr, "cdr"); |
| 2917 | 2917 | ||
| 2918 | /* Handle automatic advice activation */ | 2918 | /* Handle automatic advice activation. */ |
| 2919 | Qad_advice_info = intern_c_string ("ad-advice-info"); | 2919 | DEFSYM (Qad_advice_info, "ad-advice-info"); |
| 2920 | Qad_activate_internal = intern_c_string ("ad-activate-internal"); | 2920 | DEFSYM (Qad_activate_internal, "ad-activate-internal"); |
| 2921 | 2921 | ||
| 2922 | error_tail = pure_cons (Qerror, Qnil); | 2922 | error_tail = pure_cons (Qerror, Qnil); |
| 2923 | 2923 | ||
| 2924 | /* ERROR is used as a signaler for random errors for which nothing else is right */ | 2924 | /* ERROR is used as a signaler for random errors for which nothing else is |
| 2925 | right. */ | ||
| 2925 | 2926 | ||
| 2926 | Fput (Qerror, Qerror_conditions, | 2927 | Fput (Qerror, Qerror_conditions, |
| 2927 | error_tail); | 2928 | error_tail); |
| @@ -2958,8 +2959,7 @@ syms_of_data (void) | |||
| 2958 | Fput (Qcyclic_variable_indirection, Qerror_message, | 2959 | Fput (Qcyclic_variable_indirection, Qerror_message, |
| 2959 | make_pure_c_string ("Symbol's chain of variable indirections contains a loop")); | 2960 | make_pure_c_string ("Symbol's chain of variable indirections contains a loop")); |
| 2960 | 2961 | ||
| 2961 | Qcircular_list = intern_c_string ("circular-list"); | 2962 | DEFSYM (Qcircular_list, "circular-list"); |
| 2962 | staticpro (&Qcircular_list); | ||
| 2963 | Fput (Qcircular_list, Qerror_conditions, | 2963 | Fput (Qcircular_list, Qerror_conditions, |
| 2964 | pure_cons (Qcircular_list, error_tail)); | 2964 | pure_cons (Qcircular_list, error_tail)); |
| 2965 | Fput (Qcircular_list, Qerror_message, | 2965 | Fput (Qcircular_list, Qerror_message, |
| @@ -3026,11 +3026,11 @@ syms_of_data (void) | |||
| 3026 | Fput (Qtext_read_only, Qerror_message, | 3026 | Fput (Qtext_read_only, Qerror_message, |
| 3027 | make_pure_c_string ("Text is read-only")); | 3027 | make_pure_c_string ("Text is read-only")); |
| 3028 | 3028 | ||
| 3029 | Qrange_error = intern_c_string ("range-error"); | 3029 | DEFSYM (Qrange_error, "range-error"); |
| 3030 | Qdomain_error = intern_c_string ("domain-error"); | 3030 | DEFSYM (Qdomain_error, "domain-error"); |
| 3031 | Qsingularity_error = intern_c_string ("singularity-error"); | 3031 | DEFSYM (Qsingularity_error, "singularity-error"); |
| 3032 | Qoverflow_error = intern_c_string ("overflow-error"); | 3032 | DEFSYM (Qoverflow_error, "overflow-error"); |
| 3033 | Qunderflow_error = intern_c_string ("underflow-error"); | 3033 | DEFSYM (Qunderflow_error, "underflow-error"); |
| 3034 | 3034 | ||
| 3035 | Fput (Qdomain_error, Qerror_conditions, | 3035 | Fput (Qdomain_error, Qerror_conditions, |
| 3036 | pure_cons (Qdomain_error, arith_tail)); | 3036 | pure_cons (Qdomain_error, arith_tail)); |
| @@ -3057,93 +3057,29 @@ syms_of_data (void) | |||
| 3057 | Fput (Qunderflow_error, Qerror_message, | 3057 | Fput (Qunderflow_error, Qerror_message, |
| 3058 | make_pure_c_string ("Arithmetic underflow error")); | 3058 | make_pure_c_string ("Arithmetic underflow error")); |
| 3059 | 3059 | ||
| 3060 | staticpro (&Qrange_error); | ||
| 3061 | staticpro (&Qdomain_error); | ||
| 3062 | staticpro (&Qsingularity_error); | ||
| 3063 | staticpro (&Qoverflow_error); | ||
| 3064 | staticpro (&Qunderflow_error); | ||
| 3065 | |||
| 3066 | staticpro (&Qnil); | 3060 | staticpro (&Qnil); |
| 3067 | staticpro (&Qt); | 3061 | staticpro (&Qt); |
| 3068 | staticpro (&Qquote); | ||
| 3069 | staticpro (&Qlambda); | ||
| 3070 | staticpro (&Qsubr); | ||
| 3071 | staticpro (&Qunbound); | 3062 | staticpro (&Qunbound); |
| 3072 | staticpro (&Qerror_conditions); | ||
| 3073 | staticpro (&Qerror_message); | ||
| 3074 | staticpro (&Qtop_level); | ||
| 3075 | |||
| 3076 | staticpro (&Qerror); | ||
| 3077 | staticpro (&Qquit); | ||
| 3078 | staticpro (&Qwrong_type_argument); | ||
| 3079 | staticpro (&Qargs_out_of_range); | ||
| 3080 | staticpro (&Qvoid_function); | ||
| 3081 | staticpro (&Qcyclic_function_indirection); | ||
| 3082 | staticpro (&Qcyclic_variable_indirection); | ||
| 3083 | staticpro (&Qvoid_variable); | ||
| 3084 | staticpro (&Qsetting_constant); | ||
| 3085 | staticpro (&Qinvalid_read_syntax); | ||
| 3086 | staticpro (&Qwrong_number_of_arguments); | ||
| 3087 | staticpro (&Qinvalid_function); | ||
| 3088 | staticpro (&Qno_catch); | ||
| 3089 | staticpro (&Qend_of_file); | ||
| 3090 | staticpro (&Qarith_error); | ||
| 3091 | staticpro (&Qbeginning_of_buffer); | ||
| 3092 | staticpro (&Qend_of_buffer); | ||
| 3093 | staticpro (&Qbuffer_read_only); | ||
| 3094 | staticpro (&Qtext_read_only); | ||
| 3095 | staticpro (&Qmark_inactive); | ||
| 3096 | |||
| 3097 | staticpro (&Qlistp); | ||
| 3098 | staticpro (&Qconsp); | ||
| 3099 | staticpro (&Qsymbolp); | ||
| 3100 | staticpro (&Qkeywordp); | ||
| 3101 | staticpro (&Qintegerp); | ||
| 3102 | staticpro (&Qnatnump); | ||
| 3103 | staticpro (&Qwholenump); | ||
| 3104 | staticpro (&Qstringp); | ||
| 3105 | staticpro (&Qarrayp); | ||
| 3106 | staticpro (&Qsequencep); | ||
| 3107 | staticpro (&Qbufferp); | ||
| 3108 | staticpro (&Qvectorp); | ||
| 3109 | staticpro (&Qchar_or_string_p); | ||
| 3110 | staticpro (&Qmarkerp); | ||
| 3111 | staticpro (&Qbuffer_or_string_p); | ||
| 3112 | staticpro (&Qinteger_or_marker_p); | ||
| 3113 | staticpro (&Qfloatp); | ||
| 3114 | staticpro (&Qnumberp); | ||
| 3115 | staticpro (&Qnumber_or_marker_p); | ||
| 3116 | staticpro (&Qchar_table_p); | ||
| 3117 | staticpro (&Qvector_or_char_table_p); | ||
| 3118 | staticpro (&Qsubrp); | ||
| 3119 | staticpro (&Qmany); | ||
| 3120 | staticpro (&Qunevalled); | ||
| 3121 | |||
| 3122 | staticpro (&Qboundp); | ||
| 3123 | staticpro (&Qfboundp); | ||
| 3124 | staticpro (&Qcdr); | ||
| 3125 | staticpro (&Qad_advice_info); | ||
| 3126 | staticpro (&Qad_activate_internal); | ||
| 3127 | 3063 | ||
| 3128 | /* Types that type-of returns. */ | 3064 | /* Types that type-of returns. */ |
| 3129 | Qinteger = intern_c_string ("integer"); | 3065 | DEFSYM (Qinteger, "integer"); |
| 3130 | Qsymbol = intern_c_string ("symbol"); | 3066 | DEFSYM (Qsymbol, "symbol"); |
| 3131 | Qstring = intern_c_string ("string"); | 3067 | DEFSYM (Qstring, "string"); |
| 3132 | Qcons = intern_c_string ("cons"); | 3068 | DEFSYM (Qcons, "cons"); |
| 3133 | Qmarker = intern_c_string ("marker"); | 3069 | DEFSYM (Qmarker, "marker"); |
| 3134 | Qoverlay = intern_c_string ("overlay"); | 3070 | DEFSYM (Qoverlay, "overlay"); |
| 3135 | Qfloat = intern_c_string ("float"); | 3071 | DEFSYM (Qfloat, "float"); |
| 3136 | Qwindow_configuration = intern_c_string ("window-configuration"); | 3072 | DEFSYM (Qwindow_configuration, "window-configuration"); |
| 3137 | Qprocess = intern_c_string ("process"); | 3073 | DEFSYM (Qprocess, "process"); |
| 3138 | Qwindow = intern_c_string ("window"); | 3074 | DEFSYM (Qwindow, "window"); |
| 3139 | /* Qsubr = intern_c_string ("subr"); */ | 3075 | /* DEFSYM (Qsubr, "subr"); */ |
| 3140 | Qcompiled_function = intern_c_string ("compiled-function"); | 3076 | DEFSYM (Qcompiled_function, "compiled-function"); |
| 3141 | Qbuffer = intern_c_string ("buffer"); | 3077 | DEFSYM (Qbuffer, "buffer"); |
| 3142 | Qframe = intern_c_string ("frame"); | 3078 | DEFSYM (Qframe, "frame"); |
| 3143 | Qvector = intern_c_string ("vector"); | 3079 | DEFSYM (Qvector, "vector"); |
| 3144 | Qchar_table = intern_c_string ("char-table"); | 3080 | DEFSYM (Qchar_table, "char-table"); |
| 3145 | Qbool_vector = intern_c_string ("bool-vector"); | 3081 | DEFSYM (Qbool_vector, "bool-vector"); |
| 3146 | Qhash_table = intern_c_string ("hash-table"); | 3082 | DEFSYM (Qhash_table, "hash-table"); |
| 3147 | 3083 | ||
| 3148 | DEFSYM (Qfont_spec, "font-spec"); | 3084 | DEFSYM (Qfont_spec, "font-spec"); |
| 3149 | DEFSYM (Qfont_entity, "font-entity"); | 3085 | DEFSYM (Qfont_entity, "font-entity"); |
| @@ -3151,25 +3087,6 @@ syms_of_data (void) | |||
| 3151 | 3087 | ||
| 3152 | DEFSYM (Qinteractive_form, "interactive-form"); | 3088 | DEFSYM (Qinteractive_form, "interactive-form"); |
| 3153 | 3089 | ||
| 3154 | staticpro (&Qinteger); | ||
| 3155 | staticpro (&Qsymbol); | ||
| 3156 | staticpro (&Qstring); | ||
| 3157 | staticpro (&Qcons); | ||
| 3158 | staticpro (&Qmarker); | ||
| 3159 | staticpro (&Qoverlay); | ||
| 3160 | staticpro (&Qfloat); | ||
| 3161 | staticpro (&Qwindow_configuration); | ||
| 3162 | staticpro (&Qprocess); | ||
| 3163 | staticpro (&Qwindow); | ||
| 3164 | /* staticpro (&Qsubr); */ | ||
| 3165 | staticpro (&Qcompiled_function); | ||
| 3166 | staticpro (&Qbuffer); | ||
| 3167 | staticpro (&Qframe); | ||
| 3168 | staticpro (&Qvector); | ||
| 3169 | staticpro (&Qchar_table); | ||
| 3170 | staticpro (&Qbool_vector); | ||
| 3171 | staticpro (&Qhash_table); | ||
| 3172 | |||
| 3173 | defsubr (&Sindirect_variable); | 3090 | defsubr (&Sindirect_variable); |
| 3174 | defsubr (&Sinteractive_form); | 3091 | defsubr (&Sinteractive_form); |
| 3175 | defsubr (&Seq); | 3092 | defsubr (&Seq); |
diff --git a/src/minibuf.c b/src/minibuf.c index 3f8bd835211..4658b05e91d 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -43,7 +43,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 43 | 43 | ||
| 44 | Lisp_Object Vminibuffer_list; | 44 | Lisp_Object Vminibuffer_list; |
| 45 | 45 | ||
| 46 | /* Data to remember during recursive minibuffer invocations */ | 46 | /* Data to remember during recursive minibuffer invocations. */ |
| 47 | 47 | ||
| 48 | static Lisp_Object minibuf_save_list; | 48 | static Lisp_Object minibuf_save_list; |
| 49 | 49 | ||
| @@ -55,7 +55,7 @@ int minibuf_level; | |||
| 55 | 55 | ||
| 56 | static Lisp_Object Qhistory_length; | 56 | static Lisp_Object Qhistory_length; |
| 57 | 57 | ||
| 58 | /* Fread_minibuffer leaves the input here as a string. */ | 58 | /* Fread_minibuffer leaves the input here as a string. */ |
| 59 | 59 | ||
| 60 | Lisp_Object last_minibuf_string; | 60 | Lisp_Object last_minibuf_string; |
| 61 | 61 | ||
| @@ -588,7 +588,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 588 | /* Empty out the minibuffers of all frames other than the one | 588 | /* Empty out the minibuffers of all frames other than the one |
| 589 | where we are going to display one now. | 589 | where we are going to display one now. |
| 590 | Set them to point to ` *Minibuf-0*', which is always empty. */ | 590 | Set them to point to ` *Minibuf-0*', which is always empty. */ |
| 591 | empty_minibuf = Fget_buffer (build_string (" *Minibuf-0*")); | 591 | empty_minibuf = get_minibuffer (0); |
| 592 | 592 | ||
| 593 | FOR_EACH_FRAME (dummy, frame) | 593 | FOR_EACH_FRAME (dummy, frame) |
| 594 | { | 594 | { |
| @@ -1137,8 +1137,8 @@ function, instead of the usual behavior. */) | |||
| 1137 | } | 1137 | } |
| 1138 | 1138 | ||
| 1139 | result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), | 1139 | result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), |
| 1140 | Qnil, require_match, Qnil, Qbuffer_name_history, | 1140 | Qnil, require_match, Qnil, |
| 1141 | def, Qnil); | 1141 | Qbuffer_name_history, def, Qnil); |
| 1142 | } | 1142 | } |
| 1143 | else | 1143 | else |
| 1144 | { | 1144 | { |
| @@ -1878,6 +1878,9 @@ the values STRING, PREDICATE and `lambda'. */) | |||
| 1878 | return Qt; | 1878 | return Qt; |
| 1879 | } | 1879 | } |
| 1880 | 1880 | ||
| 1881 | Lisp_Object Qmetadata; | ||
| 1882 | extern Lisp_Object Qbuffer; | ||
| 1883 | |||
| 1881 | DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0, | 1884 | DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0, |
| 1882 | doc: /* Perform completion on buffer names. | 1885 | doc: /* Perform completion on buffer names. |
| 1883 | If the argument FLAG is nil, invoke `try-completion', if it's t, invoke | 1886 | If the argument FLAG is nil, invoke `try-completion', if it's t, invoke |
| @@ -1912,8 +1915,12 @@ The arguments STRING and PREDICATE are as in `try-completion', | |||
| 1912 | return res; | 1915 | return res; |
| 1913 | } | 1916 | } |
| 1914 | } | 1917 | } |
| 1915 | else /* assume `lambda' */ | 1918 | else if (EQ (flag, Qlambda)) |
| 1916 | return Ftest_completion (string, Vbuffer_alist, predicate); | 1919 | return Ftest_completion (string, Vbuffer_alist, predicate); |
| 1920 | else if (EQ (flag, Qmetadata)) | ||
| 1921 | return Fcons (Qmetadata, Fcons (Fcons (Qcategory, Qbuffer), Qnil)); | ||
| 1922 | else | ||
| 1923 | return Qnil; | ||
| 1917 | } | 1924 | } |
| 1918 | 1925 | ||
| 1919 | /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ | 1926 | /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ |
| @@ -1989,66 +1996,38 @@ syms_of_minibuf (void) | |||
| 1989 | minibuf_save_list = Qnil; | 1996 | minibuf_save_list = Qnil; |
| 1990 | staticpro (&minibuf_save_list); | 1997 | staticpro (&minibuf_save_list); |
| 1991 | 1998 | ||
| 1992 | Qcompleting_read_default = intern_c_string ("completing-read-default"); | 1999 | DEFSYM (Qcompleting_read_default, "completing-read-default"); |
| 1993 | staticpro (&Qcompleting_read_default); | 2000 | DEFSYM (Qcompletion_ignore_case, "completion-ignore-case"); |
| 1994 | 2001 | DEFSYM (Qread_file_name_internal, "read-file-name-internal"); | |
| 1995 | Qcompletion_ignore_case = intern_c_string ("completion-ignore-case"); | 2002 | DEFSYM (Qminibuffer_default, "minibuffer-default"); |
| 1996 | staticpro (&Qcompletion_ignore_case); | ||
| 1997 | |||
| 1998 | Qread_file_name_internal = intern_c_string ("read-file-name-internal"); | ||
| 1999 | staticpro (&Qread_file_name_internal); | ||
| 2000 | |||
| 2001 | Qminibuffer_default = intern_c_string ("minibuffer-default"); | ||
| 2002 | staticpro (&Qminibuffer_default); | ||
| 2003 | Fset (Qminibuffer_default, Qnil); | 2003 | Fset (Qminibuffer_default, Qnil); |
| 2004 | 2004 | ||
| 2005 | Qminibuffer_completion_table = intern_c_string ("minibuffer-completion-table"); | 2005 | DEFSYM (Qminibuffer_completion_table, "minibuffer-completion-table"); |
| 2006 | staticpro (&Qminibuffer_completion_table); | 2006 | DEFSYM (Qminibuffer_completion_confirm, "minibuffer-completion-confirm"); |
| 2007 | 2007 | DEFSYM (Qminibuffer_completion_predicate, "minibuffer-completion-predicate"); | |
| 2008 | Qminibuffer_completion_confirm = intern_c_string ("minibuffer-completion-confirm"); | ||
| 2009 | staticpro (&Qminibuffer_completion_confirm); | ||
| 2010 | |||
| 2011 | Qminibuffer_completion_predicate = intern_c_string ("minibuffer-completion-predicate"); | ||
| 2012 | staticpro (&Qminibuffer_completion_predicate); | ||
| 2013 | 2008 | ||
| 2014 | staticpro (&last_minibuf_string); | 2009 | staticpro (&last_minibuf_string); |
| 2015 | last_minibuf_string = Qnil; | 2010 | last_minibuf_string = Qnil; |
| 2016 | 2011 | ||
| 2017 | Quser_variable_p = intern_c_string ("user-variable-p"); | 2012 | DEFSYM (Quser_variable_p, "user-variable-p"); |
| 2018 | staticpro (&Quser_variable_p); | 2013 | DEFSYM (Qminibuffer_history, "minibuffer-history"); |
| 2019 | 2014 | DEFSYM (Qbuffer_name_history, "buffer-name-history"); | |
| 2020 | Qminibuffer_history = intern_c_string ("minibuffer-history"); | ||
| 2021 | staticpro (&Qminibuffer_history); | ||
| 2022 | |||
| 2023 | Qbuffer_name_history = intern_c_string ("buffer-name-history"); | ||
| 2024 | staticpro (&Qbuffer_name_history); | ||
| 2025 | Fset (Qbuffer_name_history, Qnil); | 2015 | Fset (Qbuffer_name_history, Qnil); |
| 2026 | 2016 | ||
| 2027 | Qminibuffer_setup_hook = intern_c_string ("minibuffer-setup-hook"); | 2017 | DEFSYM (Qminibuffer_setup_hook, "minibuffer-setup-hook"); |
| 2028 | staticpro (&Qminibuffer_setup_hook); | 2018 | DEFSYM (Qminibuffer_exit_hook, "minibuffer-exit-hook"); |
| 2029 | 2019 | DEFSYM (Qhistory_length, "history-length"); | |
| 2030 | Qminibuffer_exit_hook = intern_c_string ("minibuffer-exit-hook"); | 2020 | DEFSYM (Qcurrent_input_method, "current-input-method"); |
| 2031 | staticpro (&Qminibuffer_exit_hook); | 2021 | DEFSYM (Qactivate_input_method, "activate-input-method"); |
| 2032 | 2022 | DEFSYM (Qcase_fold_search, "case-fold-search"); | |
| 2033 | Qhistory_length = intern_c_string ("history-length"); | 2023 | DEFSYM (Qmetadata, "metadata"); |
| 2034 | staticpro (&Qhistory_length); | ||
| 2035 | |||
| 2036 | Qcurrent_input_method = intern_c_string ("current-input-method"); | ||
| 2037 | staticpro (&Qcurrent_input_method); | ||
| 2038 | |||
| 2039 | Qactivate_input_method = intern_c_string ("activate-input-method"); | ||
| 2040 | staticpro (&Qactivate_input_method); | ||
| 2041 | |||
| 2042 | Qcase_fold_search = intern_c_string ("case-fold-search"); | ||
| 2043 | staticpro (&Qcase_fold_search); | ||
| 2044 | 2024 | ||
| 2045 | DEFVAR_LISP ("read-expression-history", Vread_expression_history, | 2025 | DEFVAR_LISP ("read-expression-history", Vread_expression_history, |
| 2046 | doc: /* A history list for arguments that are Lisp expressions to evaluate. | 2026 | doc: /* A history list for arguments that are Lisp expressions to evaluate. |
| 2047 | For example, `eval-expression' uses this. */); | 2027 | For example, `eval-expression' uses this. */); |
| 2048 | Vread_expression_history = Qnil; | 2028 | Vread_expression_history = Qnil; |
| 2049 | 2029 | ||
| 2050 | Qread_expression_history = intern_c_string ("read-expression-history"); | 2030 | DEFSYM (Qread_expression_history, "read-expression-history"); |
| 2051 | staticpro (&Qread_expression_history); | ||
| 2052 | 2031 | ||
| 2053 | DEFVAR_LISP ("read-buffer-function", Vread_buffer_function, | 2032 | DEFVAR_LISP ("read-buffer-function", Vread_buffer_function, |
| 2054 | doc: /* If this is non-nil, `read-buffer' does its work by calling this function. | 2033 | doc: /* If this is non-nil, `read-buffer' does its work by calling this function. |