diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/keymap.c | 22 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 72eca5e106a..2ab6e72a898 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2003-01-03 Dave Love <fx@gnu.org> | ||
| 2 | |||
| 3 | * keymap.c (apropos_predicate, apropos_accumulate): Declare | ||
| 4 | static. | ||
| 5 | (Fapropos_internal): Don't gcpro apropos_accumulate. Set result | ||
| 6 | to new local and nullify apropos_accumulate before returning. | ||
| 7 | (syms_of_keymap): Staticpro and initialize apropos_accumulate. | ||
| 8 | |||
| 1 | 2002-12-05 Kenichi Handa <handa@m17n.org> | 9 | 2002-12-05 Kenichi Handa <handa@m17n.org> |
| 2 | 10 | ||
| 3 | * charset.c (Fdefine_charset_internal): Setup charset.fast_map | 11 | * charset.c (Fdefine_charset_internal): Setup charset.fast_map |
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); |