aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2003-01-03 20:25:06 +0000
committerDave Love2003-01-03 20:25:06 +0000
commitddbe25cd99fc9bfb2ca2b5f05e0c946f7bf64432 (patch)
tree0817e61a612998b323a5b12f12e4b75a9f7bfea6
parent3d1fe88e7fb9283dde9926291550126ec8436fde (diff)
downloademacs-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.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/keymap.c22
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 @@
12003-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
12002-12-05 Kenichi Handa <handa@m17n.org> 92002-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
5This file is part of GNU Emacs. 5This 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. */
3269Lisp_Object apropos_predicate; 3269static Lisp_Object apropos_predicate;
3270Lisp_Object apropos_accumulate; 3270static Lisp_Object apropos_accumulate;
3271 3271
3272static void 3272static void
3273apropos_accum (symbol, string) 3273apropos_accum (symbol, string)
@@ -3283,22 +3283,24 @@ apropos_accum (symbol, string)
3283} 3283}
3284 3284
3285DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0, 3285DEFUN ("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.
3287If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done 3287If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done
3288for each symbol and a symbol is mentioned only if that returns non-nil. 3288for each symbol and a symbol is mentioned only if that returns non-nil.
3289Return list of symbols found. */) 3289Return 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
3304void 3306void
@@ -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);