diff options
| author | Dave Love | 2003-01-03 20:25:06 +0000 |
|---|---|---|
| committer | Dave Love | 2003-01-03 20:25:06 +0000 |
| commit | ddbe25cd99fc9bfb2ca2b5f05e0c946f7bf64432 (patch) | |
| tree | 0817e61a612998b323a5b12f12e4b75a9f7bfea6 /src/keymap.c | |
| parent | 3d1fe88e7fb9283dde9926291550126ec8436fde (diff) | |
| download | emacs-ddbe25cd99fc9bfb2ca2b5f05e0c946f7bf64432.tar.gz emacs-ddbe25cd99fc9bfb2ca2b5f05e0c946f7bf64432.zip | |
(apropos_predicate, apropos_accumulate): Declare
static.
(Fapropos_internal): Don't gcpro apropos_accumulate. Set result
to new local and nullify apropos_accumulate before returning.
(syms_of_keymap): Staticpro and initialize apropos_accumulate.
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/keymap.c b/src/keymap.c index e6bae09994e..3f636f103ac 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Manipulation of keymaps | 1 | /* Manipulation of keymaps |
| 2 | Copyright (C) 1985, 86,87,88,93,94,95,98,99, 2000, 2001 | 2 | Copyright (C) 1985, 86,87,88,93,94,95,98,99, 2000, 01, 02, 03 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -3266,8 +3266,8 @@ describe_vector (vector, elt_prefix, args, elt_describer, | |||
| 3266 | 3266 | ||
| 3267 | 3267 | ||
| 3268 | /* Apropos - finding all symbols whose names match a regexp. */ | 3268 | /* Apropos - finding all symbols whose names match a regexp. */ |
| 3269 | Lisp_Object apropos_predicate; | 3269 | static Lisp_Object apropos_predicate; |
| 3270 | Lisp_Object apropos_accumulate; | 3270 | static Lisp_Object apropos_accumulate; |
| 3271 | 3271 | ||
| 3272 | static void | 3272 | static void |
| 3273 | apropos_accum (symbol, string) | 3273 | apropos_accum (symbol, string) |
| @@ -3283,22 +3283,24 @@ apropos_accum (symbol, string) | |||
| 3283 | } | 3283 | } |
| 3284 | 3284 | ||
| 3285 | DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0, | 3285 | DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0, |
| 3286 | doc: /* Show all symbols whose names contain match for REGEXP. | 3286 | doc: /* Find all symbols whose names contain match for REGEXP. |
| 3287 | If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done | 3287 | If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done |
| 3288 | for each symbol and a symbol is mentioned only if that returns non-nil. | 3288 | for each symbol and a symbol is mentioned only if that returns non-nil. |
| 3289 | Return list of symbols found. */) | 3289 | Return list of symbols found. */) |
| 3290 | (regexp, predicate) | 3290 | (regexp, predicate) |
| 3291 | Lisp_Object regexp, predicate; | 3291 | Lisp_Object regexp, predicate; |
| 3292 | { | 3292 | { |
| 3293 | struct gcpro gcpro1, gcpro2; | 3293 | struct gcpro gcpro1; |
| 3294 | Lisp_Object result; | ||
| 3294 | CHECK_STRING (regexp); | 3295 | CHECK_STRING (regexp); |
| 3295 | apropos_predicate = predicate; | 3296 | apropos_predicate = predicate; |
| 3296 | GCPRO2 (apropos_predicate, apropos_accumulate); | 3297 | GCPRO1 (apropos_predicate); |
| 3297 | apropos_accumulate = Qnil; | 3298 | apropos_accumulate = Qnil; /* staticpro'd */ |
| 3298 | map_obarray (Vobarray, apropos_accum, regexp); | 3299 | map_obarray (Vobarray, apropos_accum, regexp); |
| 3299 | apropos_accumulate = Fsort (apropos_accumulate, Qstring_lessp); | 3300 | result = Fsort (apropos_accumulate, Qstring_lessp); |
| 3300 | UNGCPRO; | 3301 | UNGCPRO; |
| 3301 | return apropos_accumulate; | 3302 | apropos_accumulate = Qnil; /* Allow the result to be GCed. */ |
| 3303 | return result; | ||
| 3302 | } | 3304 | } |
| 3303 | 3305 | ||
| 3304 | void | 3306 | void |
| @@ -3432,6 +3434,8 @@ and applies even for keys that have ordinary bindings. */); | |||
| 3432 | where_is_cache = Qnil; | 3434 | where_is_cache = Qnil; |
| 3433 | staticpro (&where_is_cache); | 3435 | staticpro (&where_is_cache); |
| 3434 | staticpro (&where_is_cache_keymaps); | 3436 | staticpro (&where_is_cache_keymaps); |
| 3437 | apropos_accumulate = Qnil; | ||
| 3438 | staticpro (&apropos_accumulate); | ||
| 3435 | 3439 | ||
| 3436 | defsubr (&Skeymapp); | 3440 | defsubr (&Skeymapp); |
| 3437 | defsubr (&Skeymap_parent); | 3441 | defsubr (&Skeymap_parent); |