aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorKenichi Handa2012-07-17 07:25:00 +0900
committerKenichi Handa2012-07-17 07:25:00 +0900
commit69c41c4070c86baac11a627e9c3d366420aeb7cc (patch)
treee07fda92570b5e4f264c9a7869b57960940008f0 /src/data.c
parent8c536f15bf95916d56bb50495d22b7da7e09fff9 (diff)
parent758e556a7ab8f61c007e34310ba399a9aaf15362 (diff)
downloademacs-69c41c4070c86baac11a627e9c3d366420aeb7cc.tar.gz
emacs-69c41c4070c86baac11a627e9c3d366420aeb7cc.zip
merge trunk
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/data.c b/src/data.c
index defcd06a2ed..4b342c0f521 100644
--- a/src/data.c
+++ b/src/data.c
@@ -517,7 +517,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
517 return newcdr; 517 return newcdr;
518} 518}
519 519
520/* Extract and set components of symbols */ 520/* Extract and set components of symbols. */
521 521
522DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, 522DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
523 doc: /* Return t if SYMBOL's value is not void. */) 523 doc: /* Return t if SYMBOL's value is not void. */)
@@ -637,8 +637,9 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
637 Fput (symbol, Qautoload, XCDR (function)); 637 Fput (symbol, Qautoload, XCDR (function));
638 638
639 XSYMBOL (symbol)->function = definition; 639 XSYMBOL (symbol)->function = definition;
640 /* Handle automatic advice activation */ 640 /* Handle automatic advice activation. */
641 if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info))) 641 if (CONSP (XSYMBOL (symbol)->plist)
642 && !NILP (Fget (symbol, Qad_advice_info)))
642 { 643 {
643 call2 (Qad_activate_internal, symbol, Qnil); 644 call2 (Qad_activate_internal, symbol, Qnil);
644 definition = XSYMBOL (symbol)->function; 645 definition = XSYMBOL (symbol)->function;
@@ -647,11 +648,12 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
647} 648}
648 649
649DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0, 650DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0,
650 doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION. 651 doc: /* Set SYMBOL's function definition to DEFINITION.
651Associates the function with the current load file, if any. 652Associates the function with the current load file, if any.
652The optional third argument DOCSTRING specifies the documentation string 653The optional third argument DOCSTRING specifies the documentation string
653for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string 654for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string
654determined by DEFINITION. */) 655determined by DEFINITION.
656The return value is undefined. */)
655 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) 657 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
656{ 658{
657 CHECK_SYMBOL (symbol); 659 CHECK_SYMBOL (symbol);
@@ -666,7 +668,10 @@ determined by DEFINITION. */)
666 LOADHIST_ATTACH (Fcons (Qdefun, symbol)); 668 LOADHIST_ATTACH (Fcons (Qdefun, symbol));
667 if (!NILP (docstring)) 669 if (!NILP (docstring))
668 Fput (symbol, Qfunction_documentation, docstring); 670 Fput (symbol, Qfunction_documentation, docstring);
669 return definition; 671 /* We used to return `definition', but now that `defun' and `defmacro' expand
672 to a call to `defalias', we return `symbol' for backward compatibility
673 (bug#11686). */
674 return symbol;
670} 675}
671 676
672DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, 677DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,
@@ -1458,8 +1463,7 @@ union Lisp_Val_Fwd
1458static struct Lisp_Buffer_Local_Value * 1463static struct Lisp_Buffer_Local_Value *
1459make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents) 1464make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents)
1460{ 1465{
1461 struct Lisp_Buffer_Local_Value *blv 1466 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv);
1462 = xmalloc (sizeof (struct Lisp_Buffer_Local_Value));
1463 Lisp_Object symbol; 1467 Lisp_Object symbol;
1464 Lisp_Object tem; 1468 Lisp_Object tem;
1465 1469
@@ -1500,7 +1504,7 @@ The function `default-value' gets the default value and `set-default' sets it.
1500{ 1504{
1501 struct Lisp_Symbol *sym; 1505 struct Lisp_Symbol *sym;
1502 struct Lisp_Buffer_Local_Value *blv = NULL; 1506 struct Lisp_Buffer_Local_Value *blv = NULL;
1503 union Lisp_Val_Fwd valcontents IF_LINT (= {0}); 1507 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO});
1504 int forwarded IF_LINT (= 0); 1508 int forwarded IF_LINT (= 0);
1505 1509
1506 CHECK_SYMBOL (variable); 1510 CHECK_SYMBOL (variable);
@@ -1577,7 +1581,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
1577{ 1581{
1578 register Lisp_Object tem; 1582 register Lisp_Object tem;
1579 int forwarded IF_LINT (= 0); 1583 int forwarded IF_LINT (= 0);
1580 union Lisp_Val_Fwd valcontents IF_LINT (= {0}); 1584 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO});
1581 struct Lisp_Symbol *sym; 1585 struct Lisp_Symbol *sym;
1582 struct Lisp_Buffer_Local_Value *blv = NULL; 1586 struct Lisp_Buffer_Local_Value *blv = NULL;
1583 1587
@@ -2129,7 +2133,7 @@ bool-vector. IDX starts at 0. */)
2129 { 2133 {
2130 if (idxval < 0 || idxval >= ASIZE (array)) 2134 if (idxval < 0 || idxval >= ASIZE (array))
2131 args_out_of_range (array, idx); 2135 args_out_of_range (array, idx);
2132 XVECTOR (array)->contents[idxval] = newelt; 2136 ASET (array, idxval, newelt);
2133 } 2137 }
2134 else if (BOOL_VECTOR_P (array)) 2138 else if (BOOL_VECTOR_P (array))
2135 { 2139 {
@@ -2444,20 +2448,17 @@ Uses a minus sign if negative.
2444NUMBER may be an integer or a floating point number. */) 2448NUMBER may be an integer or a floating point number. */)
2445 (Lisp_Object number) 2449 (Lisp_Object number)
2446{ 2450{
2447 char buffer[VALBITS]; 2451 char buffer[max (FLOAT_TO_STRING_BUFSIZE, INT_BUFSIZE_BOUND (EMACS_INT))];
2452 int len;
2448 2453
2449 CHECK_NUMBER_OR_FLOAT (number); 2454 CHECK_NUMBER_OR_FLOAT (number);
2450 2455
2451 if (FLOATP (number)) 2456 if (FLOATP (number))
2452 { 2457 len = float_to_string (buffer, XFLOAT_DATA (number));
2453 char pigbuf[FLOAT_TO_STRING_BUFSIZE]; 2458 else
2454 2459 len = sprintf (buffer, "%"pI"d", XINT (number));
2455 float_to_string (pigbuf, XFLOAT_DATA (number));
2456 return build_string (pigbuf);
2457 }
2458 2460
2459 sprintf (buffer, "%"pI"d", XINT (number)); 2461 return make_unibyte_string (buffer, len);
2460 return build_string (buffer);
2461} 2462}
2462 2463
2463DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0, 2464DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
@@ -3010,11 +3011,11 @@ syms_of_data (void)
3010 Fput (Qerror, Qerror_conditions, 3011 Fput (Qerror, Qerror_conditions,
3011 error_tail); 3012 error_tail);
3012 Fput (Qerror, Qerror_message, 3013 Fput (Qerror, Qerror_message,
3013 make_pure_c_string ("error")); 3014 build_pure_c_string ("error"));
3014 3015
3015#define PUT_ERROR(sym, tail, msg) \ 3016#define PUT_ERROR(sym, tail, msg) \
3016 Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \ 3017 Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \
3017 Fput (sym, Qerror_message, make_pure_c_string (msg)) 3018 Fput (sym, Qerror_message, build_pure_c_string (msg))
3018 3019
3019 PUT_ERROR (Qquit, Qnil, "Quit"); 3020 PUT_ERROR (Qquit, Qnil, "Quit");
3020 3021
@@ -3041,7 +3042,7 @@ syms_of_data (void)
3041 3042
3042 arith_tail = pure_cons (Qarith_error, error_tail); 3043 arith_tail = pure_cons (Qarith_error, error_tail);
3043 Fput (Qarith_error, Qerror_conditions, arith_tail); 3044 Fput (Qarith_error, Qerror_conditions, arith_tail);
3044 Fput (Qarith_error, Qerror_message, make_pure_c_string ("Arithmetic error")); 3045 Fput (Qarith_error, Qerror_message, build_pure_c_string ("Arithmetic error"));
3045 3046
3046 PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); 3047 PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer");
3047 PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); 3048 PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer");
@@ -3208,9 +3209,8 @@ syms_of_data (void)
3208} 3209}
3209 3210
3210#ifndef FORWARD_SIGNAL_TO_MAIN_THREAD 3211#ifndef FORWARD_SIGNAL_TO_MAIN_THREAD
3211static void arith_error (int) NO_RETURN; 3212_Noreturn
3212#endif 3213#endif
3213
3214static void 3214static void
3215arith_error (int signo) 3215arith_error (int signo)
3216{ 3216{