aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorKarl Heuer1995-01-31 00:52:50 +0000
committerKarl Heuer1995-01-31 00:52:50 +0000
commit7403b5c85eb1e38cb6354e4fb3ca5ae257b1759f (patch)
treec5983d30aa304632816ad3a07ecc6f2e629e46b5 /src/data.c
parent3826f22c3a74ad67c61225fe7163b3cb382df57a (diff)
downloademacs-7403b5c85eb1e38cb6354e4fb3ca5ae257b1759f.tar.gz
emacs-7403b5c85eb1e38cb6354e4fb3ca5ae257b1759f.zip
(do_symval_forwarding): Handle display-local vars.
(store_symval_forwarding, find_symbol_value): Likewise. (Fmake_variable_buffer_local): Disallow display-local vars here. (Fmake_local_variable): Likewise.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/src/data.c b/src/data.c
index 93e3811be4b..298c0b646db 100644
--- a/src/data.c
+++ b/src/data.c
@@ -642,6 +642,11 @@ do_symval_forwarding (valcontents)
642 case Lisp_Misc_Buffer_Objfwd: 642 case Lisp_Misc_Buffer_Objfwd:
643 offset = XBUFFER_OBJFWD (valcontents)->offset; 643 offset = XBUFFER_OBJFWD (valcontents)->offset;
644 return *(Lisp_Object *)(offset + (char *)current_buffer); 644 return *(Lisp_Object *)(offset + (char *)current_buffer);
645
646 case Lisp_Misc_Display_Objfwd:
647 offset = XDISPLAY_OBJFWD (valcontents)->offset;
648 return *(Lisp_Object *)(offset
649 + (char *)get_perdisplay (selected_frame));
645 } 650 }
646 return valcontents; 651 return valcontents;
647} 652}
@@ -685,8 +690,15 @@ store_symval_forwarding (sym, valcontents, newval)
685 buffer_slot_type_mismatch (offset); 690 buffer_slot_type_mismatch (offset);
686 691
687 *(Lisp_Object *)(offset + (char *)current_buffer) = newval; 692 *(Lisp_Object *)(offset + (char *)current_buffer) = newval;
688 break;
689 } 693 }
694 break;
695
696 case Lisp_Misc_Display_Objfwd:
697 (*(Lisp_Object *)((char *)get_perdisplay (selected_frame)
698 + XDISPLAY_OBJFWD (valcontents)->offset))
699 = newval;
700 break;
701
690 default: 702 default:
691 goto def; 703 goto def;
692 } 704 }
@@ -711,9 +723,9 @@ static Lisp_Object
711swap_in_symval_forwarding (sym, valcontents) 723swap_in_symval_forwarding (sym, valcontents)
712 Lisp_Object sym, valcontents; 724 Lisp_Object sym, valcontents;
713{ 725{
714 /* valcontents is a list 726 /* valcontents is a pointer to a struct resembling the cons
715 (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE)). 727 (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE)).
716 728
717 CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's 729 CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's
718 local_var_alist, that being the element whose car is this 730 local_var_alist, that being the element whose car is this
719 variable. Or it can be a pointer to the 731 variable. Or it can be a pointer to the
@@ -784,6 +796,10 @@ find_symbol_value (sym)
784 case Lisp_Misc_Buffer_Objfwd: 796 case Lisp_Misc_Buffer_Objfwd:
785 return *(Lisp_Object *)(XBUFFER_OBJFWD (valcontents)->offset 797 return *(Lisp_Object *)(XBUFFER_OBJFWD (valcontents)->offset
786 + (char *)current_buffer); 798 + (char *)current_buffer);
799
800 case Lisp_Misc_Display_Objfwd:
801 return *(Lisp_Object *)(XDISPLAY_OBJFWD (valcontents)->offset
802 + (char *)get_perdisplay (selected_frame));
787 } 803 }
788 } 804 }
789 805
@@ -1101,10 +1117,10 @@ The function `default-value' gets the default value and `set-default' sets it.")
1101 1117
1102 CHECK_SYMBOL (sym, 0); 1118 CHECK_SYMBOL (sym, 0);
1103 1119
1104 if (EQ (sym, Qnil) || EQ (sym, Qt)) 1120 valcontents = XSYMBOL (sym)->value;
1121 if (EQ (sym, Qnil) || EQ (sym, Qt) || DISPLAY_OBJFWDP (valcontents))
1105 error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data); 1122 error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data);
1106 1123
1107 valcontents = XSYMBOL (sym)->value;
1108 if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) 1124 if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
1109 return sym; 1125 return sym;
1110 if (SOME_BUFFER_LOCAL_VALUEP (valcontents)) 1126 if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
@@ -1144,14 +1160,14 @@ Use `make-local-hook' instead.")
1144 1160
1145 CHECK_SYMBOL (sym, 0); 1161 CHECK_SYMBOL (sym, 0);
1146 1162
1147 if (EQ (sym, Qnil) || EQ (sym, Qt)) 1163 valcontents = XSYMBOL (sym)->value;
1164 if (EQ (sym, Qnil) || EQ (sym, Qt) || DISPLAY_OBJFWDP (valcontents))
1148 error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data); 1165 error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data);
1149 1166
1150 valcontents = XSYMBOL (sym)->value;
1151 if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) 1167 if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
1152 { 1168 {
1153 tem = Fboundp (sym); 1169 tem = Fboundp (sym);
1154 1170
1155 /* Make sure the symbol has a local value in this particular buffer, 1171 /* Make sure the symbol has a local value in this particular buffer,
1156 by setting it to the same value it already has. */ 1172 by setting it to the same value it already has. */
1157 Fset (sym, (EQ (tem, Qt) ? Fsymbol_value (sym) : Qunbound)); 1173 Fset (sym, (EQ (tem, Qt) ? Fsymbol_value (sym) : Qunbound));
@@ -1576,7 +1592,7 @@ NUM may be an integer or a floating point number.")
1576 char pigbuf[350]; /* see comments in float_to_string */ 1592 char pigbuf[350]; /* see comments in float_to_string */
1577 1593
1578 float_to_string (pigbuf, XFLOAT(num)->data); 1594 float_to_string (pigbuf, XFLOAT(num)->data);
1579 return build_string (pigbuf); 1595 return build_string (pigbuf);
1580 } 1596 }
1581#endif /* LISP_FLOAT_TYPE */ 1597#endif /* LISP_FLOAT_TYPE */
1582 1598
@@ -1609,7 +1625,7 @@ It ignores leading spaces and tabs.")
1609 1625
1610 return make_number (atoi (p)); 1626 return make_number (atoi (p));
1611} 1627}
1612 1628
1613enum arithop 1629enum arithop
1614 { Aadd, Asub, Amult, Adiv, Alogand, Alogior, Alogxor, Amax, Amin }; 1630 { Aadd, Asub, Amult, Adiv, Alogand, Alogior, Alogxor, Amax, Amin };
1615 1631
@@ -1698,7 +1714,7 @@ float_arith_driver (accum, argnum, code, nargs, args)
1698{ 1714{
1699 register Lisp_Object val; 1715 register Lisp_Object val;
1700 double next; 1716 double next;
1701 1717
1702 for (; argnum < nargs; argnum++) 1718 for (; argnum < nargs; argnum++)
1703 { 1719 {
1704 val = args[argnum]; /* using args[argnum] as argument to CHECK_NUMBER_... */ 1720 val = args[argnum]; /* using args[argnum] as argument to CHECK_NUMBER_... */
@@ -1864,7 +1880,7 @@ Both X and Y must be numbers or markers.")
1864 1880
1865 if (i2 == 0) 1881 if (i2 == 0)
1866 Fsignal (Qarith_error, Qnil); 1882 Fsignal (Qarith_error, Qnil);
1867 1883
1868 i1 %= i2; 1884 i1 %= i2;
1869 1885
1870 /* If the "remainder" comes out with the wrong sign, fix it. */ 1886 /* If the "remainder" comes out with the wrong sign, fix it. */
@@ -2374,7 +2390,7 @@ init_data ()
2374 return; 2390 return;
2375#endif /* CANNOT_DUMP */ 2391#endif /* CANNOT_DUMP */
2376 signal (SIGFPE, arith_error); 2392 signal (SIGFPE, arith_error);
2377 2393
2378#ifdef uts 2394#ifdef uts
2379 signal (SIGEMT, arith_error); 2395 signal (SIGEMT, arith_error);
2380#endif /* uts */ 2396#endif /* uts */