diff options
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/keymap.c b/src/keymap.c index e22eb411f63..ca2d33dba47 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -3243,49 +3243,11 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, | |||
| 3243 | } | 3243 | } |
| 3244 | } | 3244 | } |
| 3245 | 3245 | ||
| 3246 | /* Apropos - finding all symbols whose names match a regexp. */ | ||
| 3247 | static Lisp_Object apropos_predicate; | ||
| 3248 | static Lisp_Object apropos_accumulate; | ||
| 3249 | |||
| 3250 | static void | ||
| 3251 | apropos_accum (Lisp_Object symbol, Lisp_Object string) | ||
| 3252 | { | ||
| 3253 | register Lisp_Object tem; | ||
| 3254 | |||
| 3255 | tem = Fstring_match (string, Fsymbol_name (symbol), Qnil); | ||
| 3256 | if (!NILP (tem) && !NILP (apropos_predicate)) | ||
| 3257 | tem = call1 (apropos_predicate, symbol); | ||
| 3258 | if (!NILP (tem)) | ||
| 3259 | apropos_accumulate = Fcons (symbol, apropos_accumulate); | ||
| 3260 | } | ||
| 3261 | |||
| 3262 | DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0, | ||
| 3263 | doc: /* Show all symbols whose names contain match for REGEXP. | ||
| 3264 | If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done | ||
| 3265 | for each symbol and a symbol is mentioned only if that returns non-nil. | ||
| 3266 | Return list of symbols found. */) | ||
| 3267 | (Lisp_Object regexp, Lisp_Object predicate) | ||
| 3268 | { | ||
| 3269 | Lisp_Object tem; | ||
| 3270 | CHECK_STRING (regexp); | ||
| 3271 | apropos_predicate = predicate; | ||
| 3272 | apropos_accumulate = Qnil; | ||
| 3273 | map_obarray (Vobarray, apropos_accum, regexp); | ||
| 3274 | tem = Fsort (apropos_accumulate, Qstring_lessp); | ||
| 3275 | apropos_accumulate = Qnil; | ||
| 3276 | apropos_predicate = Qnil; | ||
| 3277 | return tem; | ||
| 3278 | } | ||
| 3279 | |||
| 3280 | void | 3246 | void |
| 3281 | syms_of_keymap (void) | 3247 | syms_of_keymap (void) |
| 3282 | { | 3248 | { |
| 3283 | DEFSYM (Qkeymap, "keymap"); | 3249 | DEFSYM (Qkeymap, "keymap"); |
| 3284 | DEFSYM (Qdescribe_map_tree, "describe-map-tree"); | 3250 | DEFSYM (Qdescribe_map_tree, "describe-map-tree"); |
| 3285 | staticpro (&apropos_predicate); | ||
| 3286 | staticpro (&apropos_accumulate); | ||
| 3287 | apropos_predicate = Qnil; | ||
| 3288 | apropos_accumulate = Qnil; | ||
| 3289 | 3251 | ||
| 3290 | DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize"); | 3252 | DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize"); |
| 3291 | 3253 | ||
| @@ -3429,7 +3391,6 @@ be preferred. */); | |||
| 3429 | defsubr (&Stext_char_description); | 3391 | defsubr (&Stext_char_description); |
| 3430 | defsubr (&Swhere_is_internal); | 3392 | defsubr (&Swhere_is_internal); |
| 3431 | defsubr (&Sdescribe_buffer_bindings); | 3393 | defsubr (&Sdescribe_buffer_bindings); |
| 3432 | defsubr (&Sapropos_internal); | ||
| 3433 | } | 3394 | } |
| 3434 | 3395 | ||
| 3435 | void | 3396 | void |