/[emacs]/emacs/src/window.c
ViewVC logotype

Diff of /emacs/src/window.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.415 by rms, Tue May 28 20:26:34 2002 UTC revision 1.416 by rms, Thu May 30 17:04:59 2002 UTC
# Line 4938  the return value is nil.  Otherwise the Line 4938  the return value is nil.  Otherwise the
4938    Lisp_Object new_current_buffer;    Lisp_Object new_current_buffer;
4939    Lisp_Object frame;    Lisp_Object frame;
4940    FRAME_PTR f;    FRAME_PTR f;
   int old_point = -1;  
4941    
4942    while (!WINDOW_CONFIGURATIONP (configuration))    while (!WINDOW_CONFIGURATIONP (configuration))
4943      wrong_type_argument (Qwindow_configuration_p, configuration);      wrong_type_argument (Qwindow_configuration_p, configuration);
# Line 4949  the return value is nil.  Otherwise the Line 4948  the return value is nil.  Otherwise the
4948    new_current_buffer = data->current_buffer;    new_current_buffer = data->current_buffer;
4949    if (NILP (XBUFFER (new_current_buffer)->name))    if (NILP (XBUFFER (new_current_buffer)->name))
4950      new_current_buffer = Qnil;      new_current_buffer = Qnil;
   else  
     {  
       if (XBUFFER (new_current_buffer) == current_buffer)  
         old_point = PT;  
     }  
4951    
4952    frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;    frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
4953    f = XFRAME (frame);    f = XFRAME (frame);
# Line 5105  the return value is nil.  Otherwise the Line 5099  the return value is nil.  Otherwise the
5099                                 p->mark, w->buffer);                                 p->mark, w->buffer);
5100    
5101                    /* As documented in Fcurrent_window_configuration, don't                    /* As documented in Fcurrent_window_configuration, don't
5102                       save the location of point in the buffer which was current                       restore the location of point in the buffer which was
5103                       when the window configuration was recorded.  */                       current when the window configuration was recorded.  */
5104                    if (!EQ (p->buffer, new_current_buffer)                    if (!EQ (p->buffer, new_current_buffer)
5105                        && XBUFFER (p->buffer) == current_buffer)                        && XBUFFER (p->buffer) == current_buffer)
5106                      Fgoto_char (w->pointm);                      Fgoto_char (w->pointm);
# Line 5144  the return value is nil.  Otherwise the Line 5138  the return value is nil.  Otherwise the
5138           That swapping out has already been done,           That swapping out has already been done,
5139           near the beginning of this function.  */           near the beginning of this function.  */
5140        selected_window = Qnil;        selected_window = Qnil;
5141          if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer))
5142            set_marker_restricted (XWINDOW (data->current_window)->pointm,
5143                                   make_number (BUF_PT (XBUFFER (XWINDOW (data->current_window)->buffer))),
5144                                   XWINDOW (data->current_window)->buffer);
5145                      
5146        Fselect_window (data->current_window);        Fselect_window (data->current_window);
5147        XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window        XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
5148          = selected_window;          = selected_window;
# Line 5189  the return value is nil.  Otherwise the Line 5188  the return value is nil.  Otherwise the
5188            else if (EQ (leaf_windows[i]->buffer, new_current_buffer))            else if (EQ (leaf_windows[i]->buffer, new_current_buffer))
5189              ++n;              ++n;
5190          }          }
   
       /* If more than one window shows the new and old current buffer,  
          don't try to preserve point in that buffer.  */  
       if (old_point > 0 && n > 1)  
         old_point = -1;  
5191                
5192        adjust_glyphs (f);        adjust_glyphs (f);
5193    
# Line 5213  the return value is nil.  Otherwise the Line 5207  the return value is nil.  Otherwise the
5207      }      }
5208    
5209    if (!NILP (new_current_buffer))    if (!NILP (new_current_buffer))
5210      {      Fset_buffer (new_current_buffer);
       Fset_buffer (new_current_buffer);  
   
       /* If the buffer that is current now is the same  
          that was current before setting the window configuration,  
          don't alter its PT.  */  
       if (old_point >= 0)  
         SET_PT (old_point);  
     }  
5211    
5212    /* Restore the minimum heights recorded in the configuration.  */    /* Restore the minimum heights recorded in the configuration.  */
5213    window_min_height = XINT (data->min_height);    window_min_height = XINT (data->min_height);

Legend:
Removed from v.1.415  
changed lines
  Added in v.1.416

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26