comparison src/buffer.c @ 91781:a6047ef14f4c

(clone_per_buffer_values, reset_buffer_local_variables) (Fbuffer_local_value, Fbuffer_local_variables): Don't forget undo_list.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 11 Feb 2008 17:56:13 +0000
parents 9f409926e851
children 4a11735d1bdb
comparison
equal deleted inserted replaced
91780:d097bc79fdfb 91781:a6047ef14f4c
494 Lisp_Object to_buffer; 494 Lisp_Object to_buffer;
495 int offset; 495 int offset;
496 496
497 XSETBUFFER (to_buffer, to); 497 XSETBUFFER (to_buffer, to);
498 498
499 for (offset = PER_BUFFER_VAR_OFFSET (name) + sizeof (Lisp_Object); 499 /* buffer-local Lisp variables start at `undo_list',
500 tho only the ones from `name' on are GC'd normally. */
501 for (offset = PER_BUFFER_VAR_OFFSET (undo_list) + sizeof (Lisp_Object);
500 offset < sizeof *to; 502 offset < sizeof *to;
501 offset += sizeof (Lisp_Object)) 503 offset += sizeof (Lisp_Object))
502 { 504 {
503 Lisp_Object obj; 505 Lisp_Object obj;
504 506
806 SET_PER_BUFFER_VALUE_P (b, i, 0); 808 SET_PER_BUFFER_VALUE_P (b, i, 0);
807 809
808 /* For each slot that has a default value, 810 /* For each slot that has a default value,
809 copy that into the slot. */ 811 copy that into the slot. */
810 812
811 for (offset = PER_BUFFER_VAR_OFFSET (name); 813 /* buffer-local Lisp variables start at `undo_list',
814 tho only the ones from `name' on are GC'd normally. */
815 for (offset = PER_BUFFER_VAR_OFFSET (undo_list);
812 offset < sizeof *b; 816 offset < sizeof *b;
813 offset += sizeof (Lisp_Object)) 817 offset += sizeof (Lisp_Object))
814 { 818 {
815 int idx = PER_BUFFER_IDX (offset); 819 int idx = PER_BUFFER_IDX (offset);
816 if ((idx > 0 820 if ((idx > 0
938 { 942 {
939 int offset, idx; 943 int offset, idx;
940 int found = 0; 944 int found = 0;
941 945
942 /* Look in special slots */ 946 /* Look in special slots */
943 for (offset = PER_BUFFER_VAR_OFFSET (name); 947 /* buffer-local Lisp variables start at `undo_list',
948 tho only the ones from `name' on are GC'd normally. */
949 for (offset = PER_BUFFER_VAR_OFFSET (undo_list);
944 offset < sizeof (struct buffer); 950 offset < sizeof (struct buffer);
945 /* sizeof EMACS_INT == sizeof Lisp_Object */ 951 /* sizeof EMACS_INT == sizeof Lisp_Object */
946 offset += (sizeof (EMACS_INT))) 952 offset += (sizeof (EMACS_INT)))
947 { 953 {
948 idx = PER_BUFFER_IDX (offset); 954 idx = PER_BUFFER_IDX (offset);
1049 1055
1050 /* Add on all the variables stored in special slots. */ 1056 /* Add on all the variables stored in special slots. */
1051 { 1057 {
1052 int offset, idx; 1058 int offset, idx;
1053 1059
1054 for (offset = PER_BUFFER_VAR_OFFSET (name); 1060 /* buffer-local Lisp variables start at `undo_list',
1061 tho only the ones from `name' on are GC'd normally. */
1062 for (offset = PER_BUFFER_VAR_OFFSET (undo_list);
1055 offset < sizeof (struct buffer); 1063 offset < sizeof (struct buffer);
1056 /* sizeof EMACS_INT == sizeof Lisp_Object */ 1064 /* sizeof EMACS_INT == sizeof Lisp_Object */
1057 offset += (sizeof (EMACS_INT))) 1065 offset += (sizeof (EMACS_INT)))
1058 { 1066 {
1059 idx = PER_BUFFER_IDX (offset); 1067 idx = PER_BUFFER_IDX (offset);