texinfo-commits
[Top][All Lists]
Advanced

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

[5636] info_split_window


From: Gavin D. Smith
Subject: [5636] info_split_window
Date: Tue, 03 Jun 2014 16:40:35 +0000

Revision: 5636
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5636
Author:   gavin
Date:     2014-06-03 16:40:34 +0000 (Tue, 03 Jun 2014)
Log Message:
-----------
info_split_window

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/echo-area.c
    trunk/info/session.c
    trunk/info/window.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-06-03 16:23:27 UTC (rev 5635)
+++ trunk/ChangeLog     2014-06-03 16:40:34 UTC (rev 5636)
@@ -1,5 +1,14 @@
 2014-06-03  Gavin Smith  <address@hidden>
 
+       * info/session.c (info_split_window): Always operate on active
+       window.
+       * info/window.c (window_make_window)
+       * info/session.c (info_split_window)
+       * info/echo-area.c (ea_possible_completions) [!SPLIT_BEFORE_ACTIVE]:
+       Made unconditional.
+
+2014-06-03  Gavin Smith  <address@hidden>
+
        * info/session.c (info_search_in_node_internal, info_search_internal):
        Replace calls to set_remembered_pagetop_and_point,
        window_set_node_of_window and remember_window_and_node with call to

Modified: trunk/info/echo-area.c
===================================================================
--- trunk/info/echo-area.c      2014-06-03 16:23:27 UTC (rev 5635)
+++ trunk/info/echo-area.c      2014-06-03 16:40:34 UTC (rev 5636)
@@ -1045,16 +1045,10 @@
                && calling_window->height / 2 >= WINDOW_MIN_SIZE)
               {
                 int pagetop;
-#ifdef SPLIT_BEFORE_ACTIVE
-                int start, end;
-#endif
 
                 active_window = calling_window;
 
                 /* Perhaps we can scroll this window on redisplay. */
-#ifdef SPLIT_BEFORE_ACTIVE
-                start = calling_window->first_row;
-#endif
                 pagetop = calling_window->pagetop;
 
                 compwin =
@@ -1066,16 +1060,6 @@
                 window_adjust_pagetop (calling_window);
                 remember_calling_window (calling_window);
 
-#if defined (SPLIT_BEFORE_ACTIVE)
-                /* If the pagetop hasn't changed, scrolling the calling
-                   window is a reasonable thing to do. */
-                if (pagetop == calling_window->pagetop)
-                  {
-                    end = start + calling_window->height;
-                    display_scroll_display
-                      (start, end, calling_window->prev->height + 1);
-                  }
-#else /* !SPLIT_BEFORE_ACTIVE */
                 /* If the pagetop has changed, set the new pagetop here. */
                 if (pagetop != calling_window->pagetop)
                   {
@@ -1083,7 +1067,6 @@
                     calling_window->pagetop = pagetop;
                     set_window_pagetop (calling_window, newtop);
                   }
-#endif /* !SPLIT_BEFORE_ACTIVE */
 
                 echo_area_completions_window = compwin;
               }

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-06-03 16:23:27 UTC (rev 5635)
+++ trunk/info/session.c        2014-06-03 16:40:34 UTC (rev 5636)
@@ -357,7 +357,7 @@
    windows.  If we are doing automatic footnote display, also try to display
    the footnotes for this window. */
 void
-info_set_node_of_window (WINDOW *window, NODE *node)
+info_set_node_of_window (WINDOW *win, NODE *node)
 {
   /* Remember the current values of pagetop and point if the remembered node
      is the same as the current one being displayed. */
@@ -368,15 +368,15 @@
     }
 
   /* Put this node into the window. */
-  window_set_node_of_window (window, node);
+  window_set_node_of_window (win, node);
 
   /* Remember this node and window in our list of info windows. */
-  remember_window_and_node (window);
+  remember_window_and_node (win);
 
   /* If doing auto-footnote display/undisplay, show the footnotes belonging
      to this window's node. */
   if (auto_footnotes_p)
-    info_get_or_remove_footnotes (window);
+    info_get_or_remove_footnotes (win);
 }
 
 
@@ -1269,47 +1269,24 @@
     }
 }
 
-/* Split WINDOW into two windows, both showing the same node.  If we
+/* Split active window into two windows, both showing the same node.  If we
    are automatically tiling windows, re-tile after the split. */
 DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
 {
-  WINDOW *split, *old_active;
+  WINDOW *split;
   NODE *copy;
-#if defined (SPLIT_BEFORE_ACTIVE)
-  int pagetop;
-
-  /* Remember the current pagetop of the window being split.  If it doesn't
-     change, we can scroll its contents around after the split. */
-  pagetop = window->pagetop;
-#endif
   
   copy = xmalloc (sizeof (NODE));
   *copy = *window->node; /* Field-by-field copy of structure. */
   /* Make the new window. */
-  old_active = active_window;
-  active_window = window;
   split = window_make_window (copy);
-  active_window = old_active;
 
   if (!split)
     info_error ("%s", msg_win_too_small);
   else
     {
-#if defined (SPLIT_BEFORE_ACTIVE)
-      /* Try to scroll the old window into its new postion. */
-      if (pagetop == window->pagetop)
-        {
-          int start, end, amount;
-
-          start = split->first_row;
-          end = start + window->height;
-          amount = split->height + 1;
-          display_scroll_display (start, end, amount);
-        }
-#else /* !SPLIT_BEFORE_ACTIVE */
       /* Make sure point still appears in the active window. */
       info_show_point (window);
-#endif /* !SPLIT_BEFORE_ACTIVE */
 
       split->pagetop = window->pagetop;
 

Modified: trunk/info/window.c
===================================================================
--- trunk/info/window.c 2014-06-03 16:23:27 UTC (rev 5635)
+++ trunk/info/window.c 2014-06-03 16:40:34 UTC (rev 5636)
@@ -287,12 +287,8 @@
   window = xzalloc (sizeof (WINDOW));
   window->width = the_screen->width;
   window->height = (active_window->height / 2) - 1;
-#if defined (SPLIT_BEFORE_ACTIVE)
-  window->first_row = active_window->first_row;
-#else
   window->first_row = active_window->first_row +
     (active_window->height - window->height);
-#endif
   window->keymap = info_keymap;
   window->goal_column = -1;
   memset (&window->line_map, 0, sizeof (window->line_map));
@@ -303,28 +299,12 @@
 
   /* Adjust the height of the old active window. */
   active_window->height -= (window->height + 1);
-#if defined (SPLIT_BEFORE_ACTIVE)
-  active_window->first_row += (window->height + 1);
-#endif
   active_window->flags |= W_UpdateWindow;
 
   /* We do have to readjust the existing active window. */
   window_adjust_pagetop (active_window);
   window_make_modeline (active_window);
 
-#if defined (SPLIT_BEFORE_ACTIVE)
-  /* This window is just before the active one.  The active window gets
-     bumped down one.  The active window is not changed. */
-  window->next = active_window;
-
-  window->prev = active_window->prev;
-  active_window->prev = window;
-
-  if (window->prev)
-    window->prev->next = window;
-  else
-    windows = window;
-#else
   /* This window is just after the active one.  Which window is active is
      not changed. */
   window->prev = active_window;
@@ -332,7 +312,6 @@
   active_window->next = window;
   if (window->next)
     window->next->prev = window;
-#endif /* !SPLIT_BEFORE_ACTIVE */
   return window;
 }
 




reply via email to

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