aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/src/data.c b/src/data.c
index 92e1c75dee4..935c4348bb7 100644
--- a/src/data.c
+++ b/src/data.c
@@ -761,6 +761,19 @@ function with `&rest' args, or `unevalled' for a special form. */)
761 return Fcons (make_number (minargs), make_number (maxargs)); 761 return Fcons (make_number (minargs), make_number (maxargs));
762} 762}
763 763
764DEFUN ("subr-name", Fsubr_name, Ssubr_name, 1, 1, 0,
765 doc: /* Return name of subroutine SUBR.
766SUBR must be a built-in function. */)
767 (subr)
768 Lisp_Object subr;
769{
770 const char *name;
771 if (!SUBRP (subr))
772 wrong_type_argument (Qsubrp, subr);
773 name = XSUBR (subr)->symbol_name;
774 return make_string (name, strlen (name));
775}
776
764DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0, 777DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
765 doc: /* Return the interactive form of CMD or nil if none. 778 doc: /* Return the interactive form of CMD or nil if none.
766CMD must be a command. Value, if non-nil, is a list 779CMD must be a command. Value, if non-nil, is a list
@@ -1394,7 +1407,7 @@ local bindings in certain buffers. */)
1394} 1407}
1395 1408
1396DEFUN ("set-default", Fset_default, Sset_default, 2, 2, 0, 1409DEFUN ("set-default", Fset_default, Sset_default, 2, 2, 0,
1397 doc: /* Set SYMBOL's default value to VAL. SYMBOL and VAL are evaluated. 1410 doc: /* Set SYMBOL's default value to VALUE. SYMBOL and VALUE are evaluated.
1398The default value is seen in buffers that do not have their own values 1411The default value is seen in buffers that do not have their own values
1399for this variable. */) 1412for this variable. */)
1400 (symbol, value) 1413 (symbol, value)
@@ -1455,11 +1468,11 @@ The default value of a variable is seen in buffers
1455that do not have their own values for the variable. 1468that do not have their own values for the variable.
1456 1469
1457More generally, you can use multiple variables and values, as in 1470More generally, you can use multiple variables and values, as in
1458 (setq-default SYMBOL VALUE SYMBOL VALUE...) 1471 (setq-default VAR VALUE VAR VALUE...)
1459This sets each SYMBOL's default value to the corresponding VALUE. 1472This sets each VAR's default value to the corresponding VALUE.
1460The VALUE for the Nth SYMBOL can refer to the new default values 1473The VALUE for the Nth VAR can refer to the new default values
1461of previous SYMs. 1474of previous VARs.
1462usage: (setq-default SYMBOL VALUE [SYMBOL VALUE...]) */) 1475usage: (setq-default VAR VALUE [VAR VALUE...]) */)
1463 (args) 1476 (args)
1464 Lisp_Object args; 1477 Lisp_Object args;
1465{ 1478{
@@ -1946,8 +1959,8 @@ or a byte-code object. IDX starts at 0. */)
1946 if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size) 1959 if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size)
1947 args_out_of_range (array, idx); 1960 args_out_of_range (array, idx);
1948 1961
1949 val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR]; 1962 val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR];
1950 return (val & (1 << (idxval % BITS_PER_CHAR)) ? Qt : Qnil); 1963 return (val & (1 << (idxval % BOOL_VECTOR_BITS_PER_CHAR)) ? Qt : Qnil);
1951 } 1964 }
1952 else if (CHAR_TABLE_P (array)) 1965 else if (CHAR_TABLE_P (array))
1953 { 1966 {
@@ -2005,13 +2018,13 @@ bool-vector. IDX starts at 0. */)
2005 if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size) 2018 if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size)
2006 args_out_of_range (array, idx); 2019 args_out_of_range (array, idx);
2007 2020
2008 val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR]; 2021 val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR];
2009 2022
2010 if (! NILP (newelt)) 2023 if (! NILP (newelt))
2011 val |= 1 << (idxval % BITS_PER_CHAR); 2024 val |= 1 << (idxval % BOOL_VECTOR_BITS_PER_CHAR);
2012 else 2025 else
2013 val &= ~(1 << (idxval % BITS_PER_CHAR)); 2026 val &= ~(1 << (idxval % BOOL_VECTOR_BITS_PER_CHAR));
2014 XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR] = val; 2027 XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR] = val;
2015 } 2028 }
2016 else if (CHAR_TABLE_P (array)) 2029 else if (CHAR_TABLE_P (array))
2017 { 2030 {
@@ -2581,6 +2594,10 @@ usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */)
2581 int nargs; 2594 int nargs;
2582 Lisp_Object *args; 2595 Lisp_Object *args;
2583{ 2596{
2597 int argnum;
2598 for (argnum = 2; argnum < nargs; argnum++)
2599 if (FLOATP (args[argnum]))
2600 return float_arith_driver (0, 0, Adiv, nargs, args);
2584 return arith_driver (Adiv, nargs, args); 2601 return arith_driver (Adiv, nargs, args);
2585} 2602}
2586 2603
@@ -3215,6 +3232,7 @@ syms_of_data ()
3215 defsubr (&Slognot); 3232 defsubr (&Slognot);
3216 defsubr (&Sbyteorder); 3233 defsubr (&Sbyteorder);
3217 defsubr (&Ssubr_arity); 3234 defsubr (&Ssubr_arity);
3235 defsubr (&Ssubr_name);
3218 3236
3219 XSYMBOL (Qwholenump)->function = XSYMBOL (Qnatnump)->function; 3237 XSYMBOL (Qwholenump)->function = XSYMBOL (Qnatnump)->function;
3220 3238