Index: src/buffer.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/buffer.c,v retrieving revision 1.36.2.35 diff -u -r1.36.2.35 buffer.c --- src/buffer.c 2000/07/21 10:15:45 1.36.2.35 +++ src/buffer.c 2000/07/31 15:58:31 @@ -1384,6 +1384,8 @@ XCDR (lynk) = f->buffer_alist; f->buffer_alist = lynk; + MARK_FRAME_CHANGED (f); + return Qnil; } Index: src/elhash.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/elhash.c,v retrieving revision 1.14.2.26 diff -u -r1.14.2.26 elhash.c --- src/elhash.c 2000/07/22 19:33:20 1.14.2.26 +++ src/elhash.c 2000/07/31 15:58:36 @@ -830,7 +830,7 @@ hash table if the value is pointed to by something other than a weak hash table, even if the key is not. -A key-value-weak hash table is similar to a fully-weak hash table except +A key-or-value-weak hash table is similar to a fully-weak hash table except that a key-value pair will be removed only if the value and the key remain unmarked outside of weak hash tables. The pair will remain in the hash table if the value or key are pointed to by something other than a weak Index: src/event-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/event-msw.c,v retrieving revision 1.38.2.54 diff -u -r1.38.2.54 event-msw.c --- src/event-msw.c 2000/07/21 10:16:02 1.38.2.54 +++ src/event-msw.c 2000/07/31 15:58:47 @@ -2023,6 +2023,11 @@ struct frame *frame; struct mswindows_frame* msframe; + /* Not perfect but avoids crashes. There is potential for wierd + behaviour here. */ + if (gc_in_progress) + goto defproc; + assert (!GetWindowLong (hwnd, GWL_USERDATA)); switch (message_) { Index: src/glyphs-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-msw.c,v retrieving revision 1.21.2.61 diff -u -r1.21.2.61 glyphs-msw.c --- src/glyphs-msw.c 2000/07/22 19:33:22 1.21.2.61 +++ src/glyphs-msw.c 2000/07/31 15:58:56 @@ -2918,40 +2918,23 @@ if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); - int i = 0, selected = 0, found = 0; - Lisp_Object rest, xrest; - - /* See whether we just need a change in order. */ - LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) - { - found = 0; - LIST_LOOP (xrest, - XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) - { - if (internal_equal (XCAR (rest), XCAR (xrest), 0)) - { - found = 1; - break; - } - } - if (!found) - break; - } - + int i = 0, selected = 0; + Lisp_Object rest; /* If only the order has changed then simply select the first one. This stops horrendous rebuilding of the tabs each time - you click on one. - - #### Ideally this should be generalized so that it isn't - duplicated both here and in glyphs-x.c. */ - if (found) + you click on one. */ + if (tab_control_order_only_changed (image_instance)) { LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) { - if (internal_equal + if (gui_item_equal_sans_selected (XCAR (rest), XCAR (XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))), 0)) { + XGUI_ITEM (XCAR (rest))->selected = + XGUI_ITEM + (XCAR (XCDR + (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))))->selected; SendMessage (wnd, TCM_SETCURSEL, i, 0); break; } @@ -3011,8 +2994,7 @@ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HWND wnd; Lisp_Object rest; - Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties), - Q_items, Qnil); + Lisp_Object items = find_keyword_in_vector (instantiator, Q_items); int len, height; /* Maybe ought to generalise this more but it may be very windows @@ -3026,7 +3008,7 @@ /* We now have everything right apart from the height. */ default_face_font_info (domain, 0, 0, &height, 0, 0); - GET_LIST_LENGTH (data, len); + GET_LIST_LENGTH (items, len); height = (height + WIDGET_BORDER_HEIGHT * 2 ) * len; IMAGE_INSTANCE_HEIGHT (ii) = height; @@ -3049,7 +3031,7 @@ wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* add items to the combo box */ SendMessage (wnd, CB_RESETCONTENT, 0, 0); - LIST_LOOP (rest, Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), Q_items, Qnil)) + LIST_LOOP (rest, items) { Extbyte* lparam; TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (rest), Index: src/glyphs-widget.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/glyphs-widget.c,v retrieving revision 1.1.2.47 diff -u -r1.1.2.47 glyphs-widget.c --- src/glyphs-widget.c 2000/07/25 11:04:26 1.1.2.47 +++ src/glyphs-widget.c 2000/07/31 15:59:00 @@ -168,7 +168,7 @@ } void -check_valid_item_list_1 (Lisp_Object items) +check_valid_item_list (Lisp_Object items) { Lisp_Object rest; @@ -180,24 +180,13 @@ else if (VECTORP (XCAR (rest))) gui_parse_item_keywords (XCAR (rest)); else if (LISTP (XCAR (rest))) - check_valid_item_list_1 (XCAR (rest)); + check_valid_item_list (XCAR (rest)); else signal_simple_error ("Items must be vectors, lists or strings", items); } } static void -check_valid_item_list (Lisp_Object data) -{ - Lisp_Object items; - - Fcheck_valid_plist (data); - items = Fplist_get (data, Q_items, Qnil); - - check_valid_item_list_1 (items); -} - -static void check_valid_instantiator_list (Lisp_Object data) { Lisp_Object rest; @@ -496,7 +485,7 @@ combo_box_validate (Lisp_Object instantiator) { widget_validate (instantiator); - if (NILP (find_keyword_in_vector (instantiator, Q_properties))) + if (NILP (find_keyword_in_vector (instantiator, Q_items))) signal_simple_error ("Must supply item list", instantiator); } @@ -561,7 +550,6 @@ Lisp_Object pixheight = find_keyword_in_vector (instantiator, Q_pixel_height); Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor); Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image); - Lisp_Object props = find_keyword_in_vector (instantiator, Q_properties); Lisp_Object items = find_keyword_in_vector (instantiator, Q_items); Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation); Lisp_Object mwidth = find_keyword_in_vector (instantiator, Q_margin_width); @@ -577,7 +565,6 @@ initialize_widget_image_instance (ii, XVECTOR_DATA (instantiator)[0]); IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET; - IMAGE_INSTANCE_WIDGET_PROPS (ii) = props; /* retrieve the fg and bg colors */ if (!NILP (face)) @@ -602,21 +589,12 @@ IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_VERTICAL; /* parse more gui items out of the properties */ - if (!NILP (props) - && - !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout) + if (!NILP (items) && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout) && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qnative_layout)) { - if (NILP (items)) - { - items = Fplist_get (props, Q_items, Qnil); - } - if (!NILP (items)) - { - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = - Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii), - parse_gui_item_tree_children (items)); - } + IMAGE_INSTANCE_WIDGET_ITEMS (ii) = + Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii), + parse_gui_item_tree_children (items)); } /* Normalize size information. We now only assign sizes if the user @@ -807,7 +785,7 @@ if (!NILP (items)) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); - check_valid_item_list_1 (items); + check_valid_item_list (items); /* Don't set the actual items since we might decide not to use the new ones (because nothing has really changed). If we did @@ -820,6 +798,40 @@ } } +/* Determine whether only the order has changed for a tab. */ +int tab_control_order_only_changed (Lisp_Object image_instance) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + int found = 0, len, pending_len; + Lisp_Object rest; + + /* See whether we just need a change in order. */ + GET_LIST_LENGTH (IMAGE_INSTANCE_WIDGET_ITEMS (ii), len); + GET_LIST_LENGTH (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii), + pending_len); + if (len == pending_len) + { + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) + { + Lisp_Object pending_rest; + found = 0; + LIST_LOOP (pending_rest, + XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) + { + if (gui_item_equal_sans_selected (XCAR (rest), + XCAR (pending_rest), 0)) + { + found = 1; + break; + } + } + if (!found) + break; + } + } + return found; +} + /* Set the properties of a progress guage */ static void progress_gauge_update (Lisp_Object image_instance, @@ -1013,45 +1025,6 @@ layout_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object domain) { -#if 0 - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object items = find_keyword_in_vector (instantiator, Q_items); - Lisp_Object rest, children = Qnil; - - if (GLYPHP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))) - { - /* We are going to be sneaky here and add the border text as - just another child, the layout and output routines don't know - this and will just display at the offsets we prescribe. */ - Lisp_Object gii = glyph_image_instance - (IMAGE_INSTANCE_LAYOUT_BORDER (ii), - image_instance, ERROR_ME, 1); - - if (!IMAGE_INSTANCEP (gii)) - return; - /* make sure we are designated as the parent. */ - XIMAGE_INSTANCE_PARENT (gii) = image_instance; - children = Fcons (gii, children); - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (0); - } - - /* Pick up the sub-widgets. */ - LIST_LOOP (rest, items) - { - /* make sure the image is instantiated */ - Lisp_Object gii = glyph_image_instance (XCAR (rest), - image_instance, ERROR_ME, 1); - if (!IMAGE_INSTANCEP (gii)) - return; - /* make sure we are designated as the parent. */ - XIMAGE_INSTANCE_PARENT (gii) = image_instance; - children = Fcons (gii, children); - } - /* Make sure elements in the layout are in the order the - user expected. */ - children = Fnreverse (children); - IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = children; -#endif } /* Layout widget. Sizing commentary: we have a number of problems that @@ -1468,7 +1441,7 @@ IIFORMAT_VALID_KEYWORD (combo_box, Q_height, check_valid_int); IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (combo_box, Q_face, check_valid_face); - IIFORMAT_VALID_KEYWORD (combo_box, Q_properties, check_valid_item_list); + IIFORMAT_VALID_KEYWORD (combo_box, Q_items, check_valid_item_list); } static void image_instantiator_scrollbar (void) @@ -1513,7 +1486,7 @@ IIFORMAT_HAS_METHOD (tree_view, query_geometry); VALID_WIDGET_KEYWORDS (tree_view); VALID_GUI_KEYWORDS (tree_view); - IIFORMAT_VALID_KEYWORD (tree_view, Q_properties, check_valid_item_list); + IIFORMAT_VALID_KEYWORD (tree_view, Q_items, check_valid_item_list); } static void image_instantiator_tab_control (void) @@ -1529,7 +1502,7 @@ VALID_WIDGET_KEYWORDS (tab_control); VALID_GUI_KEYWORDS (tab_control); IIFORMAT_VALID_KEYWORD (tab_control, Q_orientation, check_valid_tab_orientation); - IIFORMAT_VALID_KEYWORD (tab_control, Q_properties, check_valid_item_list); + IIFORMAT_VALID_KEYWORD (tab_control, Q_items, check_valid_item_list); } static void image_instantiator_labels (void) Index: src/glyphs-x.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-x.c,v retrieving revision 1.49.2.74 diff -u -r1.49.2.74 glyphs-x.c --- src/glyphs-x.c 2000/07/22 19:33:23 1.49.2.74 +++ src/glyphs-x.c 2000/07/31 15:59:08 @@ -2717,30 +2717,12 @@ if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { - int found = 0; - Lisp_Object rest, xrest; - - /* See whether we just need a change in order. */ - LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) - { - found = 0; - LIST_LOOP (xrest, - XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) - { - if (internal_equal (XCAR (rest), XCAR (xrest), 0)) - { - found = 1; - break; - } - } - if (!found) - break; - } + Lisp_Object rest; /* If only the order has changed then simply select the first one of the pending set. This stops horrendous rebuilding - and hence flicker - of the tabs each time you click on one. */ - if (found) + if (tab_control_order_only_changed (image_instance)) { widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); Index: src/glyphs.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.h,v retrieving revision 1.18.2.53 diff -u -r1.18.2.53 glyphs.h --- src/glyphs.h 2000/07/22 19:33:26 1.18.2.53 +++ src/glyphs.h 2000/07/31 15:59:11 @@ -989,6 +989,7 @@ void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain); +int tab_control_order_only_changed (Lisp_Object image_instance); Lisp_Object allocate_glyph (enum glyph_type type, void (*after_change) (Lisp_Object glyph, Lisp_Object property, Index: src/gui.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/gui.c,v retrieving revision 1.10.2.30 diff -u -r1.10.2.30 gui.c --- src/gui.c 2000/07/21 10:16:42 1.10.2.30 +++ src/gui.c 2000/07/31 15:59:13 @@ -544,8 +544,8 @@ return id; } -static int -gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +int +gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth) { Lisp_Gui_Item *p1 = XGUI_ITEM (obj1); Lisp_Gui_Item *p2 = XGUI_ITEM (obj2); @@ -568,13 +568,24 @@ && EQ (p1->style, p2->style) && - EQ (p1->selected, p2->selected) - && EQ (p1->accelerator, p2->accelerator) && EQ (p1->keys, p2->keys) && EQ (p1->value, p2->value))) + return 0; + return 1; +} + +static int +gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +{ + Lisp_Gui_Item *p1 = XGUI_ITEM (obj1); + Lisp_Gui_Item *p2 = XGUI_ITEM (obj2); + + if (!(gui_item_equal_sans_selected (obj1, obj2, depth) + && + EQ (p1->selected, p2->selected))) return 0; return 1; } Index: src/gui.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/gui.h,v retrieving revision 1.6.2.17 diff -u -r1.6.2.17 gui.h --- src/gui.h 2000/07/21 10:16:43 1.6.2.17 +++ src/gui.h 2000/07/31 15:59:13 @@ -29,6 +29,7 @@ int separator_string_p (const Bufbyte *s); void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *); +int gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth); extern int popup_up_p; Index: src/print.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/print.c,v retrieving revision 1.27.2.22 diff -u -r1.27.2.22 print.c --- src/print.c 2000/07/21 10:17:09 1.27.2.22 +++ src/print.c 2000/07/31 15:59:20 @@ -1657,7 +1657,7 @@ print_internal (debug_print_obj, Qexternal_debugging_output, 1); alternate_do_pointer = 0; print_internal (debug_print_obj, Qalternate_debugging_output, 1); -#ifdef HAVE_MS_WINDOWS +#ifdef WIN32_NATIVE /* Write out to the debugger, as well */ print_internal (debug_print_obj, Qmswindows_debugging_output, 1); #endif Index: lisp/gutter-items.el =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/Attic/gutter-items.el,v retrieving revision 1.1.2.52 diff -u -r1.1.2.52 gutter-items.el --- lisp/gutter-items.el 2000/07/22 19:33:36 1.1.2.52 +++ lisp/gutter-items.el 2000/07/31 15:59:24 @@ -332,9 +332,7 @@ (if (or (eq gutter-buffers-tab-orientation 'top) (eq gutter-buffers-tab-orientation 'bottom)) '(gutter-pixel-width) '(gutter-pixel-height)) - :properties - (list :items - (buffers-tab-items nil frame force-selection))) + :items (buffers-tab-items nil frame force-selection)) frame))))) ;; A myriad of different update hooks all doing slightly different things Index: man/lispref/hash-tables.texi =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/man/lispref/hash-tables.texi,v retrieving revision 1.1.1.1.4.2 diff -u -r1.1.1.1.4.2 hash-tables.texi --- man/lispref/hash-tables.texi 1999/09/03 04:55:11 1.1.1.1.4.2 +++ man/lispref/hash-tables.texi 2000/07/31 15:59:30 @@ -90,7 +90,7 @@ and specifies the load factor of the hash table which triggers enlarging. Keyword @code{:weakness} can be @code{nil} (default), @code{t}, -@code{key} or @code{value}. +@code{key}, @code{value}, @code{key-and-value} or @code{key-or-value}. A weak hash table is one whose pointers do not count as GC referents: for any key-value pair in the hash table, if the only remaining pointer @@ -110,6 +110,12 @@ unmarked outside of weak hash tables. The pair will remain in the hash table if the value is pointed to by something other than a weak hash table, even if the key is not. + +A key-or-value-weak hash table is similar to a fully-weak hash table except +that a key-value pair will be removed only if the value and the key remain +unmarked outside of weak hash tables. The pair will remain in the +hash table if the value or key are pointed to by something other than a weak +hash table, even if the other is not. @end defun @defun copy-hash-table hash-table @@ -204,7 +210,7 @@ (Otherwise, you'd have to explicitly map over the hash table every so often and remove unnecessary elements.) -There are three types of weak hash tables: +There are four types of weak hash tables: @table @asis @item fully weak hash tables @@ -216,6 +222,9 @@ @item value-weak hash tables In these hash tables, a pair disappears if the value is unreferenced outside of the table, regardless of how the key is referenced. +@item key-or-value weak hash tables +In these hash tables, a pair disappears if both the key and the value +are unreferenced outside of the table. @end table Also see @ref{Weak Lists}.