]> git.eshelyaron.com Git - emacs.git/commitdiff
(Qauto_hscroll_mode): New var.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 19 Jan 2008 05:22:33 +0000 (05:22 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 19 Jan 2008 05:22:33 +0000 (05:22 +0000)
(syms_of_xdisp): Initialize it.
(hscroll_window_tree): Use it to lookup `auto-hscroll-mode' in each
window's buffer.
(hscroll_windows): Don't check automatic_hscrolling_p here.

src/ChangeLog
src/xdisp.c

index 2f30dfcf8075a2642afff9210e7a350ffc184c6b..3e11968fb581e5fa25a73c9c62b88f787bd671d9 100644 (file)
@@ -1,5 +1,11 @@
 2008-01-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * xdisp.c (Qauto_hscroll_mode): New var.
+       (syms_of_xdisp): Initialize it.
+       (hscroll_window_tree): Use it to lookup `auto-hscroll-mode' in each
+       window's buffer.
+       (hscroll_windows): Don't check automatic_hscrolling_p here.
+
        * window.c (set_window_buffer): Don't unnecessarily reset hscroll and
        vscroll if we're setting window-buffer to the value it already has.
 
index 19ee4a0a92d530c17842a4c5be9c166882032237..dfa18bfacb743e5838d612e09d1d3a6bec2b7f94 100644 (file)
@@ -689,6 +689,7 @@ int trace_move;
    point visible.  */
 
 int automatic_hscrolling_p;
+Lisp_Object Qauto_hscroll_mode;
 
 /* How close to the margin can point get before the window is scrolled
    horizontally.  */
@@ -10381,11 +10382,12 @@ hscroll_window_tree (window)
          /* Scroll when cursor is inside this scroll margin.  */
          h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
 
-         if ((XFASTINT (w->hscroll)
-              && w->cursor.x <= h_margin)
-             || (cursor_row->enabled_p
-                 && cursor_row->truncated_on_right_p
-                 && (w->cursor.x >= text_area_width - h_margin)))
+         if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer))
+             && ((XFASTINT (w->hscroll)
+                  && w->cursor.x <= h_margin)
+                 || (cursor_row->enabled_p
+                     && cursor_row->truncated_on_right_p
+                     && (w->cursor.x >= text_area_width - h_margin))))
            {
              struct it it;
              int hscroll;
@@ -10475,16 +10477,9 @@ static int
 hscroll_windows (window)
      Lisp_Object window;
 {
-  int hscrolled_p;
-
-  if (automatic_hscrolling_p)
-    {
-      hscrolled_p = hscroll_window_tree (window);
-      if (hscrolled_p)
-       clear_desired_matrices (XFRAME (WINDOW_FRAME (XWINDOW (window))));
-    }
-  else
-    hscrolled_p = 0;
+  int hscrolled_p = hscroll_window_tree (window);
+  if (hscrolled_p)
+    clear_desired_matrices (XFRAME (WINDOW_FRAME (XWINDOW (window))));
   return hscrolled_p;
 }
 
@@ -24387,6 +24382,8 @@ the frame's other specifications determine how to blink the cursor off.  */);
   DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p,
     doc: /* *Non-nil means scroll the display automatically to make point visible.  */);
   automatic_hscrolling_p = 1;
+  Qauto_hscroll_mode = intern ("auto-hscroll-mode");
+  staticpro (&Qauto_hscroll_mode);
 
   DEFVAR_INT ("hscroll-margin", &hscroll_margin,
     doc: /* *How many columns away from the window edge point is allowed to get