aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lread.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c
index 5aa7466cc12..8f355547268 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -5296,6 +5296,32 @@ OBARRAY defaults to the value of `obarray'. */)
5296 return Qnil; 5296 return Qnil;
5297} 5297}
5298 5298
5299DEFUN ("internal--obarray-buckets",
5300 Finternal__obarray_buckets, Sinternal__obarray_buckets, 1, 1, 0,
5301 doc: /* Symbols in each bucket of OBARRAY. Internal use only. */)
5302 (Lisp_Object obarray)
5303{
5304 obarray = check_obarray (obarray);
5305 ptrdiff_t size = ASIZE (obarray);
5306 Lisp_Object ret = Qnil;
5307 for (ptrdiff_t i = 0; i < size; i++)
5308 {
5309 Lisp_Object bucket = Qnil;
5310 Lisp_Object sym = AREF (obarray, i);
5311 if (BARE_SYMBOL_P (sym))
5312 while (1)
5313 {
5314 bucket = Fcons (sym, bucket);
5315 struct Lisp_Symbol *s = XBARE_SYMBOL(sym)->u.s.next;
5316 if (!s)
5317 break;
5318 sym = make_lisp_symbol (s);
5319 }
5320 ret = Fcons (Fnreverse (bucket), ret);
5321 }
5322 return Fnreverse (ret);
5323}
5324
5299#define OBARRAY_SIZE 15121 5325#define OBARRAY_SIZE 15121
5300 5326
5301void 5327void
@@ -5693,6 +5719,7 @@ syms_of_lread (void)
5693 defsubr (&Sget_file_char); 5719 defsubr (&Sget_file_char);
5694 defsubr (&Smapatoms); 5720 defsubr (&Smapatoms);
5695 defsubr (&Slocate_file_internal); 5721 defsubr (&Slocate_file_internal);
5722 defsubr (&Sinternal__obarray_buckets);
5696 5723
5697 DEFVAR_LISP ("obarray", Vobarray, 5724 DEFVAR_LISP ("obarray", Vobarray,
5698 doc: /* Symbol table for use by `intern' and `read'. 5725 doc: /* Symbol table for use by `intern' and `read'.