From storm@olicom.dk  Tue May  6 01:21:38 1997
X-VM-v5-Data: ([nil nil nil nil nil t nil nil nil]
	[nil "Tue" " 6" "May" "1997" "10:21:29" "+0200" "Kim F. Storm" "storm@olicom.dk" nil "76" "Re: NT emacs transient-mark-mode performance problem" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from olicom.olicom.dk (eolicom.olicom.dk [194.255.19.1]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id BAA13363; Tue, 6 May 1997 01:21:35 -0700
Received: from kfs.olicom.dk (kfs.olicom.dk [172.16.99.27]) by olicom.olicom.dk (8.7.5/8.7.3/efh.2.24) with SMTP id KAA27167; Tue, 6 May 1997 10:21:29 +0200 (MET DST)
Message-Id: <199705060821.KAA27167@olicom.olicom.dk>
In-reply-to: <199705060346.XAA16101@psilocin.gnu.ai.mit.edu> (message from 	Richard Stallman on Mon, 5 May 1997 23:46:08 -0400)
From: "Kim F. Storm" <storm@olicom.dk>
To: rms@gnu.ai.mit.edu
CC: andrewi@harlequin.co.uk, voelker@cs.washington.edu,         nagler_robert@tandem.com, ntemacs-users@cs.washington.edu
Subject: Re: NT emacs transient-mark-mode performance problem
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 <rms@gnu.ai.mit.edu>

   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


