emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/window.c


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/window.c
Date: Sat, 17 May 2003 17:18:25 -0400

Index: emacs/src/window.c
diff -c emacs/src/window.c:1.438 emacs/src/window.c:1.439
*** emacs/src/window.c:1.438    Mon Mar 31 15:35:51 2003
--- emacs/src/window.c  Sat May 17 17:18:25 2003
***************
*** 55,61 ****
  
  static int displayed_window_lines P_ ((struct window *));
  static struct window *decode_window P_ ((Lisp_Object));
- static Lisp_Object select_window_1 P_ ((Lisp_Object, int));
  static int count_windows P_ ((struct window *));
  static int get_leaf_windows P_ ((struct window *, struct window **, int));
  static void window_scroll P_ ((Lisp_Object, int, int, int));
--- 55,60 ----
***************
*** 1299,1305 ****
           delete the selected window on any other frame, we shouldn't do
           anything but set the frame's selected_window slot.  */
        if (EQ (FRAME_SELECTED_WINDOW (f), selected_window))
!         Fselect_window (swindow);
        else
          FRAME_SELECTED_WINDOW (f) = swindow;
        }
--- 1298,1304 ----
           delete the selected window on any other frame, we shouldn't do
           anything but set the frame's selected_window slot.  */
        if (EQ (FRAME_SELECTED_WINDOW (f), selected_window))
!         Fselect_window (swindow, Qnil);
        else
          FRAME_SELECTED_WINDOW (f) = swindow;
        }
***************
*** 1698,1704 ****
    for (; i < 0; ++i)
      window = Fprevious_window (window, Qnil, all_frames);
  
!   Fselect_window (window);
    return Qnil;
  }
  
--- 1697,1703 ----
    for (; i < 0; ++i)
      window = Fprevious_window (window, Qnil, all_frames);
  
!   Fselect_window (window, Qnil);
    return Qnil;
  }
  
***************
*** 2782,2807 ****
    return Qnil;
  }
  
! DEFUN ("select-window", Fselect_window, Sselect_window, 1, 1, 0,
         doc: /* Select WINDOW.  Most editing will apply to WINDOW's buffer.
  If WINDOW is not already selected, also make WINDOW's buffer current.
  Also make WINDOW the frame's selected window.
  
  Note that the main editor command loop
  selects the buffer of the selected window before each command.  */)
!      (window)
!      register Lisp_Object window;
! {
!   return select_window_1 (window, 1);
! }
! 
! /* Note that selected_window can be nil
!    when this is called from Fset_window_configuration.  */
! 
! static Lisp_Object
! select_window_1 (window, recordflag)
!      register Lisp_Object window;
!      int recordflag;
  {
    register struct window *w;
    register struct window *ow;
--- 2781,2797 ----
    return Qnil;
  }
  
! DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
         doc: /* Select WINDOW.  Most editing will apply to WINDOW's buffer.
  If WINDOW is not already selected, also make WINDOW's buffer current.
  Also make WINDOW the frame's selected window.
+ Optional second arg NORECORD non-nil means
+ do not put this buffer at the front of the list of recently selected ones.
  
  Note that the main editor command loop
  selects the buffer of the selected window before each command.  */)
!      (window, norecord)
!      register Lisp_Object window, norecord;
  {
    register struct window *w;
    register struct window *ow;
***************
*** 2839,2845 ****
    else
      sf->selected_window = window;
  
!   if (recordflag)
      record_buffer (w->buffer);
    Fset_buffer (w->buffer);
  
--- 2829,2835 ----
    else
      sf->selected_window = window;
  
!   if (NILP (norecord))
      record_buffer (w->buffer);
    Fset_buffer (w->buffer);
  
***************
*** 2863,2868 ****
--- 2853,2865 ----
    windows_or_buffers_changed++;
    return window;
  }
+ 
+ static Lisp_Object
+ select_window_norecord (window)
+      Lisp_Object window;
+ {
+   return Fselect_window (window, Qt);
+ }
  
  /* Deiconify the frame containing the window WINDOW,
     unless it is the selected frame;
***************
*** 3205,3222 ****
              if (!NILP (tem))
                {
                  int count = SPECPDL_INDEX ();
!                 Lisp_Object prev_window;
                  prev_window = selected_window;
  
!                 /* Select the window that was chosen, for running the hook.  
*/
!                 /* Both this Fselect_window and the select_window_1
!                    below will (may) incorrectly set-buffer to the buffer
!                    displayed in the window.  --stef  */
!                 record_unwind_protect (Fselect_window, prev_window);
!                 select_window_1 (window, 0);
                  Fset_buffer (w->buffer);
                  call1 (Vrun_hooks, Qtemp_buffer_show_hook);
-                 select_window_1 (prev_window, 0);
                  unbind_to (count, Qnil);
                }
            }
--- 3202,3220 ----
              if (!NILP (tem))
                {
                  int count = SPECPDL_INDEX ();
!                 Lisp_Object prev_window, prev_buffer;
                  prev_window = selected_window;
+                 XSETBUFFER (prev_buffer, old);
  
!                 /* Select the window that was chosen, for running the hook.
!                    Note: Both Fselect_window and select_window_norecord may
!                    set-buffer to the buffer displayed in the window,
!                    so we need to save the current buffer.  --stef  */
!                 record_unwind_protect (Fset_buffer, prev_buffer);
!                 record_unwind_protect (select_window_norecord, prev_window);
!                 Fselect_window (window, Qt);
                  Fset_buffer (w->buffer);
                  call1 (Vrun_hooks, Qtemp_buffer_show_hook);
                  unbind_to (count, Qnil);
                }
            }
***************
*** 5220,5226 ****
                               make_number (old_point),
                               XWINDOW (data->current_window)->buffer);
  
!       Fselect_window (data->current_window);
        XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
        = selected_window;
  
--- 5218,5224 ----
                               make_number (old_point),
                               XWINDOW (data->current_window)->buffer);
  
!       Fselect_window (data->current_window, Qnil);
        XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
        = selected_window;
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]