From 2b7371e841478fd7b9bc7e4d9a515e0c26b9ed9a Mon Sep 17 00:00:00 2001 From: tomo Date: Tue, 14 Aug 2001 16:11:44 +0000 Subject: [PATCH] XEmacs 21.2.40 "Persephone". --- netinstall/ChangeLog | 8 +++- nt/ChangeLog | 4 ++ src/ChangeLog | 95 ++++++++++++++++++++++++++++++++++++++++ src/alloc.c | 18 +++----- src/elhash.c | 68 ++++++++++++++++++++++------- src/elhash.h | 10 ++++- src/event-Xt.c | 29 ++++++++++++- src/frame-x.c | 2 +- src/frame.c | 8 +++- src/glyphs-x.c | 10 ++++- src/glyphs.c | 118 ++++++++++++++++++++++++++++++++------------------ src/glyphs.h | 3 ++ src/menubar.c | 3 -- src/mule-ccl.c | 2 +- src/redisplay-x.c | 2 +- src/redisplay.h | 2 +- src/regex.c | 24 +++++----- src/window.c | 24 +++++----- tests/ChangeLog | 4 ++ 19 files changed, 326 insertions(+), 108 deletions(-) diff --git a/netinstall/ChangeLog b/netinstall/ChangeLog index 8e2dad2..45de799 100644 --- a/netinstall/ChangeLog +++ b/netinstall/ChangeLog @@ -1,3 +1,7 @@ +2001-01-08 Martin Buchholz + + * XEmacs 21.2.40 is released. + 2000-12-31 Martin Buchholz * XEmacs 21.2.39 is released. @@ -124,5 +128,5 @@ * all: port from cygwin setup. -%%% $Id: ChangeLog,v 1.1.2.4 2000/12/30 10:01:41 andyp Exp $ -$Revision: 1.1.2.4 $ +%%% $Id: ChangeLog,v 1.1.2.5 2000/12/31 12:03:34 martinb Exp $ +$Revision: 1.1.2.5 $ diff --git a/nt/ChangeLog b/nt/ChangeLog index ac50ab0..e68d20b 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2001-01-08 Martin Buchholz + + * XEmacs 21.2.40 is released. + 2000-12-31 Martin Buchholz * XEmacs 21.2.39 is released. diff --git a/src/ChangeLog b/src/ChangeLog index 572dfe2..cc565f8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,98 @@ +2001-01-08 Martin Buchholz + + * XEmacs 21.2.40 is released. + +2001-01-06 Golubev I. N. + + * regex.c: Replace PREFETCH with REGEX_PREFETCH. + +2001-01-06 Martin Buchholz + + * alloc.c (dbg_valmask): Make const. + * alloc.c (dbg_typemask): Make const. + * alloc.c (dbg_USE_UNION_TYPE): Make const. + * alloc.c (dbg_valbits): Make const. + * alloc.c (dbg_gctypebits): Make const. + +2001-01-06 Stephen J. Turnbull + + * redisplay-x.c (x_bevel_area): + redisplay.h (struct rune): + Typo fixes in comments. + +2001-01-05 Andy Piper + + * glyphs-x.c (x_redisplay_widget): use size changed for offset + adjustment. + + * menubar.c (menubar_visible_p_changed): don't mark frame changed. + +2001-01-05 Martin Buchholz + + * alloc.c (pure-bytes-used): Remove unused mendacious variable. + + * mule-ccl.c (stack_idx_of_map_multiple): + Non const global data must not be initialized! + Found by MIYASHITA Hisashi. + +2001-01-02 Andy Piper + + * frame.c (change_frame_size): make sure frame size is always + marked as changed. + + * glyphs.c (image_instance_layout): minor code reuse. + + * window.c (Fcurrent_window_configuration): revert previous + change. + +2001-01-02 Martin Buchholz + + * glyphs.h: + * glyphs.c (make_image_instance_cache_hash_table): Use ANSI prototypes. + +2000-12-31 Andy Piper + + * glyphs-x.c (x_unmap_subwindow): return focus to enclosing frame + when widget gets unmapped. + + * event-Xt.c (emacs_Xt_handle_widget_losing_focus): new + function. Make sure widgets losing focus don't just drop it. + (handle_focus_event_1): record the widget with focus. + +2000-12-31 Andy Piper + + * window.c (allocate_window): use + make_image_instance_cache_hash_table. + (make_dummy_parent): ditto. + (Fset_window_configuration): ditto. + + * glyphs.h (INSTANTIATOR_TYPE): new macro. declare new functions. + + * glyphs.c (process_image_string_instantiator): use + INSTANTIATOR_TYPE. + (get_image_instantiator_governing_domain): ditto. + (normalize_image_instantiator): ditto. + (instantiate_image_instantiator): ditto. + (make_image_instance_1): ditto. + (image_instantiate): ditto. Key on glyph *and* instantiator type. + (instantiator_eq_equal): new function for use with instance hash + tables. + (instantiator_eq_hash): ditto. + (make_image_instance_cache_hash_table): create a suitable hash + table for storing image instances. + + * elhash.h (hash_table_weakness): new internal weakness type + HASH_TABLE_KEY_CAR_VALUE_WEAK. + declare new functions. + + * elhash.c (finish_marking_weak_hash_tables): introduce yet + another weakness type for glyphs. + (make_standard_lisp_hash_table): new function split out from + make_general_lisp_hash_table. + (make_lisp_hash_table): call make_standard_lisp_hash_table. + (hash_table_instantiate): ditto. + (Fmake_hash_table): ditto. + 2000-12-31 Martin Buchholz * XEmacs 21.2.39 is released. diff --git a/src/alloc.c b/src/alloc.c index b069424..86f7861 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -448,17 +448,17 @@ disksave_object_finalization_1 (void) about expressions in src/.gdbinit. See src/.gdbinit or src/.dbxrc to see how this is used. */ -EMACS_UINT dbg_valmask = ((1UL << VALBITS) - 1) << GCBITS; -EMACS_UINT dbg_typemask = (1UL << GCTYPEBITS) - 1; +const EMACS_UINT dbg_valmask = ((1UL << VALBITS) - 1) << GCBITS; +const EMACS_UINT dbg_typemask = (1UL << GCTYPEBITS) - 1; #ifdef USE_UNION_TYPE -unsigned char dbg_USE_UNION_TYPE = 1; +const unsigned char dbg_USE_UNION_TYPE = 1; #else -unsigned char dbg_USE_UNION_TYPE = 0; +const unsigned char dbg_USE_UNION_TYPE = 0; #endif -unsigned char dbg_valbits = VALBITS; -unsigned char dbg_gctypebits = GCTYPEBITS; +const unsigned char dbg_valbits = VALBITS; +const unsigned char dbg_gctypebits = GCTYPEBITS; /* Macros turned into functions for ease of debugging. Debuggers don't know about macros! */ @@ -3944,8 +3944,6 @@ init_alloc_once_early (void) staticidx = 0; } -int pure_bytes_used = 0; - void reinit_alloc (void) { @@ -3997,10 +3995,6 @@ prevent garbage collection during a part of the program. See also `consing-since-gc'. */ ); - DEFVAR_INT ("pure-bytes-used", &pure_bytes_used /* -Number of bytes of sharable Lisp data allocated so far. -*/ ); - #ifdef DEBUG_XEMACS DEFVAR_INT ("debug-allocation", &debug_allocation /* If non-zero, print out information to stderr about all objects allocated. diff --git a/src/elhash.c b/src/elhash.c index 2fb2c04..058fdd4 100644 --- a/src/elhash.c +++ b/src/elhash.c @@ -434,36 +434,54 @@ compute_hash_table_derived_values (Lisp_Hash_Table *ht) } Lisp_Object -make_general_lisp_hash_table (enum hash_table_test test, - size_t size, - double rehash_size, - double rehash_threshold, - enum hash_table_weakness weakness) +make_standard_lisp_hash_table (enum hash_table_test test, + size_t size, + double rehash_size, + double rehash_threshold, + enum hash_table_weakness weakness) { - Lisp_Object hash_table; - Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table); + hash_table_hash_function_t hash_function = 0; + hash_table_test_function_t test_function = 0; switch (test) { case HASH_TABLE_EQ: - ht->test_function = 0; - ht->hash_function = 0; + test_function = 0; + hash_function = 0; break; case HASH_TABLE_EQL: - ht->test_function = lisp_object_eql_equal; - ht->hash_function = lisp_object_eql_hash; + test_function = lisp_object_eql_equal; + hash_function = lisp_object_eql_hash; break; case HASH_TABLE_EQUAL: - ht->test_function = lisp_object_equal_equal; - ht->hash_function = lisp_object_equal_hash; + test_function = lisp_object_equal_equal; + hash_function = lisp_object_equal_hash; break; default: abort (); } + return make_general_lisp_hash_table (hash_function, test_function, + size, rehash_size, rehash_threshold, + weakness); +} + +Lisp_Object +make_general_lisp_hash_table (hash_table_hash_function_t hash_function, + hash_table_test_function_t test_function, + size_t size, + double rehash_size, + double rehash_threshold, + enum hash_table_weakness weakness) +{ + Lisp_Object hash_table; + Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table); + + ht->test_function = test_function; + ht->hash_function = hash_function; ht->weakness = weakness; ht->rehash_size = @@ -505,7 +523,7 @@ make_lisp_hash_table (size_t size, enum hash_table_weakness weakness, enum hash_table_test test) { - return make_general_lisp_hash_table (test, size, -1.0, -1.0, weakness); + return make_standard_lisp_hash_table (test, size, -1.0, -1.0, weakness); } /* Pretty reading of hash tables. @@ -722,7 +740,7 @@ hash_table_instantiate (Lisp_Object plist) } /* Create the hash table. */ - hash_table = make_general_lisp_hash_table + hash_table = make_standard_lisp_hash_table (decode_hash_table_test (test), decode_hash_table_size (size), decode_hash_table_rehash_size (rehash_size), @@ -872,7 +890,7 @@ if (!NILP (var)) hash_table_##var##_validate (Q##var, var, ERROR_ME); VALIDATE_VAR (rehash_threshold); VALIDATE_VAR (weakness); - return make_general_lisp_hash_table + return make_standard_lisp_hash_table (decode_hash_table_test (test), decode_hash_table_size (size), decode_hash_table_rehash_size (rehash_size), @@ -1305,6 +1323,24 @@ finish_marking_weak_hash_tables (void) } break; + /* We seem to be sprouting new weakness types at an alarming + rate. At least this is not externally visible - and in + fact all of these KEY_CAR_* types are only used by the + glyph code. */ + case HASH_TABLE_KEY_CAR_VALUE_WEAK: + for (; e < sentinel; e++) + if (!HENTRY_CLEAR_P (e)) + { + if (!CONSP (e->key) || marked_p (XCAR (e->key))) + { + MARK_OBJ (e->key); + MARK_OBJ (e->value); + } + else if (marked_p (e->value)) + MARK_OBJ (e->key); + } + break; + case HASH_TABLE_VALUE_CAR_WEAK: for (; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) diff --git a/src/elhash.h b/src/elhash.h index 04c1d03..7c4fe9c 100644 --- a/src/elhash.h +++ b/src/elhash.h @@ -41,6 +41,7 @@ enum hash_table_weakness HASH_TABLE_KEY_VALUE_WEAK, HASH_TABLE_KEY_CAR_WEAK, HASH_TABLE_VALUE_CAR_WEAK, + HASH_TABLE_KEY_CAR_VALUE_WEAK, HASH_TABLE_WEAK }; @@ -66,7 +67,14 @@ typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj); typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value, void* extra_arg); -Lisp_Object make_general_lisp_hash_table (enum hash_table_test test, +Lisp_Object make_standard_lisp_hash_table (enum hash_table_test test, + size_t size, + double rehash_size, + double rehash_threshold, + enum hash_table_weakness weakness); + +Lisp_Object make_general_lisp_hash_table (hash_table_hash_function_t hash_function, + hash_table_test_function_t test_function, size_t size, double rehash_size, double rehash_threshold, diff --git a/src/event-Xt.c b/src/event-Xt.c index b9ef392..ae62194 100644 --- a/src/event-Xt.c +++ b/src/event-Xt.c @@ -92,6 +92,7 @@ int debug_x_events; static int process_events_occurred; static int tty_events_occurred; +static Widget widget_with_focus; /* Mask of bits indicating the descriptors that we wait for input on */ extern SELECT_TYPE input_wait_mask, process_only_mask, tty_only_mask; @@ -1536,11 +1537,12 @@ static void handle_focus_event_1 (struct frame *f, int in_p) { #if XtSpecificationRelease > 5 - Widget focus_widget = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f)); + widget_with_focus = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f)); #endif #ifdef HAVE_XIM XIM_focus_event (f, in_p); #endif /* HAVE_XIM */ + /* On focus change, clear all memory of sticky modifiers to avoid non-intuitive behavior. */ clear_sticky_modifiers (XDEVICE (FRAME_DEVICE (f))); @@ -1564,13 +1566,19 @@ handle_focus_event_1 (struct frame *f, int in_p) click in the frame. Why is this? */ if (in_p #if XtSpecificationRelease > 5 - && FRAME_X_TEXT_WIDGET (f) != focus_widget + && FRAME_X_TEXT_WIDGET (f) != widget_with_focus #endif ) { lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), FRAME_X_TEXT_WIDGET (f)); } + + /* We have the focus now. See comment in + emacs_Xt_handle_widget_losing_focus (). */ + if (in_p) + widget_with_focus = NULL; + /* do the generic event-stream stuff. */ { Lisp_Object frm; @@ -1587,6 +1595,23 @@ handle_focus_event_1 (struct frame *f, int in_p) } } +/* The idea here is that when a widget glyph gets unmapped we don't + want the focus to stay with it if it has focus - because it may + well just get deleted next andthen we have lost the focus until the + user does something. So handle_focus_event_1 records the widget + with keyboard focus when FocusOut is processed, and then, when a + widget gets unmapped, it calls this function to restore focus if + appropriate. */ +void emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget); +void +emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget) +{ + if (losing_widget == widget_with_focus) + { + handle_focus_event_1 (f, 1); + } +} + /* This is called from the external-widget code */ void emacs_Xt_handle_focus_event (XEvent *event); diff --git a/src/frame-x.c b/src/frame-x.c index dbd70cb..23ef070 100644 --- a/src/frame-x.c +++ b/src/frame-x.c @@ -2654,7 +2654,7 @@ x_focus_on_frame (struct frame *f) XFlush (XtDisplay (shell_widget)); /* hey, I'd like to DEBUG this... */ } -/* Destroy the X window of frame S. */ +/* Destroy the X window of frame F. */ static void x_delete_frame (struct frame *f) { diff --git a/src/frame.c b/src/frame.c index 37ef75a..ba8f379 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3007,9 +3007,15 @@ change_frame_size (struct frame *f, int newheight, int newwidth, int delay) So deal. */ check_frame_size (f, &newheight, &newwidth); + /* Unconditionally mark that the frame has changed size. This is + because many things need to know after the + fact. f->size_change_pending will get reset below. The most that + can happen is that we will cycle through redisplay once more + --andy. */ + MARK_FRAME_SIZE_CHANGED (f); + if (delay || in_display || gc_in_progress) { - MARK_FRAME_SIZE_CHANGED (f); f->new_width = newwidth; f->new_height = newheight; return; diff --git a/src/glyphs-x.c b/src/glyphs-x.c index e0fa2d2..0451996 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -156,6 +156,8 @@ static void update_tab_widget_face (widget_value* wv, Lisp_Image_Instance* ii, Lisp_Object domain); #endif +void +emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget); #include "bitmaps.h" @@ -2130,6 +2132,12 @@ x_unmap_subwindow (Lisp_Image_Instance *p) } else /* must be a widget */ { + /* Since we are being unmapped we want the enclosing frame to + get focus. The losing with simple scrolling but is the safest + thing to do. */ + emacs_Xt_handle_widget_losing_focus + ( XFRAME (IMAGE_INSTANCE_FRAME (p)), + IMAGE_INSTANCE_X_WIDGET_ID (p)); XtUnmapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); } } @@ -2261,7 +2269,7 @@ x_redisplay_widget (Lisp_Image_Instance *p) } /* Adjust offsets within the frame. */ - if (XFRAME (IMAGE_INSTANCE_FRAME (p))->frame_changed) + if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed) { Arg al[2]; XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p)); diff --git a/src/glyphs.c b/src/glyphs.c index 6c5c03e..e8f0d9b 100644 --- a/src/glyphs.c +++ b/src/glyphs.c @@ -382,7 +382,7 @@ process_image_string_instantiator (Lisp_Object data, skip it. */ if (!(dest_mask & IIFORMAT_METH (decode_image_instantiator_format - (XVECTOR_DATA (typevec)[0], ERROR_ME), + (INSTANTIATOR_TYPE (typevec), ERROR_ME), possible_dest_types, ()))) continue; if (fast_string_match (exp, 0, data, 0, -1, 0, ERROR_ME, 0) >= 0) @@ -689,7 +689,7 @@ get_image_instantiator_governing_domain (Lisp_Object instantiator, int governing_domain; struct image_instantiator_methods *meths = - decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], + decode_image_instantiator_format (INSTANTIATOR_TYPE (instantiator), ERROR_ME); governing_domain = IIFORMAT_METH_OR_GIVEN (meths, governing_domain, (), GOVERNING_DOMAIN_DEVICE); @@ -742,7 +742,7 @@ normalize_image_instantiator (Lisp_Object instantiator, GCPRO1 (instantiator); - meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], + meths = decode_image_instantiator_format (INSTANTIATOR_TYPE (instantiator), ERROR_ME); RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize, (instantiator, contype, dest_mask), @@ -765,20 +765,20 @@ instantiate_image_instantiator (Lisp_Object governing_domain, struct gcpro gcpro1; GCPRO1 (ii); - if (!valid_image_instantiator_format_p (XVECTOR_DATA (instantiator)[0], + if (!valid_image_instantiator_format_p (INSTANTIATOR_TYPE (instantiator), DOMAIN_DEVICE (governing_domain))) signal_simple_error ("Image instantiator format is invalid in this locale.", instantiator); - meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], + meths = decode_image_instantiator_format (INSTANTIATOR_TYPE (instantiator), ERROR_ME); MAYBE_IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, pointer_bg, dest_mask, domain)); /* Now do device specific instantiation. */ device_meths = decode_device_ii_format (DOMAIN_DEVICE (governing_domain), - XVECTOR_DATA (instantiator)[0], + INSTANTIATOR_TYPE (instantiator), ERROR_ME_NOT); if (!HAS_IIFORMAT_METH_P (meths, instantiate) @@ -1469,7 +1469,7 @@ make_image_instance_1 (Lisp_Object data, Lisp_Object domain, GCPRO1 (data); /* After normalizing the data, it's always either an image instance (which we filtered out above) or a vector. */ - if (EQ (XVECTOR_DATA (data)[0], Qinherit)) + if (EQ (INSTANTIATOR_TYPE (data), Qinherit)) signal_simple_error ("Inheritance not allowed here", data); governing_domain = get_image_instantiator_governing_domain (data, domain); @@ -1992,9 +1992,6 @@ image_instance_layout (Lisp_Object image_instance, assert (XIMAGE_INSTANCE_YOFFSET (image_instance) >= 0 && XIMAGE_INSTANCE_XOFFSET (image_instance) >= 0); - type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); - meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); - /* If geometry is unspecified then get some reasonable values for it. */ if (width == IMAGE_UNSPECIFIED_GEOMETRY || @@ -2002,20 +1999,11 @@ image_instance_layout (Lisp_Object image_instance, { int dwidth = IMAGE_UNSPECIFIED_GEOMETRY; int dheight = IMAGE_UNSPECIFIED_GEOMETRY; - /* Get the desired geometry. */ - if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry)) - { - IIFORMAT_METH (meths, query_geometry, (image_instance, &dwidth, &dheight, - IMAGE_DESIRED_GEOMETRY, - domain)); - } - else - { - dwidth = IMAGE_INSTANCE_WIDTH (ii); - dheight = IMAGE_INSTANCE_HEIGHT (ii); - } - + image_instance_query_geometry (image_instance, + &dwidth, &dheight, + IMAGE_DESIRED_GEOMETRY, + domain); /* Compare with allowed geometry. */ if (width == IMAGE_UNSPECIFIED_GEOMETRY) width = dwidth; @@ -2042,12 +2030,15 @@ image_instance_layout (Lisp_Object image_instance, IMAGE_INSTANCE_WIDTH (ii) = width; IMAGE_INSTANCE_HEIGHT (ii) = height; - if (IIFORMAT_METH_OR_GIVEN (meths, layout, - (image_instance, width, height, xoffset, yoffset, - domain), 1)) - /* Do not clear the dirty flag here - redisplay will do this for - us at the end. */ - IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0; + type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); + meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); + + MAYBE_IIFORMAT_METH (meths, layout, + (image_instance, width, height, xoffset, yoffset, + domain)); + /* Do not clear the dirty flag here - redisplay will do this for + us at the end. */ + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0; } /* Update an image instance from its changed instantiator. */ @@ -3054,6 +3045,44 @@ image_mark (Lisp_Object obj) mark_object (IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image)); } +static int +instantiator_eq_equal (Lisp_Object obj1, Lisp_Object obj2) +{ + if (EQ (obj1, obj2)) + return 1; + + else if (CONSP (obj1) && CONSP (obj2)) + { + return instantiator_eq_equal (XCAR (obj1), XCAR (obj2)) + && + instantiator_eq_equal (XCDR (obj1), XCDR (obj2)); + } + return 0; +} + +static hashcode_t +instantiator_eq_hash (Lisp_Object obj) +{ + if (CONSP (obj)) + { + /* no point in worrying about tail recursion, since we're not + going very deep */ + return HASH2 (instantiator_eq_hash (XCAR (obj)), + instantiator_eq_hash (XCDR (obj))); + } + return LISP_HASH (obj); +} + +/* We need a special hash table for storing image instances. */ +Lisp_Object +make_image_instance_cache_hash_table (void) +{ + return make_general_lisp_hash_table + (instantiator_eq_hash, instantiator_eq_equal, + 30, -1.0, -1.0, + HASH_TABLE_KEY_CAR_VALUE_WEAK); +} + static Lisp_Object image_instantiate_cache_result (Lisp_Object locative) { @@ -3110,7 +3139,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, instantiator, domain); } else if (VECTORP (instantiator) - && EQ (XVECTOR_DATA (instantiator)[0], Qinherit)) + && EQ (INSTANTIATOR_TYPE (instantiator), Qinherit)) { assert (XVECTOR_LENGTH (instantiator) == 3); return (FACE_PROPERTY_INSTANCE @@ -3121,7 +3150,8 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, { Lisp_Object instance = Qnil; Lisp_Object subtable = Qnil; - Lisp_Object ls3 = Qnil; + /* #### Should this be GCPRO'd? */ + Lisp_Object hash_key = Qnil; Lisp_Object pointer_fg = Qnil; Lisp_Object pointer_bg = Qnil; Lisp_Object governing_domain = @@ -3139,8 +3169,15 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, { pointer_fg = FACE_FOREGROUND (Vpointer_face, domain); pointer_bg = FACE_BACKGROUND (Vpointer_face, domain); - ls3 = list3 (glyph, pointer_fg, pointer_bg); + hash_key = list4 (glyph, INSTANTIATOR_TYPE (instantiator), + pointer_fg, pointer_bg); } + else + /* We cannot simply key on the glyph since fallbacks could use + the same glyph but have a totally different instantiator + type. Thus we key on the glyph and the type (but not any + other parts of the instantiator. */ + hash_key = list2 (glyph, INSTANTIATOR_TYPE (instantiator)); /* First look in the device cache. */ if (DEVICEP (governing_domain)) @@ -3167,20 +3204,15 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, have to use EQUAL because we massaged the instantiator into a cons3 also containing the foreground and background of the pointer face. */ + subtable = make_image_instance_cache_hash_table (); - subtable = make_lisp_hash_table - (20, pointerp ? HASH_TABLE_KEY_CAR_WEAK - : HASH_TABLE_KEY_WEAK, - pointerp ? HASH_TABLE_EQUAL - : HASH_TABLE_EQ); Fputhash (make_int (dest_mask), subtable, XDEVICE (governing_domain)->image_instance_cache); instance = Qunbound; } else { - instance = Fgethash (pointerp ? ls3 : glyph, - subtable, Qunbound); + instance = Fgethash (hash_key, subtable, Qunbound); } } else if (WINDOWP (governing_domain)) @@ -3188,7 +3220,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, /* Subwindows have a per-window cache and have to be treated differently. */ instance = - Fgethash (pointerp ? ls3 : glyph, + Fgethash (hash_key, XWINDOW (governing_domain)->subwindow_instance_cache, Qunbound); } @@ -3201,7 +3233,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, { Lisp_Object locative = noseeum_cons (Qnil, - noseeum_cons (pointerp ? ls3 : glyph, + noseeum_cons (hash_key, DEVICEP (governing_domain) ? subtable : XWINDOW (governing_domain) ->subwindow_instance_cache)); @@ -3234,7 +3266,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, #ifdef ERROR_CHECK_GLYPHS if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) - assert (EQ (Fgethash ((pointerp ? ls3 : glyph), + assert (EQ (Fgethash (hash_key, XWINDOW (governing_domain) ->subwindow_instance_cache, Qunbound), instance)); @@ -3258,7 +3290,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, possible to make changes that don't get reflected in the display. */ update_image_instance (instance, instantiator); - free_list (ls3); + free_list (hash_key); } #ifdef ERROR_CHECK_GLYPHS diff --git a/src/glyphs.h b/src/glyphs.h index 056cc23..c279f54 100644 --- a/src/glyphs.h +++ b/src/glyphs.h @@ -327,6 +327,8 @@ do { \ #define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \ (type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m) +#define INSTANTIATOR_TYPE(inst) (XVECTOR_DATA ((inst))[0]) + struct image_instantiator_methods * decode_device_ii_format (Lisp_Object device, Lisp_Object format, Error_behavior errb); @@ -374,6 +376,7 @@ int layout_layout (Lisp_Object image_instance, int width, int height, int xoffset, int yoffset, Lisp_Object domain); int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w); +Lisp_Object make_image_instance_cache_hash_table (void); DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, int given_dest_mask, diff --git a/src/menubar.c b/src/menubar.c index 7332455..d0d60d7 100644 --- a/src/menubar.c +++ b/src/menubar.c @@ -115,9 +115,6 @@ menubar_visible_p_changed (Lisp_Object specifier, struct window *w, Lisp_Object oldval) { MARK_MENUBAR_CHANGED; - /* This is to force subwindow offsets to be recalculated - see - x_redisplay_widget (). */ - MARK_FRAME_CHANGED (WINDOW_XFRAME (w)); } static void diff --git a/src/mule-ccl.c b/src/mule-ccl.c index afd30d6..0029611 100644 --- a/src/mule-ccl.c +++ b/src/mule-ccl.c @@ -600,7 +600,7 @@ static tr_stack *mapping_stack_pointer; /* If this variable is non-zero, it indicates the stack_idx of immediately called by CCL_MapMultiple. */ -static int stack_idx_of_map_multiple = 0; +static int stack_idx_of_map_multiple; #define PUSH_MAPPING_STACK(restlen, orig) \ do { \ diff --git a/src/redisplay-x.c b/src/redisplay-x.c index 999d3a5..c1b7fca 100644 --- a/src/redisplay-x.c +++ b/src/redisplay-x.c @@ -514,7 +514,7 @@ x_output_display_block (struct window *w, struct display_line *dl, int block, /***************************************************************************** x_bevel_area - Draw a shadows for the given area in the given face. + Draw shadows for the given area in the given face. ****************************************************************************/ static void x_bevel_area (struct window *w, face_index findex, diff --git a/src/redisplay.h b/src/redisplay.h index 12fbc1c..721994e 100644 --- a/src/redisplay.h +++ b/src/redisplay.h @@ -137,7 +137,7 @@ struct rune union /* Information specific to the type of rune */ { - /* #### GLyphs are rare. Is it really necessary to waste 8 bytes on every + /* #### Glyphs are rare. Is it really necessary to waste 8 bytes on every rune for that?! */ /* DGLYPH */ struct diff --git a/src/regex.c b/src/regex.c index ff570ea..1abca94 100644 --- a/src/regex.c +++ b/src/regex.c @@ -4157,7 +4157,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, /* Call before fetching a character with *d. This switches over to string2 if necessary. */ -#define PREFETCH() \ +#define REGEX_PREFETCH() \ while (d == dend) \ { \ /* End of string2 => fail. */ \ @@ -4699,7 +4699,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, Emchar pat_ch, buf_ch; Bytecount pat_len; - PREFETCH (); + REGEX_PREFETCH (); pat_ch = charptr_emchar (p); buf_ch = charptr_emchar (d); if (RE_TRANSLATE (buf_ch) != pat_ch) @@ -4711,7 +4711,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, mcnt -= pat_len; #else /* not MULE */ - PREFETCH (); + REGEX_PREFETCH (); if ((unsigned char) RE_TRANSLATE (*d++) != *p++) goto fail; mcnt--; @@ -4723,7 +4723,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, { do { - PREFETCH (); + REGEX_PREFETCH (); if (*d++ != *p++) goto fail; } while (--mcnt); @@ -4736,7 +4736,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, case anychar: DEBUG_PRINT1 ("EXECUTING anychar.\n"); - PREFETCH (); + REGEX_PREFETCH (); if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) @@ -4756,7 +4756,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); - PREFETCH (); + REGEX_PREFETCH (); c = TRANSLATE (*d); /* The character to match. */ /* Cast to `unsigned' instead of `unsigned char' in case the @@ -4783,7 +4783,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, DEBUG_PRINT2 ("EXECUTING charset_mule%s.\n", not ? "_not" : ""); - PREFETCH (); + REGEX_PREFETCH (); c = charptr_emchar ((const Bufbyte *) d); c = TRANSLATE_EXTENDED_UNSAFE (c); /* The character to match. */ @@ -5035,7 +5035,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, if (d2 == dend2) break; /* If necessary, advance to next segment in data. */ - PREFETCH (); + REGEX_PREFETCH (); /* How many characters left in this segment to match. */ mcnt = dend - d; @@ -5594,7 +5594,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, int matches; Emchar emch; - PREFETCH (); + REGEX_PREFETCH (); emch = charptr_emchar ((const Bufbyte *) d); matches = (SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), @@ -5627,7 +5627,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, Emchar emch; mcnt = *p++; - PREFETCH (); + REGEX_PREFETCH (); emch = charptr_emchar ((const Bufbyte *) d); INC_CHARPTR (d); if (check_category_char(emch, regex_emacs_buffer->category_table, @@ -5645,7 +5645,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, #else /* not emacs */ case wordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); - PREFETCH (); + REGEX_PREFETCH (); if (!WORDCHAR_P_UNSAFE ((int) (*d))) goto fail; SET_REGS_MATCHED (); @@ -5654,7 +5654,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, case notwordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); - PREFETCH (); + REGEX_PREFETCH (); if (!WORDCHAR_P_UNSAFE ((int) (*d))) goto fail; SET_REGS_MATCHED (); diff --git a/src/window.c b/src/window.c index ef0cf7f..7790ce7 100644 --- a/src/window.c +++ b/src/window.c @@ -281,9 +281,8 @@ allocate_window (void) p->face_cachels = Dynarr_new (face_cachel); p->glyph_cachels = Dynarr_new (glyph_cachel); p->line_start_cache = Dynarr_new (line_start_cache); - p->subwindow_instance_cache = make_lisp_hash_table (30, - HASH_TABLE_KEY_VALUE_WEAK, - HASH_TABLE_EQ); + p->subwindow_instance_cache = make_image_instance_cache_hash_table (); + p->line_cache_last_updated = Qzero; INIT_DISP_VARIABLE (last_point_x, 0); INIT_DISP_VARIABLE (last_point_y, 0); @@ -3604,9 +3603,7 @@ make_dummy_parent (Lisp_Object window) p->face_cachels = Dynarr_new (face_cachel); p->glyph_cachels = Dynarr_new (glyph_cachel); p->subwindow_instance_cache = - make_lisp_hash_table (30, - HASH_TABLE_KEY_VALUE_WEAK, - HASH_TABLE_EQ); + make_image_instance_cache_hash_table (); /* Put new into window structure in place of window */ replace_window (window, new); @@ -5478,9 +5475,8 @@ by `current-window-configuration' (which see). set. */ if (NILP (w->subwindow_instance_cache)) w->subwindow_instance_cache = - make_lisp_hash_table (30, - HASH_TABLE_KEY_VALUE_WEAK, - HASH_TABLE_EQ); + make_image_instance_cache_hash_table (); + SET_LAST_MODIFIED (w, 1); SET_LAST_FACECHANGE (w); w->config_mark = 0; @@ -5861,14 +5857,20 @@ its value is -not- saved. /* config->frame_width = FRAME_WIDTH (f); config->frame_height = FRAME_HEIGHT (f); */ - /* When using `push-window-configuration', often the minibuffer ends + /* #### When using `push-window-configuration', often the minibuffer ends up as the selected window because functions run as the result of user interaction e.g. hyper-apropos. It seems to me the sensible - thing to do is not record the minibuffer here. */ + thing to do is not record the minibuffer here. + + #### Unfortunately this is a change to previous behaviour, however logical + it may be, so revert for the moment. */ +#if 0 if (FRAME_MINIBUF_ONLY_P (f) || minibuf_level) config->current_window = FRAME_SELECTED_WINDOW (f); else config->current_window = FRAME_LAST_NONMINIBUF_WINDOW (f); +#endif + config->current_window = FRAME_SELECTED_WINDOW (f); XSETBUFFER (config->current_buffer, current_buffer); config->minibuffer_scroll_window = Vminibuffer_scroll_window; config->root_window = FRAME_ROOT_WINDOW (f); diff --git a/tests/ChangeLog b/tests/ChangeLog index 863abf1..74bfcd5 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2001-01-08 Martin Buchholz + + * XEmacs 21.2.40 is released. + 2000-12-31 Martin Buchholz * XEmacs 21.2.39 is released. -- 1.7.10.4