diff options
| author | Stefan Monnier | 2008-01-19 05:22:33 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-01-19 05:22:33 +0000 |
| commit | 823e0ebb51743ee935104b98badfa4a015ff231a (patch) | |
| tree | 9d21f09fc994d688604f52135b846ca5ed8b6b96 /src | |
| parent | c3b232e48e3200d4a3350f73213709e1bf12145c (diff) | |
| download | emacs-823e0ebb51743ee935104b98badfa4a015ff231a.tar.gz emacs-823e0ebb51743ee935104b98badfa4a015ff231a.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 27 |
2 files changed, 18 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2f30dfcf807..3e11968fb58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2008-01-19 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-01-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * xdisp.c (Qauto_hscroll_mode): New var. | ||
| 4 | (syms_of_xdisp): Initialize it. | ||
| 5 | (hscroll_window_tree): Use it to lookup `auto-hscroll-mode' in each | ||
| 6 | window's buffer. | ||
| 7 | (hscroll_windows): Don't check automatic_hscrolling_p here. | ||
| 8 | |||
| 3 | * window.c (set_window_buffer): Don't unnecessarily reset hscroll and | 9 | * window.c (set_window_buffer): Don't unnecessarily reset hscroll and |
| 4 | vscroll if we're setting window-buffer to the value it already has. | 10 | vscroll if we're setting window-buffer to the value it already has. |
| 5 | 11 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 19ee4a0a92d..dfa18bfacb7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -689,6 +689,7 @@ int trace_move; | |||
| 689 | point visible. */ | 689 | point visible. */ |
| 690 | 690 | ||
| 691 | int automatic_hscrolling_p; | 691 | int automatic_hscrolling_p; |
| 692 | Lisp_Object Qauto_hscroll_mode; | ||
| 692 | 693 | ||
| 693 | /* How close to the margin can point get before the window is scrolled | 694 | /* How close to the margin can point get before the window is scrolled |
| 694 | horizontally. */ | 695 | horizontally. */ |
| @@ -10381,11 +10382,12 @@ hscroll_window_tree (window) | |||
| 10381 | /* Scroll when cursor is inside this scroll margin. */ | 10382 | /* Scroll when cursor is inside this scroll margin. */ |
| 10382 | h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); | 10383 | h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); |
| 10383 | 10384 | ||
| 10384 | if ((XFASTINT (w->hscroll) | 10385 | if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) |
| 10385 | && w->cursor.x <= h_margin) | 10386 | && ((XFASTINT (w->hscroll) |
| 10386 | || (cursor_row->enabled_p | 10387 | && w->cursor.x <= h_margin) |
| 10387 | && cursor_row->truncated_on_right_p | 10388 | || (cursor_row->enabled_p |
| 10388 | && (w->cursor.x >= text_area_width - h_margin))) | 10389 | && cursor_row->truncated_on_right_p |
| 10390 | && (w->cursor.x >= text_area_width - h_margin)))) | ||
| 10389 | { | 10391 | { |
| 10390 | struct it it; | 10392 | struct it it; |
| 10391 | int hscroll; | 10393 | int hscroll; |
| @@ -10475,16 +10477,9 @@ static int | |||
| 10475 | hscroll_windows (window) | 10477 | hscroll_windows (window) |
| 10476 | Lisp_Object window; | 10478 | Lisp_Object window; |
| 10477 | { | 10479 | { |
| 10478 | int hscrolled_p; | 10480 | int hscrolled_p = hscroll_window_tree (window); |
| 10479 | 10481 | if (hscrolled_p) | |
| 10480 | if (automatic_hscrolling_p) | 10482 | clear_desired_matrices (XFRAME (WINDOW_FRAME (XWINDOW (window)))); |
| 10481 | { | ||
| 10482 | hscrolled_p = hscroll_window_tree (window); | ||
| 10483 | if (hscrolled_p) | ||
| 10484 | clear_desired_matrices (XFRAME (WINDOW_FRAME (XWINDOW (window)))); | ||
| 10485 | } | ||
| 10486 | else | ||
| 10487 | hscrolled_p = 0; | ||
| 10488 | return hscrolled_p; | 10483 | return hscrolled_p; |
| 10489 | } | 10484 | } |
| 10490 | 10485 | ||
| @@ -24387,6 +24382,8 @@ the frame's other specifications determine how to blink the cursor off. */); | |||
| 24387 | DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p, | 24382 | DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p, |
| 24388 | doc: /* *Non-nil means scroll the display automatically to make point visible. */); | 24383 | doc: /* *Non-nil means scroll the display automatically to make point visible. */); |
| 24389 | automatic_hscrolling_p = 1; | 24384 | automatic_hscrolling_p = 1; |
| 24385 | Qauto_hscroll_mode = intern ("auto-hscroll-mode"); | ||
| 24386 | staticpro (&Qauto_hscroll_mode); | ||
| 24390 | 24387 | ||
| 24391 | DEFVAR_INT ("hscroll-margin", &hscroll_margin, | 24388 | DEFVAR_INT ("hscroll-margin", &hscroll_margin, |
| 24392 | doc: /* *How many columns away from the window edge point is allowed to get | 24389 | doc: /* *How many columns away from the window edge point is allowed to get |