Subject: Re: NT emacs transient-mark-mode performance problem

From: "Kim F. Storm" <[email-masked]>
Date: Tue, 6 May 1997 10:21:29 +0200 (MET DST)

Richard, 

I tried your fix and it seems to work fine.

However, I had to remove the test on current_buffer->last_selected_window,
since that field does not exist in the 19.34.1 sources.

Consequently, I cannot test whether setting the variable
highlight-nonselected-windows to t with your patch will work (since
you seem to unconditionally set w->region_showing to Qnil for
non-selected windows).

In any case the cursor movements are still painfully slow with NTemacs
when the current buffer is shown in more than one window (since that
still forces the menu-bar to be refreshed on every character).

BTW, I noticed that the update_menu_bar function (in xdisp.c) and the
set_frame_menubar (in w32menu.c) share a lot of code related to
changing buffers and running the various menu-bar hooks.  In the
xmenu.c version of set_frame_menubar the execution of the duplicated
code is protected by the "first_time" parameter, but this parameter is
ignored in the w32menu.c version which means that those hooks are
run twice in NTemacs!

++Kim

   Date: Mon, 5 May 1997 23:46:08 -0400
   From: Richard Stallman <[email-masked]>

   I made the change this way instead--I think both parts are
   desirable, though I am not sure.

   Thanks.

   *** xdisp.c	1997/04/10 21:15:53	1.266
   --- xdisp.c	1997/05/06 03:35:29
   ***************
   *** 1270,1275 ****
   --- 1270,1284 ----
	     w->last_had_star
	       = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer))
		  ? Qt : Qnil);
   + 
   + 	  /* Record if we are showing a region, so can make sure to
   + 	     update it fully at next redisplay.  */
   + 	  w->region_showing = (!NILP (Vtransient_mark_mode)
   + 			       && w == XWINDOW (current_buffer->last_selected_window)
   + 			       && !NILP (XBUFFER (w->buffer)->mark_active)
   + 			       ? Fmarker_position (XBUFFER (w->buffer)->mark)
   + 			       : Qnil);
   + 
	     w->window_end_valid = w->buffer;
	     last_arrow_position = Voverlay_arrow_position;
	     last_arrow_string = Voverlay_arrow_string;
   ***************
   *** 2850,2856 ****
	   w->region_showing = Qt;
	 }
       else
   !     region_beg = region_end = -1;

       if (MINI_WINDOW_P (w)
	   && start == BEG
   --- 2859,2868 ----
	   w->region_showing = Qt;
	 }
       else
   !     {
   !       region_beg = region_end = -1;
   !       w->region_showing = Qnil;
   !     }

       if (MINI_WINDOW_P (w)
	   && start == BEG