aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorYuan Fu2022-08-29 11:41:10 -0700
committerYuan Fu2022-08-29 11:41:10 -0700
commit77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273 (patch)
tree969937ec44ce5ddf9447b074aa15314e0b9e8e95 /src/data.c
parente98b4715bb986524bde9356b62429af9786ae716 (diff)
parentdf2f6fb7fc4b79834ae40db8be2ccdc1e4a273f1 (diff)
downloademacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.tar.gz
emacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.zip
Merge remote-tracking branch 'origin/master' into feature/tree-sitter
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/data.c b/src/data.c
index 2447ed72e4a..6921232665b 100644
--- a/src/data.c
+++ b/src/data.c
@@ -880,7 +880,7 @@ add_to_function_history (Lisp_Object symbol, Lisp_Object olddef)
880 if (NILP (XCDR (tail)) && STRINGP (XCAR (tail))) 880 if (NILP (XCDR (tail)) && STRINGP (XCAR (tail)))
881 file = XCAR (tail); 881 file = XCAR (tail);
882 882
883 Lisp_Object tem = Fplist_member (past, file); 883 Lisp_Object tem = plist_member (past, file);
884 if (!NILP (tem)) 884 if (!NILP (tem))
885 { /* New def from a file used before. 885 { /* New def from a file used before.
886 Overwrite the previous record associated with this file. */ 886 Overwrite the previous record associated with this file. */
@@ -1552,8 +1552,13 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
1552/* Find the value of a symbol, returning Qunbound if it's not bound. 1552/* Find the value of a symbol, returning Qunbound if it's not bound.
1553 This is helpful for code which just wants to get a variable's value 1553 This is helpful for code which just wants to get a variable's value
1554 if it has one, without signaling an error. 1554 if it has one, without signaling an error.
1555 Note that it must not be possible to quit 1555
1556 within this function. Great care is required for this. */ 1556 This function is very similar to buffer_local_value, but we have
1557 two separate code paths here since find_symbol_value has to be very
1558 efficient, while buffer_local_value doesn't have to be.
1559
1560 Note that it must not be possible to quit within this function.
1561 Great care is required for this. */
1557 1562
1558Lisp_Object 1563Lisp_Object
1559find_symbol_value (Lisp_Object symbol) 1564find_symbol_value (Lisp_Object symbol)
@@ -2336,7 +2341,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
2336 forwarded objects won't work right. */ 2341 forwarded objects won't work right. */
2337 { 2342 {
2338 Lisp_Object buf; XSETBUFFER (buf, current_buffer); 2343 Lisp_Object buf; XSETBUFFER (buf, current_buffer);
2339 if (EQ (buf, blv->where)) 2344 if (BASE_EQ (buf, blv->where))
2340 swap_in_global_binding (sym); 2345 swap_in_global_binding (sym);
2341 } 2346 }
2342 2347
@@ -3518,9 +3523,16 @@ representation. */)
3518} 3523}
3519 3524
3520DEFUN ("ash", Fash, Sash, 2, 2, 0, 3525DEFUN ("ash", Fash, Sash, 2, 2, 0,
3521 doc: /* Return VALUE with its bits shifted left by COUNT. 3526 doc: /* Return integer VALUE with its bits shifted left by COUNT bit positions.
3522If COUNT is negative, shifting is actually to the right. 3527If COUNT is negative, shift VALUE to the right instead.
3523In this case, the sign bit is duplicated. */) 3528VALUE and COUNT must be integers.
3529Mathematically, the return value is VALUE multiplied by 2 to the
3530power of COUNT, rounded down. If the result is non-zero, its sign
3531is the same as that of VALUE.
3532In terms of bits, when COUNT is positive, the function moves
3533the bits of VALUE to the left, adding zero bits on the right; when
3534COUNT is negative, it moves the bits of VALUE to the right,
3535discarding bits. */)
3524 (Lisp_Object value, Lisp_Object count) 3536 (Lisp_Object value, Lisp_Object count)
3525{ 3537{
3526 CHECK_INTEGER (value); 3538 CHECK_INTEGER (value);
@@ -3528,7 +3540,7 @@ In this case, the sign bit is duplicated. */)
3528 3540
3529 if (! FIXNUMP (count)) 3541 if (! FIXNUMP (count))
3530 { 3542 {
3531 if (EQ (value, make_fixnum (0))) 3543 if (BASE_EQ (value, make_fixnum (0)))
3532 return value; 3544 return value;
3533 if (mpz_sgn (*xbignum_val (count)) < 0) 3545 if (mpz_sgn (*xbignum_val (count)) < 0)
3534 { 3546 {
@@ -3573,11 +3585,11 @@ Lisp_Object
3573expt_integer (Lisp_Object x, Lisp_Object y) 3585expt_integer (Lisp_Object x, Lisp_Object y)
3574{ 3586{
3575 /* Special cases for -1 <= x <= 1, which never overflow. */ 3587 /* Special cases for -1 <= x <= 1, which never overflow. */
3576 if (EQ (x, make_fixnum (1))) 3588 if (BASE_EQ (x, make_fixnum (1)))
3577 return x; 3589 return x;
3578 if (EQ (x, make_fixnum (0))) 3590 if (BASE_EQ (x, make_fixnum (0)))
3579 return EQ (x, y) ? make_fixnum (1) : x; 3591 return BASE_EQ (x, y) ? make_fixnum (1) : x;
3580 if (EQ (x, make_fixnum (-1))) 3592 if (BASE_EQ (x, make_fixnum (-1)))
3581 return ((FIXNUMP (y) ? XFIXNUM (y) & 1 : mpz_odd_p (*xbignum_val (y))) 3593 return ((FIXNUMP (y) ? XFIXNUM (y) & 1 : mpz_odd_p (*xbignum_val (y)))
3582 ? x : make_fixnum (1)); 3594 ? x : make_fixnum (1));
3583 3595