aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index ecd4b4b7ea7..82e050d2605 100644
--- a/src/data.c
+++ b/src/data.c
@@ -83,7 +83,7 @@ Lisp_Object Qtext_read_only;
83Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp; 83Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp;
84Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp; 84Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
85Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp; 85Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp;
86Lisp_Object Qbuffer_or_string_p; 86Lisp_Object Qbuffer_or_string_p, Qkeywordp;
87Lisp_Object Qboundp, Qfboundp; 87Lisp_Object Qboundp, Qfboundp;
88Lisp_Object Qchar_table_p, Qvector_or_char_table_p; 88Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
89 89
@@ -311,6 +311,22 @@ DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0,
311 return Qnil; 311 return Qnil;
312} 312}
313 313
314/* Define this in C to avoid unnecessarily consing up the symbol
315 name. */
316DEFUN ("keywordp", Fkeywordp, Skeywordp, 1, 1, 0,
317 "Return t if OBJECT is a keyword.\n\
318This means that it is a symbol with a print name beginning with `:'\n\
319interned in the initial obarray.")
320 (object)
321 Lisp_Object object;
322{
323 if (SYMBOLP (object)
324 && XSYMBOL (object)->name->data[0] == ':'
325 && EQ (XSYMBOL (object)->obarray, initial_obarray))
326 return Qt;
327 return Qnil;
328}
329
314DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0, 330DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0,
315 "Return t if OBJECT is a vector.") 331 "Return t if OBJECT is a vector.")
316 (object) 332 (object)
@@ -2593,6 +2609,7 @@ syms_of_data ()
2593 Qlistp = intern ("listp"); 2609 Qlistp = intern ("listp");
2594 Qconsp = intern ("consp"); 2610 Qconsp = intern ("consp");
2595 Qsymbolp = intern ("symbolp"); 2611 Qsymbolp = intern ("symbolp");
2612 Qkeywordp = intern ("keywordp");
2596 Qintegerp = intern ("integerp"); 2613 Qintegerp = intern ("integerp");
2597 Qnatnump = intern ("natnump"); 2614 Qnatnump = intern ("natnump");
2598 Qwholenump = intern ("wholenump"); 2615 Qwholenump = intern ("wholenump");
@@ -2790,6 +2807,7 @@ syms_of_data ()
2790 staticpro (&Qlistp); 2807 staticpro (&Qlistp);
2791 staticpro (&Qconsp); 2808 staticpro (&Qconsp);
2792 staticpro (&Qsymbolp); 2809 staticpro (&Qsymbolp);
2810 staticpro (&Qkeywordp);
2793 staticpro (&Qintegerp); 2811 staticpro (&Qintegerp);
2794 staticpro (&Qnatnump); 2812 staticpro (&Qnatnump);
2795 staticpro (&Qwholenump); 2813 staticpro (&Qwholenump);
@@ -2876,6 +2894,7 @@ A keyword symbol is a symbol whose name starts with a colon (`:').");
2876#endif /* LISP_FLOAT_TYPE */ 2894#endif /* LISP_FLOAT_TYPE */
2877 defsubr (&Snatnump); 2895 defsubr (&Snatnump);
2878 defsubr (&Ssymbolp); 2896 defsubr (&Ssymbolp);
2897 defsubr (&Skeywordp);
2879 defsubr (&Sstringp); 2898 defsubr (&Sstringp);
2880 defsubr (&Smultibyte_string_p); 2899 defsubr (&Smultibyte_string_p);
2881 defsubr (&Svectorp); 2900 defsubr (&Svectorp);